summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-12-11 08:24:36 +0000
committerJeremy Allison <jra@samba.org>2001-12-11 08:24:36 +0000
commitdd324a535762696f6bbf09bf6a344ea87c379b0a (patch)
tree17dc41c62c192174f7789d2026b3d2ce8718b32a
parentb6f3d7108d655b7e3686fa25c33e8ff448242dd2 (diff)
downloadsamba-dd324a535762696f6bbf09bf6a344ea87c379b0a.tar.gz
samba-dd324a535762696f6bbf09bf6a344ea87c379b0a.tar.bz2
samba-dd324a535762696f6bbf09bf6a344ea87c379b0a.zip
Tidyups to remove warnings on tdb standalone code.
Jeremy. (This used to be commit b03aaddcf35dee93556013eaac9d99bc0f22256a)
-rw-r--r--source3/tdb/spinlock.c2
-rw-r--r--source3/tdb/tdbtest.c11
-rw-r--r--source3/tdb/tdbtool.c32
3 files changed, 23 insertions, 22 deletions
diff --git a/source3/tdb/spinlock.c b/source3/tdb/spinlock.c
index 0a68981ca2..0b2994f8f5 100644
--- a/source3/tdb/spinlock.c
+++ b/source3/tdb/spinlock.c
@@ -18,11 +18,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#if STANDALONE
#if HAVE_CONFIG_H
#include <config.h>
#endif
+#if STANDALONE
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/source3/tdb/tdbtest.c b/source3/tdb/tdbtest.c
index cfc6135a0a..0741073ce1 100644
--- a/source3/tdb/tdbtest.c
+++ b/source3/tdb/tdbtest.c
@@ -23,12 +23,12 @@ static GDBM_FILE gdbm;
struct timeval tp1,tp2;
-static void start_timer()
+static void start_timer(void)
{
gettimeofday(&tp1,NULL);
}
-static double end_timer()
+static double end_timer(void)
{
gettimeofday(&tp2,NULL);
return((tp2.tv_sec - tp1.tv_sec) +
@@ -178,18 +178,17 @@ static void addrec_gdbm(void)
free(d);
}
-static int traverse_fn(TDB_CONTEXT *db, TDB_DATA key, TDB_DATA dbuf, void *state)
+static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
{
#if 0
printf("[%s] [%s]\n", key.dptr, dbuf.dptr);
#endif
- tdb_delete(db, key);
+ tdb_delete(tdb, key);
return 0;
}
-static void merge_test()
+static void merge_test(void)
{
- int klen, dlen;
int i;
char keys[5][2];
TDB_DATA key, data;
diff --git a/source3/tdb/tdbtool.c b/source3/tdb/tdbtool.c
index c25e9ac248..d1c199849b 100644
--- a/source3/tdb/tdbtool.c
+++ b/source3/tdb/tdbtool.c
@@ -61,7 +61,7 @@ typedef struct connections_data {
static TDB_CONTEXT *tdb;
-static int print_rec(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state);
+static int print_rec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state);
static void print_asc(unsigned char *buf,int len)
{
@@ -137,7 +137,7 @@ static void terror(char *why)
static char *get_token(int startover)
{
- static char tmp[1024];
+ static char tmp[1024];
static char *cont = NULL;
char *insert, *start;
char *k = strtok(NULL, " ");
@@ -280,6 +280,7 @@ static void delete_tdb(void)
}
}
+#if 0
static int print_conn_key(TDB_DATA key)
{
printf( "pid =%5d ", ((connections_key*)key.dptr)->pid);
@@ -301,8 +302,9 @@ static int print_conn_data(TDB_DATA dbuf)
printf( "start = %s\n", ctime(&((connections_data*)dbuf.dptr)->start));
return 0;
}
+#endif
-static int print_rec(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
+static int print_rec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
{
#if 0
print_conn_key(key);
@@ -317,7 +319,7 @@ static int print_rec(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
#endif
}
-static int print_key(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
+static int print_key(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
{
print_asc(key.dptr, key.dsize);
printf("\n");
@@ -326,7 +328,7 @@ static int print_key(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
static int total_bytes;
-static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
+static int traverse_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
{
total_bytes += dbuf.dsize;
return 0;
@@ -354,34 +356,34 @@ static char *tdb_getline(char *prompt)
return p?line:NULL;
}
-static int do_delete_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf,
+static int do_delete_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf,
void *state)
{
- return tdb_delete(tdb, key);
+ return tdb_delete(the_tdb, key);
}
-static void first_record(TDB_CONTEXT *tdb, TDB_DATA *pkey)
+static void first_record(TDB_CONTEXT *the_tdb, TDB_DATA *pkey)
{
TDB_DATA dbuf;
- *pkey = tdb_firstkey(tdb);
+ *pkey = tdb_firstkey(the_tdb);
- dbuf = tdb_fetch(tdb, *pkey);
+ dbuf = tdb_fetch(the_tdb, *pkey);
if (!dbuf.dptr) terror("fetch failed");
/* printf("%s : %*.*s\n", k, (int)dbuf.dsize, (int)dbuf.dsize, dbuf.dptr); */
- print_rec(tdb, *pkey, dbuf, NULL);
+ print_rec(the_tdb, *pkey, dbuf, NULL);
}
-static void next_record(TDB_CONTEXT *tdb, TDB_DATA *pkey)
+static void next_record(TDB_CONTEXT *the_tdb, TDB_DATA *pkey)
{
TDB_DATA dbuf;
- *pkey = tdb_nextkey(tdb, *pkey);
+ *pkey = tdb_nextkey(the_tdb, *pkey);
- dbuf = tdb_fetch(tdb, *pkey);
+ dbuf = tdb_fetch(the_tdb, *pkey);
if (!dbuf.dptr)
terror("fetch failed");
else
/* printf("%s : %*.*s\n", k, (int)dbuf.dsize, (int)dbuf.dsize, dbuf.dptr); */
- print_rec(tdb, *pkey, dbuf, NULL);
+ print_rec(the_tdb, *pkey, dbuf, NULL);
}
int main(int argc, char *argv[])