From 2d7c85a971b2766e5ad6ce3664506deba87b53e1 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 08:13:28 +0930 Subject: tdb2: fix prototypes which return enum TDB_ERROR. Since enums and ints are compatible in C, the compiler didn't warn that our prototypes for these functions disagreed with the definitions. Signed-off-by: Rusty Russell (Imported from CCAN commit 6d3832ee613adeb9ae7ed6454996ffa39c32650f) --- lib/tdb2/check.c | 2 +- lib/tdb2/private.h | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/tdb2') diff --git a/lib/tdb2/check.c b/lib/tdb2/check.c index 8a89422b48..3003b62616 100644 --- a/lib/tdb2/check.c +++ b/lib/tdb2/check.c @@ -436,7 +436,7 @@ fail: static enum TDB_ERROR check_hash(struct tdb_context *tdb, tdb_off_t used[], size_t num_used, size_t num_ftables, - int (*check)(TDB_DATA, TDB_DATA, void *), + enum TDB_ERROR (*check)(TDB_DATA, TDB_DATA, void *), void *data) { /* Free tables also show up as used. */ diff --git a/lib/tdb2/private.h b/lib/tdb2/private.h index 161f156a4f..93ceb5f4ec 100644 --- a/lib/tdb2/private.h +++ b/lib/tdb2/private.h @@ -356,13 +356,13 @@ struct tdb_methods { uint64_t tdb_jenkins_hash(const void *key, size_t length, uint64_t seed, void *unused); -tdb_bool_err first_in_hash(struct tdb_context *tdb, - struct traverse_info *tinfo, - TDB_DATA *kbuf, size_t *dlen); +enum TDB_ERROR first_in_hash(struct tdb_context *tdb, + struct traverse_info *tinfo, + TDB_DATA *kbuf, size_t *dlen); -tdb_bool_err next_in_hash(struct tdb_context *tdb, - struct traverse_info *tinfo, - TDB_DATA *kbuf, size_t *dlen); +enum TDB_ERROR next_in_hash(struct tdb_context *tdb, + struct traverse_info *tinfo, + TDB_DATA *kbuf, size_t *dlen); /* Hash random memory. */ uint64_t tdb_hash(struct tdb_context *tdb, const void *ptr, size_t len); @@ -658,9 +658,9 @@ int tdb1_check(struct tdb_context *tdb, /* tdb1_open.c: */ -int tdb1_new_database(struct tdb_context *tdb, - struct tdb_attribute_tdb1_hashsize *hashsize, - struct tdb_attribute_tdb1_max_dead *max_dead); +enum TDB_ERROR tdb1_new_database(struct tdb_context *tdb, + struct tdb_attribute_tdb1_hashsize *hashsize, + struct tdb_attribute_tdb1_max_dead *max_dead); enum TDB_ERROR tdb1_open(struct tdb_context *tdb, struct tdb_attribute_tdb1_max_dead *max_dead); -- cgit