r17348: Some C++ warnings
authorVolker Lendecke <vlendec@samba.org>
Mon, 31 Jul 2006 21:40:25 +0000 (21:40 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:27 +0000 (11:38 -0500)
(This used to be commit ae6b9b34e59167e3958bfdb9997fa25340b9a0a3)

source3/rpc_server/srv_echo_nt.c
source3/rpc_server/srv_pipe.c
source3/rpc_server/srv_spoolss_nt.c
source3/smbd/msdfs.c
source3/smbd/ntquotas.c
source3/smbd/posix_acls.c
source3/smbd/sec_ctx.c
source3/smbd/vfs.c

index 86fcce28c71ddd12ea2e0eecc4cf14c7a8b4cca7..c861c74cc6af6a3381a6bf6adc08d6a8ba707c88 100644 (file)
@@ -44,7 +44,7 @@ void _echo_data(pipes_struct *p, ECHO_Q_ECHO_DATA *q_u,
 {
        DEBUG(10, ("_echo_data\n"));
 
-       r_u->data = TALLOC(p->mem_ctx, q_u->size);
+       r_u->data = (char *)TALLOC(p->mem_ctx, q_u->size);
        r_u->size = q_u->size;
        memcpy(r_u->data, q_u->data, q_u->size);
 }
@@ -68,7 +68,7 @@ void _source_data(pipes_struct *p, ECHO_Q_SOURCE_DATA *q_u,
 
        DEBUG(10, ("_source_data\n"));
 
-       r_u->data = TALLOC(p->mem_ctx, q_u->size);
+       r_u->data = (char *)TALLOC(p->mem_ctx, q_u->size);
        r_u->size = q_u->size;
 
        for (i = 0; i < r_u->size; i++)
index e2c5e865ed183cd34fb3df5c5ac51418fd8502bf..74583f075bda9d3da3903728f9fd28c94305aad5 100644 (file)
@@ -679,8 +679,9 @@ static BOOL pipe_ntlmssp_verify_final(pipes_struct *p, DATA_BLOB *p_resp_blob)
 
        p->pipe_user.ut.ngroups = a->server_info->n_groups;
        if (p->pipe_user.ut.ngroups) {
-               if (!(p->pipe_user.ut.groups = memdup(a->server_info->groups,
-                                               sizeof(gid_t) * p->pipe_user.ut.ngroups))) {
+               if (!(p->pipe_user.ut.groups = (gid_t *)
+                     memdup(a->server_info->groups,
+                            sizeof(gid_t) * p->pipe_user.ut.ngroups))) {
                        DEBUG(0,("pipe_ntlmssp_verify_final: failed to memdup group list to p->pipe_user.groups\n"));
                        data_blob_free(&p->session_key);
                        return False;
@@ -2322,7 +2323,7 @@ BOOL api_rpcTNP(pipes_struct *p, const char *rpc_name,
        if ((DEBUGLEVEL >= 10) && 
            (prs_offset(&p->in_data.data) != prs_data_size(&p->in_data.data))) {
                size_t data_len = prs_data_size(&p->in_data.data) - prs_offset(&p->in_data.data);
-               char *data = SMB_MALLOC(data_len);
+               char *data = (char *)SMB_MALLOC(data_len);
 
                DEBUG(10, ("api_rpcTNP: rpc input buffer underflow (parse error?)\n"));
                if (data) {
index cd0a4f2bb3e56743d3999322b20e14b3164a3839..fc256149631598e76fdcffbf340062dc28589869 100644 (file)
@@ -719,7 +719,8 @@ static void notify_system_time(struct spoolss_notify_msg *msg,
        }
 
        data->notify_data.data.length = prs_offset(&ps);
-       data->notify_data.data.string = TALLOC(mem_ctx, prs_offset(&ps));
+       data->notify_data.data.string = (uint16 *)
+               TALLOC(mem_ctx, prs_offset(&ps));
        if (!data->notify_data.data.string) {
                prs_mem_free(&ps);
                return;
@@ -911,7 +912,8 @@ static int notify_msg_ctr_addmsg( SPOOLSS_NOTIFY_MSG_CTR *ctr, SPOOLSS_NOTIFY_MS
        /* need to allocate own copy of data */
        
        if ( msg->len != 0 ) 
-               msg_grp->msgs[new_slot].notify.data = TALLOC_MEMDUP( ctr->ctx, msg->notify.data, msg->len );
+               msg_grp->msgs[new_slot].notify.data = (char *)
+                       TALLOC_MEMDUP( ctr->ctx, msg->notify.data, msg->len );
        
        return ctr->num_groups;
 }
@@ -1220,7 +1222,7 @@ void do_drv_upgrade_printer(int msg_type, struct process_id src, void *buf, size
        int n_services = lp_numservices();
        
        len = MIN(len,sizeof(drivername)-1);
-       strncpy(drivername, buf, len);
+       strncpy(drivername, (const char *)buf, len);
        
        DEBUG(10,("do_drv_upgrade_printer: Got message for new driver [%s]\n", drivername ));
 
@@ -1318,7 +1320,7 @@ void reset_all_printerdata(int msg_type, struct process_id src,
        int n_services = lp_numservices();
        
        len = MIN( len, sizeof(drivername)-1 );
-       strncpy( drivername, buf, len );
+       strncpy( drivername, (const char *)buf, len );
        
        DEBUG(10,("reset_all_printerdata: Got message for new driver [%s]\n", drivername ));
 
@@ -1381,7 +1383,7 @@ static DEVICEMODE* dup_devicemode(TALLOC_CTX *ctx, DEVICEMODE *devmode)
        
        /* bulk copy first */
        
-       d = TALLOC_MEMDUP(ctx, devmode, sizeof(DEVICEMODE));
+       d = (DEVICEMODE *)TALLOC_MEMDUP(ctx, devmode, sizeof(DEVICEMODE));
        if (!d)
                return NULL;
                
@@ -1408,7 +1410,8 @@ static DEVICEMODE* dup_devicemode(TALLOC_CTX *ctx, DEVICEMODE *devmode)
                        return NULL;
        }
 
-       d->dev_private = TALLOC_MEMDUP(ctx, devmode->dev_private, devmode->driverextra);
+       d->dev_private = (uint8 *)TALLOC_MEMDUP(ctx, devmode->dev_private,
+                                               devmode->driverextra);
        if (!d->dev_private) {
                return NULL;
        }       
@@ -9046,7 +9049,8 @@ WERROR _spoolss_setprinterdataex(pipes_struct *p, SPOOL_Q_SETPRINTERDATAEX *q_u,
                         */
                 
                        set_printer_dataex( printer, keyname, valuename, 
-                                           REG_SZ, (void*)oid_string, strlen(oid_string)+1 );          
+                                           REG_SZ, (uint8 *)oid_string,
+                                           strlen(oid_string)+1 );
                }
        
                status = mod_a_printer(printer, 2);
@@ -9336,7 +9340,7 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_
                
                data_len = regval_size( val );
                if ( data_len ) {
-                       if ( !(enum_values[i].data = TALLOC_MEMDUP(p->mem_ctx, regval_data_p(val), data_len)) ) 
+                       if ( !(enum_values[i].data = (uint8 *)TALLOC_MEMDUP(p->mem_ctx, regval_data_p(val), data_len)) ) 
                        {
                                DEBUG(0,("talloc_memdup failed to allocate memory [data_len=%d] for data!\n", 
                                        data_len ));
index b698bc781daad8f2c2fe6f3e2f487958a46d38cf..6891022264ee145e10b267610f3c0632319f42de 100644 (file)
@@ -655,7 +655,7 @@ static int setup_ver2_dfs_referral(char *pathname, char **ppdata,
        /* add the unexplained 0x16 bytes */
        reply_size += 0x16;
 
-       pdata = SMB_REALLOC(pdata,reply_size);
+       pdata = (char *)SMB_REALLOC(pdata,reply_size);
        if(pdata == NULL) {
                DEBUG(0,("malloc failed for Realloc!\n"));
                return -1;
@@ -740,7 +740,7 @@ static int setup_ver3_dfs_referral(char *pathname, char **ppdata,
                reply_size += (strlen(junction->referral_list[i].alternate_path)+1)*2;
        }
 
-       pdata = SMB_REALLOC(pdata,reply_size);
+       pdata = (char *)SMB_REALLOC(pdata,reply_size);
        if(pdata == NULL) {
                DEBUG(0,("version3 referral setup: malloc failed for Realloc!\n"));
                return -1;
index a824978eceab41401ad2b72e209a619e349449f0..e754583312f6d73a41ab354cb2825243941ac508 100644 (file)
@@ -244,7 +244,7 @@ void destroy_quota_handle(void **pqt_handle)
        if (!pqt_handle||!(*pqt_handle))
                return;
        
-       qt_handle = (*pqt_handle);
+       qt_handle = (SMB_NTQUOTA_HANDLE *)(*pqt_handle);
        
        
        if (qt_handle->quota_list)
index 3ea442f818f9e8a297e88a275fce79ed6cdc32aa..a431f6e07aa4dc9b4626ce493297f29dd6555ea4 100644 (file)
@@ -169,7 +169,7 @@ static char *create_pai_buf(canon_ace *file_ace_list, canon_ace *dir_ace_list, B
 
        *store_size = PAI_ENTRIES_BASE + ((num_entries + num_def_entries)*PAI_ENTRY_LENGTH);
 
-       pai_buf = SMB_MALLOC(*store_size);
+       pai_buf = (char *)SMB_MALLOC(*store_size);
        if (!pai_buf) {
                return NULL;
        }
@@ -441,7 +441,7 @@ static struct pai_val *load_inherited_info(files_struct *fsp)
        if (!lp_map_acl_inherit(SNUM(fsp->conn)))
                return NULL;
 
-       if ((pai_buf = SMB_MALLOC(pai_buf_size)) == NULL)
+       if ((pai_buf = (char *)SMB_MALLOC(pai_buf_size)) == NULL)
                return NULL;
 
        do {
@@ -462,7 +462,7 @@ static struct pai_val *load_inherited_info(files_struct *fsp)
                        if (pai_buf_size > 1024*1024) {
                                return NULL; /* Limit malloc to 1mb. */
                        }
-                       if ((pai_buf = SMB_MALLOC(pai_buf_size)) == NULL)
+                       if ((pai_buf = (char *)SMB_MALLOC(pai_buf_size)) == NULL)
                                return NULL;
                }
        } while (ret == -1);
index 51d1d6cc0a8d92cd263530b004a20e9625f8633d..be00db9adb8c6f1da930fcd27705cdaa0201f23d 100644 (file)
@@ -259,7 +259,8 @@ void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN
        TALLOC_FREE(ctx_p->token);
        
        if (ngroups) {
-               ctx_p->ut.groups = memdup(groups, sizeof(gid_t) * ngroups);
+               ctx_p->ut.groups = (gid_t *)memdup(groups,
+                                                  sizeof(gid_t) * ngroups);
                if (!ctx_p->ut.groups) {
                        smb_panic("memdup failed");
                }
index 7bb5f798f97838cc82cf6c89d4ad7e7752487594..ed6b3dd4c4d313114c38893a60d23f7f2a8a8687 100644 (file)
@@ -206,8 +206,8 @@ void *vfs_add_fsp_extension_notype(vfs_handle_struct *handle, files_struct *fsp,
                return ext_data;
        }
 
-       ext = TALLOC_ZERO(handle->conn->mem_ctx,
-                           sizeof(struct vfs_fsp_data) + ext_size);
+       ext = (struct vfs_fsp_data *)TALLOC_ZERO(
+               handle->conn->mem_ctx, sizeof(struct vfs_fsp_data) + ext_size);
        if (ext == NULL) {
                return NULL;
        }
@@ -647,7 +647,7 @@ char *vfs_readdirname(connection_struct *conn, void *p)
        if (!p)
                return(NULL);
 
-       ptr = SMB_VFS_READDIR(conn,p);
+       ptr = SMB_VFS_READDIR(conn, (DIR *)p);
        if (!ptr)
                return(NULL);