diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-08-01 12:45:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:28 -0500 |
commit | 467ec2a32bac08468855a5a28a7d6e25b26904d5 (patch) | |
tree | bc04c0e4a90ad694699d78cfbac7b6671813aade /source3 | |
parent | fbd04d65c56c36bec287f6c4ffe84ea79b048fa7 (diff) | |
download | samba-467ec2a32bac08468855a5a28a7d6e25b26904d5.tar.gz samba-467ec2a32bac08468855a5a28a7d6e25b26904d5.tar.bz2 samba-467ec2a32bac08468855a5a28a7d6e25b26904d5.zip |
r17363: Some C++ warnings
(This used to be commit fd82f185a2e0f94bfb75f4eee072556ad94bf27d)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libmsrpc/cac_samr.c | 3 | ||||
-rw-r--r-- | source3/libmsrpc/libmsrpc_internal.c | 6 | ||||
-rw-r--r-- | source3/libsmb/smb_share_modes.c | 13 | ||||
-rw-r--r-- | source3/nsswitch/winbind_nss_linux.c | 20 | ||||
-rw-r--r-- | source3/rpc_parse/parse_buffer.c | 3 | ||||
-rw-r--r-- | source3/rpc_parse/parse_dfs.c | 16 | ||||
-rw-r--r-- | source3/torture/denytest.c | 8 | ||||
-rw-r--r-- | source3/torture/nbio.c | 4 | ||||
-rw-r--r-- | source3/torture/pdbtest.c | 4 |
9 files changed, 45 insertions, 32 deletions
diff --git a/source3/libmsrpc/cac_samr.c b/source3/libmsrpc/cac_samr.c index a29ee7a41e..0567188307 100644 --- a/source3/libmsrpc/cac_samr.c +++ b/source3/libmsrpc/cac_samr.c @@ -156,7 +156,8 @@ DOM_SID *cac_get_domain_sid(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, uint32 de if(!fs.out.domain_sid) return NULL; - sid = talloc_memdup(mem_ctx, &(fs.out.domain_sid->sid), sizeof(DOM_SID)); + sid = (DOM_SID *)talloc_memdup(mem_ctx, &(fs.out.domain_sid->sid), + sizeof(DOM_SID)); if(!sid) { hnd->status = NT_STATUS_NO_MEMORY; diff --git a/source3/libmsrpc/libmsrpc_internal.c b/source3/libmsrpc/libmsrpc_internal.c index a097bc181c..a1c37aaac4 100644 --- a/source3/libmsrpc/libmsrpc_internal.c +++ b/source3/libmsrpc/libmsrpc_internal.c @@ -252,7 +252,8 @@ REG_VALUE_DATA *cac_MakeRegValueData(TALLOC_CTX *mem_ctx, uint32 data_type, REGV data->reg_binary.data_length = size; - data->reg_binary.data = talloc_memdup(mem_ctx, buf.buffer, size); + data->reg_binary.data = (uint8 *)talloc_memdup(mem_ctx, buf.buffer, + size); if(!data->reg_binary.data) { TALLOC_FREE(data); errno = ENOMEM; @@ -499,7 +500,8 @@ CacUserInfo *cac_MakeUserInfo(TALLOC_CTX *mem_ctx, SAM_USERINFO_CTR *ctr) { memcpy(info->nt_password, id21->nt_pwd, 8); memcpy(info->lm_password, id21->lm_pwd, 8); - info->logon_hours = talloc_memdup(mem_ctx, &(id21->logon_hrs), sizeof(LOGON_HRS)); + info->logon_hours = (LOGON_HRS *)talloc_memdup(mem_ctx, &(id21->logon_hrs), + sizeof(LOGON_HRS)); if(!info->logon_hours) return NULL; diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c index 34ede9df29..54477c4524 100644 --- a/source3/libsmb/smb_share_modes.c +++ b/source3/libsmb/smb_share_modes.c @@ -259,9 +259,10 @@ int smb_create_share_mode_entry_ex(struct smbdb_ctx *db_ctx, db_data = tdb_fetch(db_ctx->smb_tdb, locking_key); if (!db_data.dptr) { /* We must create the entry. */ - db_data.dptr = malloc((2*sizeof(struct share_mode_entry)) + - strlen(sharepath) + 1 + - strlen(filename) + 1); + db_data.dptr = (char *)malloc( + (2*sizeof(struct share_mode_entry)) + + strlen(sharepath) + 1 + + strlen(filename) + 1); if (!db_data.dptr) { return -1; } @@ -294,7 +295,8 @@ int smb_create_share_mode_entry_ex(struct smbdb_ctx *db_ctx, } /* Entry exists, we must add a new entry. */ - new_data_p = malloc(db_data.dsize + sizeof(struct share_mode_entry)); + new_data_p = (char *)malloc( + db_data.dsize + sizeof(struct share_mode_entry)); if (!new_data_p) { free(db_data.dptr); return -1; @@ -391,7 +393,8 @@ int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx, } /* More than one - allocate a new record minus the one we'll delete. */ - new_data_p = malloc(db_data.dsize - sizeof(struct share_mode_entry)); + new_data_p = (char *)malloc( + db_data.dsize - sizeof(struct share_mode_entry)); if (!new_data_p) { free(db_data.dptr); return -1; diff --git a/source3/nsswitch/winbind_nss_linux.c b/source3/nsswitch/winbind_nss_linux.c index 78a39f2873..6efb9041f9 100644 --- a/source3/nsswitch/winbind_nss_linux.c +++ b/source3/nsswitch/winbind_nss_linux.c @@ -370,7 +370,8 @@ _nss_winbind_getpwent_r(struct passwd *result, char *buffer, return_result: - pw_cache = getpwent_response.extra_data.data; + pw_cache = (struct winbindd_pw *) + getpwent_response.extra_data.data; /* Check data is valid */ @@ -613,7 +614,8 @@ winbind_getgrent(enum winbindd_cmd cmd, return_result: - gr_cache = getgrent_response.extra_data.data; + gr_cache = (struct winbindd_gr *) + getgrent_response.extra_data.data; /* Check data is valid */ @@ -704,7 +706,7 @@ _nss_winbind_getgrnam_r(const char *name, if (ret == NSS_STATUS_SUCCESS) { ret = fill_grent(result, &response.data.gr, - response.extra_data.data, + (char *)response.extra_data.data, &buffer, &buflen); if (ret == NSS_STATUS_TRYAGAIN) { @@ -719,7 +721,8 @@ _nss_winbind_getgrnam_r(const char *name, /* We've been called again */ ret = fill_grent(result, &response.data.gr, - response.extra_data.data, &buffer, &buflen); + (char *)response.extra_data.data, &buffer, + &buflen); if (ret == NSS_STATUS_TRYAGAIN) { keep_response = True; @@ -767,7 +770,7 @@ _nss_winbind_getgrgid_r(gid_t gid, if (ret == NSS_STATUS_SUCCESS) { ret = fill_grent(result, &response.data.gr, - response.extra_data.data, + (char *)response.extra_data.data, &buffer, &buflen); if (ret == NSS_STATUS_TRYAGAIN) { @@ -782,7 +785,8 @@ _nss_winbind_getgrgid_r(gid_t gid, /* We've been called again */ ret = fill_grent(result, &response.data.gr, - response.extra_data.data, &buffer, &buflen); + (char *)response.extra_data.data, &buffer, + &buflen); if (ret == NSS_STATUS_TRYAGAIN) { keep_response = True; @@ -853,7 +857,9 @@ _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start, } } - newgroups = realloc((*groups), newsize * sizeof(**groups)); + newgroups = (gid_t *) + realloc((*groups), + newsize * sizeof(**groups)); if (!newgroups) { *errnop = ENOMEM; ret = NSS_STATUS_NOTFOUND; diff --git a/source3/rpc_parse/parse_buffer.c b/source3/rpc_parse/parse_buffer.c index 21dddfa3cf..5643189afe 100644 --- a/source3/rpc_parse/parse_buffer.c +++ b/source3/rpc_parse/parse_buffer.c @@ -319,7 +319,8 @@ BOOL smb_io_relarraystr(const char *desc, RPC_BUFFER *buffer, int depth, uint16 /* Yes this should be malloc not talloc. Don't change. */ - chaine.buffer = SMB_MALLOC((q-p+1)*sizeof(uint16)); + chaine.buffer = (uint16 *) + SMB_MALLOC((q-p+1)*sizeof(uint16)); if (chaine.buffer == NULL) return False; diff --git a/source3/rpc_parse/parse_dfs.c b/source3/rpc_parse/parse_dfs.c index f1d0705302..fb0d2fe5a7 100644 --- a/source3/rpc_parse/parse_dfs.c +++ b/source3/rpc_parse/parse_dfs.c @@ -325,7 +325,7 @@ BOOL netdfs_io_dfs_Info3_d(const char *desc, NETDFS_DFS_INFO3 *v, prs_struct *ps return False; if (UNMARSHALLING(ps)) { - v->stores = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores); + v->stores = (NETDFS_DFS_STORAGEINFO *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores); } for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) { if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth)) @@ -447,7 +447,7 @@ BOOL netdfs_io_dfs_Info4_d(const char *desc, NETDFS_DFS_INFO4 *v, prs_struct *ps return False; if (UNMARSHALLING(ps)) { - v->stores = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores); + v->stores = (NETDFS_DFS_STORAGEINFO *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores); } for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) { if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth)) @@ -920,7 +920,7 @@ BOOL netdfs_io_dfs_EnumArray1_d(const char *desc, NETDFS_DFS_ENUMARRAY1 *v, prs_ return False; if (UNMARSHALLING(ps)) { - v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + v->s = (NETDFS_DFS_INFO1 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info1_p("s", &v->s[i_s_1], ps, depth)) @@ -986,7 +986,7 @@ BOOL netdfs_io_dfs_EnumArray2_d(const char *desc, NETDFS_DFS_ENUMARRAY2 *v, prs_ return False; if (UNMARSHALLING(ps)) { - v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + v->s = (NETDFS_DFS_INFO2 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info2_p("s", &v->s[i_s_1], ps, depth)) @@ -1052,7 +1052,7 @@ BOOL netdfs_io_dfs_EnumArray3_d(const char *desc, NETDFS_DFS_ENUMARRAY3 *v, prs_ return False; if (UNMARSHALLING(ps)) { - v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + v->s = (NETDFS_DFS_INFO3 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info3_p("s", &v->s[i_s_1], ps, depth)) @@ -1118,7 +1118,7 @@ BOOL netdfs_io_dfs_EnumArray4_d(const char *desc, NETDFS_DFS_ENUMARRAY4 *v, prs_ return False; if (UNMARSHALLING(ps)) { - v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + v->s = (NETDFS_DFS_INFO4 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info4_p("s", &v->s[i_s_1], ps, depth)) @@ -1184,7 +1184,7 @@ BOOL netdfs_io_dfs_EnumArray200_d(const char *desc, NETDFS_DFS_ENUMARRAY200 *v, return False; if (UNMARSHALLING(ps)) { - v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + v->s = (NETDFS_DFS_INFO200 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info200_p("s", &v->s[i_s_1], ps, depth)) @@ -1250,7 +1250,7 @@ BOOL netdfs_io_dfs_EnumArray300_d(const char *desc, NETDFS_DFS_ENUMARRAY300 *v, return False; if (UNMARSHALLING(ps)) { - v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + v->s = (NETDFS_DFS_INFO300 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info300_p("s", &v->s[i_s_1], ps, depth)) diff --git a/source3/torture/denytest.c b/source3/torture/denytest.c index d82376088f..2dc5c2b634 100644 --- a/source3/torture/denytest.c +++ b/source3/torture/denytest.c @@ -1447,10 +1447,10 @@ BOOL torture_denytest1(int dummy) } else { char x = 1; res = A_0; - if (cli_read(cli1, fnum2, (void *)&x, 0, 1) == 1) { + if (cli_read(cli1, fnum2, (char *)&x, 0, 1) == 1) { res += A_R; } - if (cli_write(cli1, fnum2, 0, (void *)&x, 0, 1) == 1) { + if (cli_write(cli1, fnum2, 0, (char *)&x, 0, 1) == 1) { res += A_W; } } @@ -1531,10 +1531,10 @@ BOOL torture_denytest2(int dummy) } else { char x = 1; res = A_0; - if (cli_read(cli2, fnum2, (void *)&x, 0, 1) == 1) { + if (cli_read(cli2, fnum2, (char *)&x, 0, 1) == 1) { res += A_R; } - if (cli_write(cli2, fnum2, 0, (void *)&x, 0, 1) == 1) { + if (cli_write(cli2, fnum2, 0, (char *)&x, 0, 1) == 1) { res += A_W; } } diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c index 795392ae5c..9b2d58c86e 100644 --- a/source3/torture/nbio.c +++ b/source3/torture/nbio.c @@ -34,7 +34,7 @@ static struct { int handle; } ftable[MAX_FILES]; -static struct { +static struct children { double bytes_in, bytes_out; int line; int done; @@ -70,7 +70,7 @@ void nb_alarm(int ignore) void nbio_shmem(int n) { nprocs = n; - children = shm_setup(sizeof(*children) * nprocs); + children = (struct children *)shm_setup(sizeof(*children) * nprocs); if (!children) { printf("Failed to setup shared memory!\n"); exit(1); diff --git a/source3/torture/pdbtest.c b/source3/torture/pdbtest.c index e1a35b7912..8b15f9629b 100644 --- a/source3/torture/pdbtest.c +++ b/source3/torture/pdbtest.c @@ -291,9 +291,9 @@ int main(int argc, char **argv) pdb_get_account_policy(AP_PASSWORD_HISTORY, &history); if (history * PW_HISTORY_ENTRY_LEN < NT_HASH_LEN) { - buf = TALLOC(ctx, NT_HASH_LEN); + buf = (uint8 *)TALLOC(ctx, NT_HASH_LEN); } else { - buf = TALLOC(ctx, history * PW_HISTORY_ENTRY_LEN); + buf = (uint8 *)TALLOC(ctx, history * PW_HISTORY_ENTRY_LEN); } /* Generate some random hashes */ |