summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-07-31 03:53:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:26 -0500
commit02eea79624c85fb5ce6c3ffefe2d27e40c5ff97f (patch)
treea3fb9be7bfad975ba13651718a011bbad36597ca /source3/registry
parente23781b3b304d1e69ad80af5ae9c0ed8d02cf996 (diff)
downloadsamba-02eea79624c85fb5ce6c3ffefe2d27e40c5ff97f.tar.gz
samba-02eea79624c85fb5ce6c3ffefe2d27e40c5ff97f.tar.bz2
samba-02eea79624c85fb5ce6c3ffefe2d27e40c5ff97f.zip
r17333: Some C++ warnings
(This used to be commit be9aaffdaccae06c8c035eaf31862e34b7cfbe38)
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_cachehook.c4
-rw-r--r--source3/registry/reg_db.c4
-rw-r--r--source3/registry/reg_objects.c9
-rw-r--r--source3/registry/reg_perfcount.c8
-rw-r--r--source3/registry/reg_printing.c4
-rw-r--r--source3/registry/regfio.c4
6 files changed, 19 insertions, 14 deletions
diff --git a/source3/registry/reg_cachehook.c b/source3/registry/reg_cachehook.c
index 32885be8e2..ae8420776a 100644
--- a/source3/registry/reg_cachehook.c
+++ b/source3/registry/reg_cachehook.c
@@ -79,7 +79,7 @@ REGISTRY_HOOK* reghook_cache_find( const char *keyname )
/* prepend the string with a '\' character */
len = strlen( keyname );
- if ( !(key = SMB_MALLOC( len + 2 )) ) {
+ if ( !(key = (char *)SMB_MALLOC( len + 2 )) ) {
DEBUG(0,("reghook_cache_find: malloc failed for string [%s] !?!?!\n",
keyname));
return NULL;
@@ -94,7 +94,7 @@ REGISTRY_HOOK* reghook_cache_find( const char *keyname )
DEBUG(10,("reghook_cache_find: Searching for keyname [%s]\n", key));
- hook = pathtree_find( cache_tree, key ) ;
+ hook = (REGISTRY_HOOK *)pathtree_find( cache_tree, key ) ;
SAFE_FREE( key );
diff --git a/source3/registry/reg_db.c b/source3/registry/reg_db.c
index d73b27521d..b05e4957b8 100644
--- a/source3/registry/reg_db.c
+++ b/source3/registry/reg_db.c
@@ -313,7 +313,7 @@ static BOOL regdb_store_keys_internal( const char *key, REGSUBKEY_CTR *ctr )
/* allocate some initial memory */
- if (!(buffer = SMB_MALLOC(sizeof(pstring)))) {
+ if (!(buffer = (char *)SMB_MALLOC(sizeof(pstring)))) {
return False;
}
buflen = sizeof(pstring);
@@ -329,7 +329,7 @@ static BOOL regdb_store_keys_internal( const char *key, REGSUBKEY_CTR *ctr )
len += tdb_pack( buffer+len, buflen-len, "f", regsubkey_ctr_specific_key(ctr, i) );
if ( len > buflen ) {
/* allocate some extra space */
- if ((buffer = SMB_REALLOC( buffer, len*2 )) == NULL) {
+ if ((buffer = (char *)SMB_REALLOC( buffer, len*2 )) == NULL) {
DEBUG(0,("regdb_store_keys: Failed to realloc memory of size [%d]\n", len*2));
ret = False;
goto done;
diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c
index 33c2660331..2a898f0170 100644
--- a/source3/registry/reg_objects.c
+++ b/source3/registry/reg_objects.c
@@ -177,7 +177,8 @@ REGISTRY_VALUE* dup_registry_value( REGISTRY_VALUE *val )
if ( val->data_p && val->size )
{
- if ( !(copy->data_p = memdup( val->data_p, val->size )) ) {
+ if ( !(copy->data_p = (uint8 *)memdup( val->data_p,
+ val->size )) ) {
DEBUG(0,("dup_registry_value: memdup() failed for [%d] bytes!\n",
val->size));
SAFE_FREE( copy );
@@ -302,7 +303,8 @@ int regval_ctr_addvalue( REGVAL_CTR *ctr, const char *name, uint16 type,
fstrcpy( ctr->values[ctr->num_values]->valuename, name );
ctr->values[ctr->num_values]->type = type;
- ctr->values[ctr->num_values]->data_p = TALLOC_MEMDUP( ctr, data_p, size );
+ ctr->values[ctr->num_values]->data_p = (uint8 *)TALLOC_MEMDUP(
+ ctr, data_p, size );
ctr->values[ctr->num_values]->size = size;
ctr->num_values++;
@@ -341,7 +343,8 @@ int regval_ctr_copyvalue( REGVAL_CTR *ctr, REGISTRY_VALUE *val )
fstrcpy( ctr->values[ctr->num_values]->valuename, val->valuename );
ctr->values[ctr->num_values]->type = val->type;
- ctr->values[ctr->num_values]->data_p = TALLOC_MEMDUP( ctr, val->data_p, val->size );
+ ctr->values[ctr->num_values]->data_p = (uint8 *)TALLOC_MEMDUP(
+ ctr, val->data_p, val->size );
ctr->values[ctr->num_values]->size = val->size;
ctr->num_values++;
}
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index a0edf4513f..febae62ad0 100644
--- a/source3/registry/reg_perfcount.c
+++ b/source3/registry/reg_perfcount.c
@@ -177,7 +177,7 @@ static uint32 _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb,
}
/* First encode the name_index */
working_size = (kbuf.dsize + 1)*sizeof(uint16);
- buf1 = SMB_REALLOC(buf1, buffer_size + working_size);
+ buf1 = (char *)SMB_REALLOC(buf1, buffer_size + working_size);
if(!buf1) {
buffer_size = 0;
return buffer_size;
@@ -187,7 +187,7 @@ static uint32 _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb,
buffer_size += working_size;
/* Now encode the actual name */
working_size = (dbuf.dsize + 1)*sizeof(uint16);
- buf1 = SMB_REALLOC(buf1, buffer_size + working_size);
+ buf1 = (char *)SMB_REALLOC(buf1, buffer_size + working_size);
if(!buf1) {
buffer_size = 0;
return buffer_size;
@@ -234,7 +234,7 @@ uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf)
/* Now terminate the MULTI_SZ with a double unicode NULL */
buf1 = *retbuf;
- buf1 = SMB_REALLOC(buf1, buffer_size + 2);
+ buf1 = (char *)SMB_REALLOC(buf1, buffer_size + 2);
if(!buf1) {
buffer_size = 0;
} else {
@@ -279,7 +279,7 @@ uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf)
/* Now terminate the MULTI_SZ with a double unicode NULL */
buf1 = *retbuf;
- buf1 = SMB_REALLOC(buf1, buffer_size + 2);
+ buf1 = (char *)SMB_REALLOC(buf1, buffer_size + 2);
if(!buf1) {
buffer_size = 0;
} else {
diff --git a/source3/registry/reg_printing.c b/source3/registry/reg_printing.c
index 338bc7af6a..d8c25d802d 100644
--- a/source3/registry/reg_printing.c
+++ b/source3/registry/reg_printing.c
@@ -922,7 +922,7 @@ static void fill_in_driver_values( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info3, REGVAL
length = strlen(filename);
- buffer = SMB_REALLOC( buffer, buffer_size + (length + 1)*sizeof(uint16) );
+ buffer = (char *)SMB_REALLOC( buffer, buffer_size + (length + 1)*sizeof(uint16) );
if ( !buffer ) {
break;
}
@@ -935,7 +935,7 @@ static void fill_in_driver_values( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info3, REGVAL
/* terminated by double NULL. Add the final one here */
- buffer = SMB_REALLOC( buffer, buffer_size + 2 );
+ buffer = (char *)SMB_REALLOC( buffer, buffer_size + 2 );
if ( !buffer ) {
buffer_size = 0;
} else {
diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c
index f164d4e19d..768255a9fa 100644
--- a/source3/registry/regfio.c
+++ b/source3/registry/regfio.c
@@ -1646,7 +1646,9 @@ static BOOL create_vk_record( REGF_FILE *file, REGF_VK_REC *vk, REGISTRY_VALUE *
if ( vk->data_size > sizeof(uint32) ) {
uint32 data_size = ( (vk->data_size+sizeof(uint32)) & 0xfffffff8 ) + 8;
- vk->data = TALLOC_MEMDUP( file->mem_ctx, regval_data_p(value), vk->data_size );
+ vk->data = (uint8 *)TALLOC_MEMDUP( file->mem_ctx,
+ regval_data_p(value),
+ vk->data_size );
if (vk->data == NULL) {
return False;
}