bloom: use bool
authorJens Axboe <axboe@fb.com>
Fri, 23 Sep 2016 17:33:02 +0000 (11:33 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 23 Sep 2016 17:33:02 +0000 (11:33 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
lib/bloom.c
lib/bloom.h

index f4eff575082b171827b8319d16b9c938f7a6a979..8594c9775f51338240e579fe5a48d2050b3aa26a 100644 (file)
@@ -88,8 +88,8 @@ void bloom_free(struct bloom *b)
        free(b);
 }
 
-static int __bloom_check(struct bloom *b, uint32_t *data, unsigned int nwords,
-                        int set)
+static bool __bloom_check(struct bloom *b, uint32_t *data, unsigned int nwords,
+                         bool set)
 {
        uint32_t hash[N_HASHES];
        int i, was_set;
@@ -113,7 +113,7 @@ static int __bloom_check(struct bloom *b, uint32_t *data, unsigned int nwords,
        return was_set == N_HASHES;
 }
 
-int bloom_set(struct bloom *b, uint32_t *data, unsigned int nwords)
+bool bloom_set(struct bloom *b, uint32_t *data, unsigned int nwords)
 {
-       return __bloom_check(b, data, nwords, 1);
+       return __bloom_check(b, data, nwords, true);
 }
index 127ed9b77fb2100e692291f2dc0a155a23687617..329fd36ab77b21f4a75e0af31e92ea85294b0992 100644 (file)
@@ -2,11 +2,12 @@
 #define FIO_BLOOM_H
 
 #include <inttypes.h>
+#include "../lib/types.h"
 
 struct bloom;
 
 struct bloom *bloom_new(uint64_t entries);
 void bloom_free(struct bloom *b);
-int bloom_set(struct bloom *b, uint32_t *data, unsigned int nwords);
+bool bloom_set(struct bloom *b, uint32_t *data, unsigned int nwords);
 
 #endif