summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-09-02 08:07:40 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-02 08:07:40 +0200
commit0a1f7e3524338690551c04ebfccd896a0b96f399 (patch)
tree1f2c533e9394cd8f21977b252c11abf027bd772a /src
parenta81a37399b2ab4143aedf3ff4c442655b9e7e9b7 (diff)
parent14853c2db528b3fd6eed84786053549e71f61bb7 (diff)
Merge branch 'maint'
* maint: Prior to this patch prefix_tree asserts. Fix for signaler_t on HP-UX and AIX platforms Mikael Kjaer added to AUTHORS Conflicts: src/trie.cpp
Diffstat (limited to 'src')
-rw-r--r--src/signaler.cpp6
-rw-r--r--src/trie.cpp12
-rw-r--r--src/trie.hpp2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/signaler.cpp b/src/signaler.cpp
index d65957e..d4a9214 100644
--- a/src/signaler.cpp
+++ b/src/signaler.cpp
@@ -184,7 +184,7 @@ void zmq::signaler_t::send (const command_t &cmd_)
zmq_assert (nbytes == sizeof (command_t));
}
-bool zmq::signaler_t::recv (command_t &cmd_, bool block_)
+bool zmq::signaler_t::recv (command_t *cmd_, bool block_)
{
if (block_) {
@@ -199,7 +199,7 @@ bool zmq::signaler_t::recv (command_t &cmd_, bool block_)
bool result;
ssize_t nbytes;
do {
- nbytes = ::recv (r, buffer, sizeof (command_t), 0);
+ nbytes = ::recv (r, (char*) cmd_, sizeof (command_t), 0);
} while (nbytes == -1 && errno == EINTR);
if (nbytes == -1 && errno == EAGAIN) {
result = false;
@@ -213,7 +213,7 @@ bool zmq::signaler_t::recv (command_t &cmd_, bool block_)
result = true;
}
- if (block_)
+ if (block_) {
// Set the reader to non-blocking mode.
int flags = fcntl (r, F_GETFL, 0);
diff --git a/src/trie.cpp b/src/trie.cpp
index 369f72c..8bcfbbc 100644
--- a/src/trie.cpp
+++ b/src/trie.cpp
@@ -42,7 +42,7 @@ zmq::trie_t::~trie_t ()
if (count == 1)
delete next.node;
else if (count > 1) {
- for (unsigned char i = 0; i != count; ++i)
+ for (unsigned short i = 0; i != count; ++i)
if (next.table [i])
delete next.table [i];
free (next.table);
@@ -74,7 +74,7 @@ void zmq::trie_t::add (unsigned char *prefix_, size_t size_)
next.table = (trie_t**)
malloc (sizeof (trie_t*) * count);
zmq_assert (next.table);
- for (unsigned char i = 0; i != count; ++i)
+ for (unsigned short i = 0; i != count; ++i)
next.table [i] = 0;
min = std::min (min, c);
next.table [oldc - min] = oldp;
@@ -82,25 +82,25 @@ void zmq::trie_t::add (unsigned char *prefix_, size_t size_)
else if (min < c) {
// The new character is above the current character range.
- unsigned char old_count = count;
+ unsigned short old_count = count;
count = c - min + 1;
next.table = (trie_t**) realloc ((void*) next.table,
sizeof (trie_t*) * count);
zmq_assert (next.table);
- for (unsigned char i = old_count; i != count; i++)
+ for (unsigned short i = old_count; i != count; i++)
next.table [i] = NULL;
}
else {
// The new character is below the current character range.
- unsigned char old_count = count;
+ unsigned short old_count = count;
count = (min + old_count) - c;
next.table = (trie_t**) realloc ((void*) next.table,
sizeof (trie_t*) * count);
zmq_assert (next.table);
memmove (next.table + min - c, next.table,
old_count * sizeof (trie_t*));
- for (unsigned char i = 0; i != min - c; i++)
+ for (unsigned short i = 0; i != min - c; i++)
next.table [i] = NULL;
min = c;
}
diff --git a/src/trie.hpp b/src/trie.hpp
index c085a41..08b2eac 100644
--- a/src/trie.hpp
+++ b/src/trie.hpp
@@ -42,7 +42,7 @@ namespace zmq
uint32_t refcnt;
unsigned char min;
- unsigned char count;
+ unsigned short count;
union {
class trie_t *node;
class trie_t **table;