From 9776cb03450d21da5d454e683bdba29793ba3f67 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Fri, 16 Oct 2009 19:02:02 +0200 Subject: tdb tools: Mostly cosmetic adaptions Signed-off-by: Stefan Metzmacher --- lib/tdb/tools/tdbdump.c | 4 ++-- lib/tdb/tools/tdbtool.c | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/tdb') diff --git a/lib/tdb/tools/tdbdump.c b/lib/tdb/tools/tdbdump.c index 8d930383b0..027fda3d42 100644 --- a/lib/tdb/tools/tdbdump.c +++ b/lib/tdb/tools/tdbdump.c @@ -65,8 +65,8 @@ static int dump_tdb(const char *fname, const char *keyname) if (!keyname) { tdb_traverse(tdb, traverse_fn, NULL); } else { - key.dptr = discard_const_p(uint8_t,keyname); - key.dsize = strlen( keyname); + key.dptr = discard_const_p(uint8_t, keyname); + key.dsize = strlen(keyname); value = tdb_fetch(tdb, key); if (!value.dptr) { return 1; diff --git a/lib/tdb/tools/tdbtool.c b/lib/tdb/tools/tdbtool.c index d646515a04..b380883e0a 100644 --- a/lib/tdb/tools/tdbtool.c +++ b/lib/tdb/tools/tdbtool.c @@ -419,6 +419,7 @@ static void info_tdb(void) static void speed_tdb(const char *tlimit) { + const char *str = "store test", *str2 = "transaction test"; unsigned timelimit = tlimit?atoi(tlimit):0; double t; int ops; @@ -430,9 +431,9 @@ static void speed_tdb(const char *tlimit) do { long int r = random(); TDB_DATA key, dbuf; - key.dptr = (unsigned char *)"store test"; + key.dptr = discard_const_p(uint8_t, str); key.dsize = strlen((char *)key.dptr); - dbuf.dptr = (unsigned char *)&r; + dbuf.dptr = (uint8_t *) &r; dbuf.dsize = sizeof(r); tdb_store(tdb, key, dbuf, TDB_REPLACE); t = _end_timer(); @@ -446,9 +447,9 @@ static void speed_tdb(const char *tlimit) do { long int r = random(); TDB_DATA key, dbuf; - key.dptr = (unsigned char *)"store test"; + key.dptr = discard_const_p(uint8_t, str); key.dsize = strlen((char *)key.dptr); - dbuf.dptr = (unsigned char *)&r; + dbuf.dptr = (uint8_t *) &r; dbuf.dsize = sizeof(r); tdb_fetch(tdb, key); t = _end_timer(); @@ -462,9 +463,9 @@ static void speed_tdb(const char *tlimit) do { long int r = random(); TDB_DATA key, dbuf; - key.dptr = (unsigned char *)"transaction test"; + key.dptr = discard_const_p(uint8_t, str2); key.dsize = strlen((char *)key.dptr); - dbuf.dptr = (unsigned char *)&r; + dbuf.dptr = (uint8_t *) &r; dbuf.dsize = sizeof(r); tdb_transaction_start(tdb); tdb_store(tdb, key, dbuf, TDB_REPLACE); -- cgit