Skip to content
Browse files

Replaced TRUE/FALSE with true/false

  • Loading branch information...
1 parent 086ab05 commit 8f8528a87ac869247ff1948b72253de0049b2b4a @hintjens committed Nov 28, 2012
Showing with 26 additions and 26 deletions.
  1. +2 −2 src/czmq_selftest.c
  2. +2 −2 src/zctx.c
  3. +1 −1 src/zfile.c
  4. +7 −7 src/zframe.c
  5. +5 −5 src/zhash.c
  6. +3 −3 src/zloop.c
  7. +1 −1 src/zmsg.c
  8. +3 −3 src/zsocket.c
  9. +2 −2 src/zstr.c
View
4 src/czmq_selftest.c
@@ -32,9 +32,9 @@ int main (int argc, char *argv [])
{
bool verbose;
if (argc == 2 && streq (argv [1], "-v"))
- verbose = TRUE;
+ verbose = true;
else
- verbose = FALSE;
+ verbose = false;
printf ("Running czmq self tests...\n");
View
4 src/zctx.c
@@ -61,7 +61,7 @@
struct _zctx_t {
void *context; // Our 0MQ context
zlist_t *sockets; // Sockets held by this thread
- bool main; // TRUE if we're the main thread
+ bool main; // True if we're the main thread
int iothreads; // Number of IO threads, default 1
int linger; // Linger timeout, default 0
};
@@ -99,7 +99,7 @@ zctx_new (void)
return NULL;
}
self->iothreads = 1;
- self->main = TRUE;
+ self->main = true;
#if defined (__UNIX__)
// Install signal handler for SIGINT and SIGTERM
View
2 src/zfile.c
@@ -131,7 +131,7 @@ zfile_test (bool verbose)
assert (rc == -1);
rc = zfile_exists ("nosuchfile");
- assert (rc == FALSE);
+ assert (rc != true);
rc = (int) zfile_size ("nosuchfile");
assert (rc == -1);
View
14 src/zframe.c
@@ -272,17 +272,17 @@ zframe_strdup (zframe_t *self)
// --------------------------------------------------------------------------
-// Return TRUE if frame body is equal to string, excluding terminator
+// Return true if frame body is equal to string, excluding terminator
bool
zframe_streq (zframe_t *self, const char *string)
{
assert (self);
if (zframe_size (self) == strlen (string)
&& memcmp (zframe_data (self), string, strlen (string)) == 0)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
@@ -308,20 +308,20 @@ zframe_zero_copy (zframe_t *self)
// --------------------------------------------------------------------------
-// Return TRUE if two frames have identical size and data
+// Return true if two frames have identical size and data
bool
zframe_eq (zframe_t *self, zframe_t *other)
{
if (!self || !other)
- return FALSE;
+ return false;
else
if (zframe_size (self) == zframe_size (other)
&& memcmp (zframe_data (self), zframe_data (other),
zframe_size (self)) == 0)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
View
10 src/zhash.c
@@ -194,7 +194,7 @@ zhash_destroy (zhash_t **self_p)
item_t *cur_item = self->items [index];
while (cur_item) {
item_t *next_item = cur_item->next;
- s_item_destroy (self, cur_item, TRUE);
+ s_item_destroy (self, cur_item, true);
cur_item = next_item;
}
}
@@ -287,7 +287,7 @@ zhash_delete (zhash_t *self, const char *key)
item_t *item = s_item_lookup (self, key);
if (item)
- s_item_destroy (self, item, TRUE);
+ s_item_destroy (self, item, true);
}
@@ -317,7 +317,7 @@ zhash_rename (zhash_t *self, const char *old_key, const char *new_key)
{
item_t *item = s_item_lookup (self, old_key);
if (item) {
- s_item_destroy (self, item, FALSE);
+ s_item_destroy (self, item, false);
item_t *new_item = s_item_lookup (self, new_key);
if (new_item == NULL) {
free (item->key);
@@ -617,12 +617,12 @@ zhash_test (int verbose)
item = zhash_lookup (hash, testset [testnbr].name);
assert (item);
zhash_delete (hash, testset [testnbr].name);
- testset [testnbr].exists = FALSE;
+ testset [testnbr].exists = false;
}
else {
sprintf (testset [testnbr].name, "%x-%x", rand (), rand ());
if (zhash_insert (hash, testset [testnbr].name, "") == 0)
- testset [testnbr].exists = TRUE;
+ testset [testnbr].exists = true;
}
}
// Test 10K lookups
View
6 src/zloop.c
@@ -127,7 +127,7 @@ s_rebuild_pollset (zloop_t *self)
item_nbr++;
poller = (s_poller_t *) zlist_next (self->pollers);
}
- self->dirty = FALSE;
+ self->dirty = false;
return 0;
}
@@ -234,7 +234,7 @@ zloop_poller (zloop_t *self, zmq_pollitem_t *item, zloop_fn handler, void *arg)
if (zlist_push (self->pollers, poller))
return -1;
- self->dirty = TRUE;
+ self->dirty = true;
if (self->verbose)
zclock_log ("I: zloop: register %s poller (%p, %d)",
item->socket? zsocket_type_str (item->socket): "FD",
@@ -263,7 +263,7 @@ zloop_poller_end (zloop_t *self, zmq_pollitem_t *item)
|| (item->fd && item->fd == poller->item.fd)) {
zlist_remove (self->pollers, poller);
free (poller);
- self->dirty = TRUE;
+ self->dirty = true;
}
poller = (s_poller_t *) zlist_next (self->pollers);
}
View
2 src/zmsg.c
@@ -457,7 +457,7 @@ zmsg_load (zmsg_t *self, FILE *file)
if (!self)
return NULL;
- while (TRUE) {
+ while (true) {
size_t frame_size;
size_t rc = fread (&frame_size, sizeof (frame_size), 1, file);
if (rc == 1) {
View
6 src/zsocket.c
@@ -139,8 +139,8 @@ zsocket_disconnect (void *self, const char *format, ...)
}
// --------------------------------------------------------------------------
-// Poll for input events on the socket. Returns TRUE if there is input
-// ready on the socket, else FALSE.
+// Poll for input events on the socket. Returns true if there is input
+// ready on the socket, else false.
bool
zsocket_poll (void *self, int msecs)
@@ -206,7 +206,7 @@ zsocket_test (bool verbose)
int port = zsocket_bind (writer, "tcp://%s:*", interf);
assert (port >= ZSOCKET_DYNFROM && port <= ZSOCKET_DYNTO);
- assert (zsocket_poll (writer, 100) == FALSE);
+ assert (zsocket_poll (writer, 100) == false);
rc = zsocket_connect (reader, "txp://%s:%d", domain, service);
assert (rc == -1);
View
4 src/zstr.c
@@ -152,7 +152,7 @@ zstr_sendf (void *zocket, const char *format, ...)
va_list argptr;
va_start (argptr, format);
- int rc = s_zstr_sendf_impl (zocket, FALSE, format, argptr);
+ int rc = s_zstr_sendf_impl (zocket, false, format, argptr);
va_end (argptr);
return rc;
@@ -168,7 +168,7 @@ zstr_sendfm (void *zocket, const char *format, ...)
va_list argptr;
va_start (argptr, format);
- int rc = s_zstr_sendf_impl (zocket, TRUE, format, argptr);
+ int rc = s_zstr_sendf_impl (zocket, true, format, argptr);
va_end (argptr);
return rc;

0 comments on commit 8f8528a

Please sign in to comment.
Something went wrong with that request. Please try again.