1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Fix up warnings. Make tdb_openXX() names const.

Jeremy.
(This used to be commit 9e3581827d)
This commit is contained in:
Jeremy Allison 2001-12-11 08:31:58 +00:00
parent dd324a5357
commit 9bb0a964bf
3 changed files with 8 additions and 8 deletions

View File

@ -1397,14 +1397,14 @@ static int tdb_already_open(dev_t device,
try to call tdb_error or tdb_errname, just do strerror(errno).
@param name may be NULL for internal databases. */
TDB_CONTEXT *tdb_open(char *name, int hash_size, int tdb_flags,
TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
int open_flags, mode_t mode)
{
return tdb_open_ex(name, hash_size, tdb_flags, open_flags, mode, NULL);
}
TDB_CONTEXT *tdb_open_ex(char *name, int hash_size, int tdb_flags,
TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
int open_flags, mode_t mode,
tdb_log_func log_fn)
{

View File

@ -101,9 +101,9 @@ typedef struct tdb_context {
typedef int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *);
typedef void (*tdb_log_func)(TDB_CONTEXT *, int , const char *, ...);
TDB_CONTEXT *tdb_open(char *name, int hash_size, int tdb_flags,
TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
int open_flags, mode_t mode);
TDB_CONTEXT *tdb_open_ex(char *name, int hash_size, int tdb_flags,
TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
int open_flags, mode_t mode,
tdb_log_func log_fn);

View File

@ -67,11 +67,11 @@ static char *randbuf(int len)
return buf;
}
static int cull_traverse(TDB_CONTEXT *db, TDB_DATA key, TDB_DATA dbuf,
static int cull_traverse(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf,
void *state)
{
if (random() % CULL_PROB == 0) {
tdb_delete(db, key);
tdb_delete(tdb, key);
}
return 0;
}
@ -151,10 +151,10 @@ next:
free(s);
}
static int traverse_fn(TDB_CONTEXT *db, TDB_DATA key, TDB_DATA dbuf,
static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf,
void *state)
{
tdb_delete(db, key);
tdb_delete(tdb, key);
return 0;
}