FAQ

[memcached] plindner, r503: use bools for booleans

Commits
Apr 13, 2007 at 8:18 pm
use bools for booleans

U trunk/server/slabs.c


Modified: trunk/server/slabs.c
===================================================================
--- trunk/server/slabs.c 2007-04-12 22:17:24 UTC (rev 502)
+++ trunk/server/slabs.c 2007-04-13 20:18:33 UTC (rev 503)
@@ -25,6 +25,7 @@
#include <errno.h>
#include <event.h>
#include <assert.h>
+#include <stdbool.h>

#include "memcached.h"

@@ -85,7 +86,7 @@
unsigned int slabs_clsid(const size_t size) {
int res = POWER_SMALLEST;

- if(size == 0)
+ if (size == 0)
return 0;
while (size > slabclass[res].size)
if (res++ == power_largest) /* won't fit in the biggest slab */
@@ -321,7 +322,7 @@
void *slab, *slab_end;
slabclass_t *p, *dp;
void *iter;
- int was_busy = 0;
+ bool was_busy = false;

if (srcid < POWER_SMALLEST || srcid > power_largest ||
dstid < POWER_SMALLEST || dstid > power_largest)
@@ -346,7 +347,7 @@
for (iter = slab; iter < slab_end; iter += p->size) {
item *it = (item *)iter;
if (it->slabs_clsid) {
- if (it->refcount) was_busy = 1;
+ if (it->refcount) was_busy = true;
item_unlink(it);
}
}
reply

Search Discussions

Discussion Navigation
viewthread | post

1 user in discussion

Commits: 1 post