X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Fio.c;h=240a1c038da368c274363cb3cfcd37945a517a0e;hp=0e27e1d0faea07a2d8640e46db187a0298afcfb8;hb=dc9da1e34fe6a9d113fd57e116ebbc6d5bd54819;hpb=8d8de08d9079f503256e1682dfa93bb22dcd4ad0 diff --git a/ccan/tdb2/io.c b/ccan/tdb2/io.c index 0e27e1d0..240a1c03 100644 --- a/ccan/tdb2/io.c +++ b/ccan/tdb2/io.c @@ -342,7 +342,7 @@ enum TDB_ERROR tdb_write_off(struct tdb_context *tdb, static void *_tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t len, unsigned int prefix) { - void *buf; + unsigned char *buf; enum TDB_ERROR ecode; /* some systems don't like zero length malloc */ @@ -439,7 +439,7 @@ static enum TDB_ERROR tdb_expand_file(struct tdb_context *tdb, const void *tdb_access_read(struct tdb_context *tdb, tdb_off_t off, tdb_len_t len, bool convert) { - const void *ret = NULL; + void *ret = NULL; if (likely(!(tdb->flags & TDB_CONVERT))) { ret = tdb->methods->direct(tdb, off, len, false); @@ -592,12 +592,6 @@ void tdb_inc_seqnum(struct tdb_context *tdb) } } -void add_stat_(struct tdb_context *tdb, uint64_t *s, size_t val) -{ - if ((uintptr_t)s < (uintptr_t)tdb->stats + tdb->stats->size) - *s += val; -} - static const struct tdb_methods io_methods = { tdb_read, tdb_write,