diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-10-16 19:02:02 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-11-20 16:50:48 +0100 |
commit | 9776cb03450d21da5d454e683bdba29793ba3f67 (patch) | |
tree | 227a21afaf0dd8622b034be005331f1a95f61a76 /lib/tdb/tools | |
parent | 94c33bdd72e22a9bb9e51b6acc15ae23087628e4 (diff) | |
download | samba-9776cb03450d21da5d454e683bdba29793ba3f67.tar.gz samba-9776cb03450d21da5d454e683bdba29793ba3f67.tar.bz2 samba-9776cb03450d21da5d454e683bdba29793ba3f67.zip |
tdb tools: Mostly cosmetic adaptions
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/tdb/tools')
-rw-r--r-- | lib/tdb/tools/tdbdump.c | 4 | ||||
-rw-r--r-- | lib/tdb/tools/tdbtool.c | 13 |
2 files changed, 9 insertions, 8 deletions
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); |