lib/tdb: fix compiler warnings
authorChristian Ambach <ambi@samba.org>
Tue, 10 Dec 2013 16:47:05 +0000 (17:47 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 12 Dec 2013 22:21:27 +0000 (14:21 -0800)
about a variable shadowing a global declaration

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/tdb/common/summary.c
lib/tdb/test/run-3G-file.c

index 3c6f755727fde807057aa9a2c3f5697b423750be..a22c17d50d82a4667334d3783cdc12c924f3959c 100644 (file)
@@ -88,7 +88,7 @@ static size_t get_hash_length(struct tdb_context *tdb, unsigned int i)
 _PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
 {
        tdb_off_t off, rec_off;
-       struct tally freet, keys, data, dead, extra, hash, uncoal;
+       struct tally freet, keys, data, dead, extra, hashval, uncoal;
        struct tdb_record rec;
        char *ret = NULL;
        bool locked;
@@ -114,7 +114,7 @@ _PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
        tally_init(&data);
        tally_init(&dead);
        tally_init(&extra);
-       tally_init(&hash);
+       tally_init(&hashval);
        tally_init(&uncoal);
 
        for (off = TDB_DATA_START(tdb->hash_size);
@@ -161,7 +161,7 @@ _PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
                tally_add(&uncoal, unc - 1);
 
        for (off = 0; off < tdb->hash_size; off++)
-               tally_add(&hash, get_hash_length(tdb, off));
+               tally_add(&hashval, get_hash_length(tdb, off));
 
        /* 20 is max length of a %zu. */
        len = strlen(SUMMARY_FORMAT) + 35*20 + 1;
@@ -180,8 +180,8 @@ _PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
                 dead.min, tally_mean(&dead), dead.max,
                 freet.num,
                 freet.min, tally_mean(&freet), freet.max,
-                hash.num,
-                hash.min, tally_mean(&hash), hash.max,
+                hashval.num,
+                hashval.min, tally_mean(&hashval), hashval.max,
                 uncoal.total,
                 uncoal.min, tally_mean(&uncoal), uncoal.max,
                 keys.total * 100.0 / tdb->map_size,
index 3ee9de15ed74b690b1504e98e283e464b7507ca6..f21544a6af538062ca83e86845228fe2fbc9366d 100644 (file)
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
 {
        struct tdb_context *tdb;
        TDB_DATA key, orig_data, data;
-       uint32_t hash;
+       uint32_t hashval;
        tdb_off_t rec_ptr;
        struct tdb_record rec;
        int ret;
@@ -113,8 +113,8 @@ int main(int argc, char *argv[])
        free(data.dptr);
 
        /* That currently fills at the end, make sure that's true. */
-       hash = tdb->hash_fn(&key);
-       rec_ptr = tdb_find_lock_hash(tdb, key, hash, F_RDLCK, &rec);
+       hashval = tdb->hash_fn(&key);
+       rec_ptr = tdb_find_lock_hash(tdb, key, hashval, F_RDLCK, &rec);
        ok1(rec_ptr);
        ok1(rec_ptr > 2U*1024*1024*1024);
        tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK);