From bc2b6436d0f5f3e9ffdfaeb7f1b32996a83d5478 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 29 Mar 2007 09:35:51 +0000 Subject: r22009: change TDB_DATA from char * to unsigned char * and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f) --- source3/smbd/connection.c | 6 +++--- source3/smbd/mangle_hash.c | 2 +- source3/smbd/notify_internal.c | 2 +- source3/smbd/session.c | 2 +- source3/smbd/statcache.c | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c index 7838c5c23d..7e53a29b04 100644 --- a/source3/smbd/connection.c +++ b/source3/smbd/connection.c @@ -50,7 +50,7 @@ static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *p } #endif - pkbuf->dptr = (char *)pkey; + pkbuf->dptr = (uint8 *)pkey; pkbuf->dsize = sizeof(*pkey); } @@ -200,7 +200,7 @@ BOOL claim_connection(connection_struct *conn, const char *name,int max_connecti safe_strcpy(crec.machine,get_remote_machine_name(),sizeof(crec.machine)-1); safe_strcpy(crec.addr,conn?conn->client_address:client_addr(),sizeof(crec.addr)-1); - dbuf.dptr = (char *)&crec; + dbuf.dptr = (uint8 *)&crec; dbuf.dsize = sizeof(crec); if (tdb_store(tdb, kbuf, dbuf, TDB_REPLACE) != 0) { @@ -313,7 +313,7 @@ BOOL store_pipe_opendb( smb_np_struct *p ) goto done; } - data.dptr = (char*)prec; + data.dptr = (uint8 *)prec; data.dsize = sizeof(struct pipe_open_rec); if ( (pipe_tdb = conn_tdb_ctx() ) == NULL ) { diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c index f20e473079..3cc7d1e5c2 100644 --- a/source3/smbd/mangle_hash.c +++ b/source3/smbd/mangle_hash.c @@ -502,7 +502,7 @@ static BOOL check_cache( char *s, size_t maxlen, const struct share_params *p ) } /* If we *did* find it, we need to copy it into the string buffer. */ - (void)safe_strcpy( s, data_val.dptr, maxlen ); + (void)safe_strcpy( s, (const char *)data_val.dptr, maxlen ); if( saved_ext ) { /* Replace the saved_ext as it was truncated. */ (void)safe_strcat( s, saved_ext, maxlen ); diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c index 72b9604935..e1f47540e5 100644 --- a/source3/smbd/notify_internal.c +++ b/source3/smbd/notify_internal.c @@ -231,7 +231,7 @@ static NTSTATUS notify_save(struct notify_context *notify) NDR_PRINT_DEBUG(notify_array, notify->array); } - dbuf.dptr = (char *)blob.data; + dbuf.dptr = blob.data; dbuf.dsize = blob.length; ret = tdb_store_bystring(notify->w->tdb, NOTIFY_KEY, dbuf, TDB_REPLACE); diff --git a/source3/smbd/session.c b/source3/smbd/session.c index da2ab40338..a3334a353e 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -140,7 +140,7 @@ BOOL session_claim(user_struct *vuser) return False; } - data.dptr = (char *)&sessionid; + data.dptr = (uint8 *)&sessionid; data.dsize = sizeof(sessionid); if (tdb_store_bystring(tdb, keystr, data, tdb_store_flag) != 0) { DEBUG(1,("session_claim: unable to create session id record\n")); diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c index 1a2b7a8237..e257483f81 100644 --- a/source3/smbd/statcache.c +++ b/source3/smbd/statcache.c @@ -131,7 +131,7 @@ void stat_cache_add( const char *full_orig_name, const char *orig_translated_pat */ data_val.dsize = translated_path_length + 1; - data_val.dptr = translated_path; + data_val.dptr = (uint8 *)translated_path; if (tdb_store_bystring(tdb_stat_cache, original_path, data_val, TDB_REPLACE) != 0) { DEBUG(0,("stat_cache_add: Error storing entry %s -> %s\n", original_path, translated_path)); @@ -242,7 +242,7 @@ BOOL stat_cache_lookup(connection_struct *conn, pstring name, pstring dirpath, } } else { BOOL retval; - char *translated_path = data_val.dptr; + char *translated_path = (char *)data_val.dptr; size_t translated_path_length = data_val.dsize - 1; DEBUG(10,("stat_cache_lookup: lookup succeeded for name [%s] -> [%s]\n", chk_name, translated_path )); @@ -329,7 +329,7 @@ unsigned int fast_string_hash(TDB_DATA *key) { unsigned int n = 0; const char *p; - for (p = key->dptr; *p != '\0'; p++) { + for (p = (const char *)key->dptr; *p != '\0'; p++) { n = ((n << 5) + n) ^ (unsigned int)(*p); } return n; -- cgit