mirror of
https://github.com/samba-team/samba.git
synced 2025-12-13 16:23:50 +03:00
r17316: More C++ warnings -- 456 left
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
68c43191c8
commit
1e4ee728df
@@ -518,7 +518,7 @@ BOOL smb_io_unistr(const char *desc, UNISTR *uni, prs_struct *ps, int depth)
|
||||
|
||||
size_t create_rpc_blob(RPC_DATA_BLOB *str, size_t len)
|
||||
{
|
||||
str->buffer = TALLOC_ZERO(get_talloc_ctx(), len);
|
||||
str->buffer = (uint8 *)TALLOC_ZERO(get_talloc_ctx(), len);
|
||||
if (str->buffer == NULL)
|
||||
smb_panic("create_rpc_blob: talloc fail\n");
|
||||
return len;
|
||||
@@ -617,7 +617,8 @@ void init_regval_buffer(REGVAL_BUFFER *str, const uint8 *buf, size_t len)
|
||||
|
||||
if (buf != NULL) {
|
||||
SMB_ASSERT(str->buf_max_len >= str->buf_len);
|
||||
str->buffer = TALLOC_ZERO(get_talloc_ctx(), str->buf_max_len);
|
||||
str->buffer = (uint16 *)TALLOC_ZERO(get_talloc_ctx(),
|
||||
str->buf_max_len);
|
||||
if (str->buffer == NULL)
|
||||
smb_panic("init_regval_buffer: talloc fail\n");
|
||||
memcpy(str->buffer, buf, str->buf_len);
|
||||
@@ -723,7 +724,8 @@ void init_string2(STRING2 *str, const char *buf, size_t max_len, size_t str_len)
|
||||
|
||||
/* store the string */
|
||||
if(str_len != 0) {
|
||||
str->buffer = TALLOC_ZERO(get_talloc_ctx(), str->str_max_len);
|
||||
str->buffer = (uint8 *)TALLOC_ZERO(get_talloc_ctx(),
|
||||
str->str_max_len);
|
||||
if (str->buffer == NULL)
|
||||
smb_panic("init_string2: malloc fail\n");
|
||||
memcpy(str->buffer, buf, str_len);
|
||||
|
||||
@@ -158,7 +158,8 @@ char *prs_alloc_mem(prs_struct *ps, size_t size, unsigned int count)
|
||||
|
||||
if (size) {
|
||||
/* We can't call the type-safe version here. */
|
||||
ret = _talloc_zero_array(ps->mem_ctx, size, count, "parse_prs");
|
||||
ret = (char *)_talloc_zero_array(ps->mem_ctx, size, count,
|
||||
"parse_prs");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -213,7 +214,7 @@ BOOL prs_set_buffer_size(prs_struct *ps, uint32 newsize)
|
||||
if (newsize == 0) {
|
||||
SAFE_FREE(ps->data_p);
|
||||
} else {
|
||||
ps->data_p = SMB_REALLOC(ps->data_p, newsize);
|
||||
ps->data_p = (char *)SMB_REALLOC(ps->data_p, newsize);
|
||||
|
||||
if (ps->data_p == NULL) {
|
||||
DEBUG(0,("prs_set_buffer_size: Realloc failure for size %u.\n",
|
||||
@@ -265,7 +266,7 @@ BOOL prs_grow(prs_struct *ps, uint32 extra_space)
|
||||
|
||||
new_size = MAX(RPC_MAX_PDU_FRAG_LEN,extra_space);
|
||||
|
||||
if((ps->data_p = SMB_MALLOC(new_size)) == NULL) {
|
||||
if((ps->data_p = (char *)SMB_MALLOC(new_size)) == NULL) {
|
||||
DEBUG(0,("prs_grow: Malloc failure for size %u.\n", (unsigned int)new_size));
|
||||
return False;
|
||||
}
|
||||
@@ -277,7 +278,7 @@ BOOL prs_grow(prs_struct *ps, uint32 extra_space)
|
||||
*/
|
||||
new_size = MAX(ps->buffer_size*2, ps->buffer_size + extra_space);
|
||||
|
||||
if ((ps->data_p = SMB_REALLOC(ps->data_p, new_size)) == NULL) {
|
||||
if ((ps->data_p = (char *)SMB_REALLOC(ps->data_p, new_size)) == NULL) {
|
||||
DEBUG(0,("prs_grow: Realloc failure for size %u.\n",
|
||||
(unsigned int)new_size));
|
||||
return False;
|
||||
@@ -306,7 +307,7 @@ BOOL prs_force_grow(prs_struct *ps, uint32 extra_space)
|
||||
return False;
|
||||
}
|
||||
|
||||
if((ps->data_p = SMB_REALLOC(ps->data_p, new_size)) == NULL) {
|
||||
if((ps->data_p = (char *)SMB_REALLOC(ps->data_p, new_size)) == NULL) {
|
||||
DEBUG(0,("prs_force_grow: Realloc failure for size %u.\n",
|
||||
(unsigned int)new_size));
|
||||
return False;
|
||||
@@ -1816,7 +1817,7 @@ return the contents of a prs_struct in a DATA_BLOB
|
||||
BOOL prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
blob->length = prs_offset(prs);
|
||||
blob->data = talloc_zero_size(mem_ctx, blob->length);
|
||||
blob->data = (uint8 *)talloc_zero_size(mem_ctx, blob->length);
|
||||
|
||||
if (!prs_copy_all_data_out((char *)blob->data, prs))
|
||||
return False;
|
||||
|
||||
Reference in New Issue
Block a user