0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-28 16:15:23 +08:00

Merge pull request #604 from ricnewton/cmake_fix

Fix cmake build
This commit is contained in:
Ian Barber 2013-07-01 04:07:44 -07:00
commit a3e16c18b1
2 changed files with 7 additions and 6 deletions

View File

@ -339,6 +339,7 @@ set(cxx-sources
session_base.cpp
signaler.cpp
socket_base.cpp
stream.cpp
stream_engine.cpp
sub.cpp
tcp.cpp

View File

@ -54,15 +54,15 @@ char *
Z85_encode (char *dest, uint8_t *data, size_t size)
{
assert (size % 4 == 0);
uint char_nbr = 0;
uint byte_nbr = 0;
unsigned int char_nbr = 0;
unsigned int byte_nbr = 0;
uint32_t value = 0;
while (byte_nbr < size) {
// Accumulate value in base 256 (binary)
value = value * 256 + data [byte_nbr++];
if (byte_nbr % 4 == 0) {
// Output value in base 85
uint divisor = 85 * 85 * 85 * 85;
unsigned int divisor = 85 * 85 * 85 * 85;
while (divisor) {
dest [char_nbr++] = encoder [value / divisor % 85];
divisor /= 85;
@ -85,15 +85,15 @@ uint8_t *
Z85_decode (uint8_t *dest, char *string)
{
assert (strlen (string) % 5 == 0);
uint byte_nbr = 0;
uint char_nbr = 0;
unsigned int byte_nbr = 0;
unsigned int char_nbr = 0;
uint32_t value = 0;
while (char_nbr < strlen (string)) {
// Accumulate value in base 85
value = value * 85 + decoder [(uint8_t) string [char_nbr++] - 32];
if (char_nbr % 5 == 0) {
// Output value in base 256
uint divisor = 256 * 256 * 256;
unsigned int divisor = 256 * 256 * 256;
while (divisor) {
dest [byte_nbr++] = value / divisor % 256;
divisor /= 256;