From c0d7598348446f4506219d7bb12b293d790aebd5 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 23 Sep 2016 11:33:02 -0600 Subject: [PATCH] bloom: use bool Signed-off-by: Jens Axboe --- lib/bloom.c | 8 ++++---- lib/bloom.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/bloom.c b/lib/bloom.c index f4eff575..8594c977 100644 --- a/lib/bloom.c +++ b/lib/bloom.c @@ -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); } diff --git a/lib/bloom.h b/lib/bloom.h index 127ed9b7..329fd36a 100644 --- a/lib/bloom.h +++ b/lib/bloom.h @@ -2,11 +2,12 @@ #define FIO_BLOOM_H #include +#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 -- 2.25.1