diff options
-rw-r--r-- | assoc.c | 4 | ||||
-rw-r--r-- | memcached.c | 10 | ||||
-rw-r--r-- | memcached.h | 2 | ||||
-rw-r--r-- | thread.c | 4 |
4 files changed, 10 insertions, 10 deletions
@@ -441,9 +441,9 @@ uint32_t hash( const void *key, size_t length, const uint32_t initval) final(a,b,c); return c; } -#else // HASH_XXX_ENDIAN == 1 +#else /* HASH_XXX_ENDIAN == 1 */ #error Must define HASH_BIG_ENDIAN or HASH_LITTLE_ENDIAN -#endif // hash_XXX_ENDIAN == 1 +#endif /* HASH_XXX_ENDIAN == 1 */ typedef unsigned long int ub4; /* unsigned 4-byte quantities */ typedef unsigned char ub1; /* unsigned 1-byte quantities */ diff --git a/memcached.c b/memcached.c index 68a1b80..ea474a6 100644 --- a/memcached.c +++ b/memcached.c @@ -103,7 +103,7 @@ struct stats stats; struct settings settings; /** file scope variables **/ -static item **todelete = 0; +static item **todelete = NULL; static int delcurr; static int deltotal; static conn *listen_conn; @@ -272,10 +272,10 @@ conn *do_conn_from_freelist() { * Adds a connection to the freelist. 0 = success. Should call this using * conn_add_to_freelist() for thread safety. */ -int do_conn_add_to_freelist(conn *c) { +bool do_conn_add_to_freelist(conn *c) { if (freecurr < freetotal) { freeconns[freecurr++] = c; - return 0; + return false; } else { /* try to enlarge free connections array */ conn **new_freeconns = realloc(freeconns, sizeof(conn *) * freetotal * 2); @@ -283,10 +283,10 @@ int do_conn_add_to_freelist(conn *c) { freetotal *= 2; freeconns = new_freeconns; freeconns[freecurr++] = c; - return 0; + return false; } } - return 1; + return true; } conn *conn_new(const int sfd, const int init_state, const int event_flags, diff --git a/memcached.h b/memcached.h index ce6a14f..78408e4 100644 --- a/memcached.h +++ b/memcached.h @@ -216,7 +216,7 @@ extern volatile rel_time_t current_time; */ conn *do_conn_from_freelist(); -int do_conn_add_to_freelist(conn *c); +bool do_conn_add_to_freelist(conn *c); char *do_defer_delete(item *item, time_t exptime); void do_run_deferred_deletes(void); char *do_add_delta(item *item, int incr, const unsigned int delta, char *buf); @@ -235,8 +235,8 @@ conn *mt_conn_from_freelist() { * * Returns 0 on success, 1 if the structure couldn't be added. */ -int mt_conn_add_to_freelist(conn *c) { - int result; +bool mt_conn_add_to_freelist(conn *c) { + bool result; pthread_mutex_lock(&conn_lock); result = do_conn_add_to_freelist(c); |