mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
lib/tdb: fix compiler warnings
about a variable shadowing a global declaration Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
35b4ba0193
commit
6d88bfcab4
@ -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,
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user