r17316: More C++ warnings -- 456 left
authorVolker Lendecke <vlendec@samba.org>
Sun, 30 Jul 2006 16:36:56 +0000 (16:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:25 +0000 (11:38 -0500)
(This used to be commit 1e4ee728df7eeafc1b4d533240acb032f73b4f5c)

19 files changed:
source3/include/smb_macros.h
source3/lib/data_blob.c
source3/lib/messages.c
source3/lib/util_file.c
source3/lib/util_sid.c
source3/lib/util_str.c
source3/lib/util_unistr.c
source3/modules/vfs_posixacl.c
source3/rpc_client/cli_echo.c
source3/rpc_client/cli_spoolss.c
source3/rpc_parse/parse_misc.c
source3/rpc_parse/parse_prs.c
source3/rpc_server/srv_eventlog_lib.c
source3/rpcclient/cmd_echo.c
source3/rpcclient/cmd_spoolss.c
source3/smbd/ipc.c
source3/smbd/nttrans.c
source3/smbd/trans2.c
source3/utils/net_rpc_printer.c

index e296ddd140326f097a876899eac96c72aa4577b5..44f15734d9af50a3417ade09310df1833db4a804 100644 (file)
@@ -285,7 +285,7 @@ copy an IP address from one buffer to another
 #define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count))
 
 /* limiting size of ipc replies */
-#define SMB_REALLOC_LIMIT(ptr,size) SMB_REALLOC(ptr,MAX((size),4*1024))
+#define SMB_REALLOC_LIMIT(ptr,size) (char *)SMB_REALLOC(ptr,MAX((size),4*1024))
 
 /* The new talloc is paranoid malloc checker safe. */
 
index 860ef5ad10f845ff2a6cd441f0407afb9cb2071d..4d5dda2435973c8d75c1fe86ac82654703d9008e 100644 (file)
@@ -47,9 +47,9 @@ DATA_BLOB data_blob(const void *p, size_t length)
        }
 
        if (p) {
-               ret.data = smb_xmemdup(p, length);
+               ret.data = (uint8 *)smb_xmemdup(p, length);
        } else {
-               ret.data = SMB_XMALLOC_ARRAY(unsigned char, length);
+               ret.data = SMB_XMALLOC_ARRAY(uint8, length);
        }
        ret.length = length;
        ret.free = free_data_blob;
@@ -70,11 +70,11 @@ DATA_BLOB data_blob_talloc(TALLOC_CTX *mem_ctx, const void *p, size_t length)
        }
 
        if (p) {
-               ret.data = TALLOC_MEMDUP(mem_ctx, p, length);
+               ret.data = (uint8 *)TALLOC_MEMDUP(mem_ctx, p, length);
                if (ret.data == NULL)
                        smb_panic("data_blob_talloc: talloc_memdup failed.\n");
        } else {
-               ret.data = TALLOC(mem_ctx, length);
+               ret.data = (uint8 *)TALLOC(mem_ctx, length);
                if (ret.data == NULL)
                        smb_panic("data_blob_talloc: talloc failed.\n");
        }
index 410e4af6591835059840af173325d7eabec770d2..93e12ebe35adabb3a89628246de238ba4443d736 100644 (file)
@@ -104,7 +104,7 @@ static void sig_usr1(void)
 static void ping_message(int msg_type, struct process_id src,
                         void *buf, size_t len)
 {
-       const char *msg = buf ? buf : "none";
+       const char *msg = buf ? (const char *)buf : "none";
 
        DEBUG(1,("INFO: Received PING message from PID %s [%s]\n",
                 procid_str_static(&src), msg));
@@ -236,7 +236,7 @@ static BOOL message_send_pid_internal(struct process_id pid, int msg_type,
 
        kbuf = message_key_pid(pid);
 
-       dbuf.dptr = (void *)SMB_MALLOC(len + sizeof(rec));
+       dbuf.dptr = (char *)SMB_MALLOC(len + sizeof(rec));
        if (!dbuf.dptr)
                return False;
 
index ed7be3f6c1d5fb6fd88fea68ecf7a9c80378d58a..77ee95cc38a783af64385707c18e8db7365628bf 100644 (file)
@@ -353,7 +353,7 @@ char *file_pload(char *syscmd, size_t *size)
        total = 0;
 
        while ((n = read(fd, buf, sizeof(buf))) > 0) {
-               p = SMB_REALLOC(p, total + n + 1);
+               p = (char *)SMB_REALLOC(p, total + n + 1);
                if (!p) {
                        DEBUG(0,("file_pload: failed to expand buffer!\n"));
                        close(fd);
index 09fe30f81bbd0a2f1119135357e7cdc0dcf34f47..4d31080ec98fb55f289c8421a9c1648b6e7f8b2f 100644 (file)
@@ -531,7 +531,7 @@ char *sid_binstring(const DOM_SID *sid)
 {
        char *buf, *s;
        int len = sid_size(sid);
-       buf = SMB_MALLOC(len);
+       buf = (char *)SMB_MALLOC(len);
        if (!buf)
                return NULL;
        sid_linearize(buf, len, sid);
@@ -549,7 +549,7 @@ char *sid_binstring_hex(const DOM_SID *sid)
 {
        char *buf, *s;
        int len = sid_size(sid);
-       buf = SMB_MALLOC(len);
+       buf = (char *)SMB_MALLOC(len);
        if (!buf)
                return NULL;
        sid_linearize(buf, len, sid);
index 2580521c3b9f97b10929251a955245c202f11a40..6677d075bdf8572da17782d7bbc961e0a742323e 100644 (file)
@@ -1074,7 +1074,7 @@ char *realloc_string_sub(char *string, const char *pattern,
        while ((p = strstr_m(s,pattern))) {
                if (ld > 0) {
                        int offset = PTR_DIFF(s,string);
-                       string = SMB_REALLOC(string, ls + ld + 1);
+                       string = (char *)SMB_REALLOC(string, ls + ld + 1);
                        if (!string) {
                                DEBUG(0, ("realloc_string_sub: out of memory!\n"));
                                SAFE_FREE(in);
@@ -1143,7 +1143,8 @@ char *talloc_string_sub(TALLOC_CTX *mem_ctx, const char *src,
        while ((p = strstr_m(s,pattern))) {
                if (ld > 0) {
                        int offset = PTR_DIFF(s,string);
-                       string = TALLOC_REALLOC(mem_ctx, string, ls + ld + 1);
+                       string = (char *)TALLOC_REALLOC(mem_ctx, string,
+                                                       ls + ld + 1);
                        if (!string) {
                                DEBUG(0, ("talloc_string_sub: out of "
                                          "memory!\n"));
@@ -1602,7 +1603,7 @@ char *binary_string_rfc2254(char *buf, int len)
        char *s;
        int i, j;
        const char *hex = "0123456789ABCDEF";
-       s = SMB_MALLOC(len * 3 + 1);
+       s = (char *)SMB_MALLOC(len * 3 + 1);
        if (!s)
                return NULL;
        for (j=i=0;i<len;i++) {
@@ -1620,7 +1621,7 @@ char *binary_string(char *buf, int len)
        char *s;
        int i, j;
        const char *hex = "0123456789ABCDEF";
-       s = SMB_MALLOC(len * 2 + 1);
+       s = (char *)SMB_MALLOC(len * 2 + 1);
        if (!s)
                return NULL;
        for (j=i=0;i<len;i++) {
@@ -2242,7 +2243,7 @@ char * base64_encode_data_blob(DATA_BLOB data)
        out_cnt = 0;
        len = data.length;
        output_len = data.length * 2;
-       result = SMB_MALLOC(output_len); /* get us plenty of space */
+       result = (char *)SMB_MALLOC(output_len); /* get us plenty of space */
 
        while (len-- && out_cnt < (data.length * 2) - 5) {
                int c = (unsigned char) *(data.data++);
@@ -2376,11 +2377,11 @@ void string_append(char **left, const char *right)
        int new_len = strlen(right) + 1;
 
        if (*left == NULL) {
-               *left = SMB_MALLOC(new_len);
+               *left = (char *)SMB_MALLOC(new_len);
                *left[0] = '\0';
        } else {
                new_len += strlen(*left);
-               *left = SMB_REALLOC(*left, new_len);
+               *left = (char *)SMB_REALLOC(*left, new_len);
        }
 
        if (*left == NULL) {
index a0015c265fb2048fa3a225c833f84b3db96ca25f..31114feb92448afa1bb8b38101910b6e29ceb870 100644 (file)
@@ -88,10 +88,12 @@ void load_case_tables(void)
        }
        initialised = 1;
 
-       upcase_table = map_file(lib_path("upcase.dat"), 0x20000);
+       upcase_table = (smb_ucs2_t *)map_file(lib_path("upcase.dat"),
+                                             0x20000);
        upcase_table_use_unmap = ( upcase_table != NULL );
 
-       lowcase_table = map_file(lib_path("lowcase.dat"), 0x20000);
+       lowcase_table = (smb_ucs2_t *)map_file(lib_path("lowcase.dat"),
+                                              0x20000);
        lowcase_table_use_unmap = ( lowcase_table != NULL );
 
 #ifdef HAVE_SETLOCALE
@@ -111,7 +113,7 @@ void load_case_tables(void)
           not available */
        if (!upcase_table) {
                DEBUG(1,("creating lame upcase table\n"));
-               upcase_table = SMB_MALLOC(0x20000);
+               upcase_table = (smb_ucs2_t *)SMB_MALLOC(0x20000);
                for (i=0;i<0x10000;i++) {
                        smb_ucs2_t v;
                        SSVAL(&v, 0, i);
@@ -126,7 +128,7 @@ void load_case_tables(void)
 
        if (!lowcase_table) {
                DEBUG(1,("creating lame lowcase table\n"));
-               lowcase_table = SMB_MALLOC(0x20000);
+               lowcase_table = (smb_ucs2_t *)SMB_MALLOC(0x20000);
                for (i=0;i<0x10000;i++) {
                        smb_ucs2_t v;
                        SSVAL(&v, 0, i);
@@ -228,7 +230,7 @@ void init_valid_table(void)
                return;
        }
 
-       valid_file = map_file(lib_path("valid.dat"), 0x10000);
+       valid_file = (uint8 *)map_file(lib_path("valid.dat"), 0x10000);
        if (valid_file) {
                valid_table = valid_file;
                mapped_file = 1;
@@ -247,7 +249,7 @@ void init_valid_table(void)
        valid_table_use_unmap = False;
 
        DEBUG(2,("creating default valid table\n"));
-       valid_table = SMB_MALLOC(0x10000);
+       valid_table = (uint8 *)SMB_MALLOC(0x10000);
        for (i=0;i<128;i++) {
                valid_table[i] = isalnum(i) || strchr(allowed,i);
        }
index 6d7c2b3c006cac06d51de422b7dc72d3539932fc..c793d8306894199674536c1d24647f01cbb22cff 100644 (file)
@@ -172,7 +172,7 @@ static BOOL smb_ace_to_internal(acl_entry_t posix_ace,
        }
        switch(ace->a_type) {
        case SMB_ACL_USER: {
-               uid_t *puid = acl_get_qualifier(posix_ace);
+               uid_t *puid = (uid_t *)acl_get_qualifier(posix_ace);
                if (puid == NULL) {
                        DEBUG(0, ("smb_acl_get_qualifier failed\n"));
                        return False;
@@ -183,7 +183,7 @@ static BOOL smb_ace_to_internal(acl_entry_t posix_ace,
        }
                
        case SMB_ACL_GROUP: {
-               gid_t *pgid = acl_get_qualifier(posix_ace);
+               gid_t *pgid = (uid_t *)acl_get_qualifier(posix_ace);
                if (pgid == NULL) {
                        DEBUG(0, ("smb_acl_get_qualifier failed\n"));
                        return False;
@@ -219,9 +219,9 @@ static struct smb_acl_t *smb_acl_to_internal(acl_t acl)
 
                entry_id = ACL_NEXT_ENTRY;
 
-               result = SMB_REALLOC(result, sizeof(struct smb_acl_t) +
-                                    (sizeof(struct smb_acl_entry) *
-                                     (result->count+1)));
+               result = (struct smb_acl_t *)SMB_REALLOC(
+                       result, sizeof(struct smb_acl_t) +
+                       (sizeof(struct smb_acl_entry) * (result->count+1)));
                if (result == NULL) {
                        DEBUG(0, ("SMB_REALLOC failed\n"));
                        errno = ENOMEM;
index 9818fad79b512161c5606f9c10f79e3da791bfda..b76b6e285fed93a46e1861d16e0cb2b781e4b52a 100644 (file)
@@ -78,7 +78,7 @@ NTSTATUS rpccli_echo_data(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
        result = True;
 
        if (out_data) {
-               *out_data = TALLOC(mem_ctx, size);
+               *out_data = (char *)TALLOC(mem_ctx, size);
                if (!*out_data) {
                        return NT_STATUS_NO_MEMORY;
                }
index d6d4417da37197052d77207e4f8f89663998b5f7..75c617c944c2fc2da1cc3c60cec42ff0699e7309 100644 (file)
@@ -1609,7 +1609,7 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *me
 
        /* Return output parameters */
 
-       value->data_p = TALLOC_MEMDUP(mem_ctx, out.data, out.needed);
+       value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed);
        value->type = out.type;
        value->size = out.size;
 
@@ -1662,7 +1662,7 @@ WERROR rpccli_spoolss_getprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX *
 
        /* Return output parameters */
 
-       value->data_p = TALLOC_MEMDUP(mem_ctx, out.data, out.needed);
+       value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed);
        value->type = out.type;
        value->size = out.needed;
        
@@ -1758,7 +1758,8 @@ WERROR rpccli_spoolss_enumprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *m
        if (value) {
                rpcstr_pull(value->valuename, out.value, sizeof(value->valuename), -1,
                            STR_TERMINATE);
-               value->data_p = TALLOC_MEMDUP(mem_ctx, out.data, out.realdatasize);
+               value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data,
+                                                      out.realdatasize);
                value->type = out.type;
                value->size = out.realdatasize;
        }
index cb7c06eb459a8ca4be5ca4667f8972b19013e801..532b7ccc7f206345299ddb79fc7bd5ee74d21484 100644 (file)
@@ -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);
index 29a3e60aa909752184a7c0e26fc3fae1c0697ea2..820565f09f6b837fa117c84dfed4edbb460ae598 100644 (file)
@@ -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;
index 66be1dc34ff58e74ddfc5de710cb1c773f53858f..c853f932aeefd67373f8d6021372f74d883516b4 100644 (file)
@@ -90,7 +90,7 @@ struct trav_size_struct {
 static int eventlog_tdb_size_fn( TDB_CONTEXT * tdb, TDB_DATA key, TDB_DATA data,
                          void *state )
 {
-       struct trav_size_struct  *tsize = state;
+       struct trav_size_struct  *tsize = (struct trav_size_struct *)state;
        
        tsize->size += data.dsize;
        tsize->rec_count++;
@@ -486,7 +486,7 @@ int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee )
        }
 
        /* alloc mem for the packed version */
-       packed_ee = TALLOC( mem_ctx, ee->record.length + MARGIN );
+       packed_ee = (uint8 *)TALLOC( mem_ctx, ee->record.length + MARGIN );
        if ( !packed_ee ) {
                talloc_destroy( mem_ctx );
                return 0;
index 6d608ebaf10ab8c4059de38039111f15947d9eaf..4432f5b14b24f2e3ae8d5532ec12a2399eb9c0d3 100644 (file)
@@ -60,7 +60,7 @@ static NTSTATUS cmd_echo_data(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
        }
 
        size = atoi(argv[1]);
-       in_data = SMB_MALLOC(size);
+       in_data = (char *)SMB_MALLOC(size);
 
        for (i = 0; i < size; i++)
                in_data[i] = i & 0xff;
@@ -129,7 +129,7 @@ static NTSTATUS cmd_echo_sink_data(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        }
 
        size = atoi(argv[1]);
-       in_data = SMB_MALLOC(size);
+       in_data = (char *)SMB_MALLOC(size);
 
        for (i = 0; i < size; i++)
                in_data[i] = i & 0xff;
index d77c58ad9596f5abc6af38b281a9ef46bf90eb2e..b5672cb2a1acbfc00ac866e8854beef019a4194f 100644 (file)
@@ -2030,13 +2030,15 @@ static WERROR cmd_spoolss_setprinterdata(struct rpc_pipe_client *cli,
                UNISTR2 data;
                init_unistr2(&data, argv[4], UNI_STR_TERMINATE);
                value.size = data.uni_str_len * 2;
-               value.data_p = TALLOC_MEMDUP(mem_ctx, data.buffer, value.size);
+               value.data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, data.buffer,
+                                                     value.size);
                break;
        }
        case REG_DWORD: {
                uint32 data = strtoul(argv[4], NULL, 10);
                value.size = sizeof(data);
-               value.data_p = TALLOC_MEMDUP(mem_ctx, &data, sizeof(data));
+               value.data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, &data,
+                                                     sizeof(data));
                break;
        }
        case REG_BINARY: {
index e6dfc6506a0d1cbc9f0ff62eff10eefc3c0b30aa..08381524c0d56455fd38df81d42c43f62a02efda 100644 (file)
@@ -478,7 +478,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf,
        if (state->total_data)  {
                /* Can't use talloc here, the core routines do realloc on the
                 * params and data. */
-               state->data = SMB_MALLOC(state->total_data);
+               state->data = (char *)SMB_MALLOC(state->total_data);
                if (state->data == NULL) {
                        DEBUG(0,("reply_trans: data malloc fail for %u "
                                 "bytes !\n", (unsigned int)state->total_data));
@@ -498,7 +498,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf,
        if (state->total_param) {
                /* Can't use talloc here, the core routines do realloc on the
                 * params and data. */
-               state->param = SMB_MALLOC(state->total_param);
+               state->param = (char *)SMB_MALLOC(state->total_param);
                if (state->param == NULL) {
                        DEBUG(0,("reply_trans: param malloc fail for %u "
                                 "bytes !\n", (unsigned int)state->total_param));
index 0b1bdcadbb1bd88be35c3a7bdef1daa7081e87d9..d107bf84d360208019ac47f1af2a22ba48de16f2 100644 (file)
@@ -52,7 +52,7 @@ static char *nttrans_realloc(char **ptr, size_t size)
                smb_panic("nttrans_realloc() called with NULL ptr\n");
        }
                
-       *ptr = SMB_REALLOC(*ptr, size);
+       *ptr = (char *)SMB_REALLOC(*ptr, size);
        if(*ptr == NULL) {
                return NULL;
        }
@@ -2908,7 +2908,7 @@ int reply_nttrans(connection_struct *conn,
        if (state->total_data)  {
                /* Can't use talloc here, the core routines do realloc on the
                 * params and data. */
-               if ((state->data = SMB_MALLOC(state->total_data)) == NULL) {
+               if ((state->data = (char *)SMB_MALLOC(state->total_data)) == NULL) {
                        DEBUG(0,("reply_nttrans: data malloc fail for %u "
                                 "bytes !\n", (unsigned int)state->total_data));
                        TALLOC_FREE(state);
@@ -2927,7 +2927,7 @@ int reply_nttrans(connection_struct *conn,
        if (state->total_param) {
                /* Can't use talloc here, the core routines do realloc on the
                 * params and data. */
-               if ((state->param = SMB_MALLOC(state->total_param)) == NULL) {
+               if ((state->param = (char *)SMB_MALLOC(state->total_param)) == NULL) {
                        DEBUG(0,("reply_nttrans: param malloc fail for %u "
                                 "bytes !\n", (unsigned int)state->total_param));
                        SAFE_FREE(state->data);
@@ -2950,7 +2950,7 @@ int reply_nttrans(connection_struct *conn,
        if(state->setup_count > 0) {
                DEBUG(10,("reply_nttrans: state->setup_count = %d\n",
                          state->setup_count));
-               state->setup = TALLOC(state, state->setup_count);
+               state->setup = (uint16 *)TALLOC(state, state->setup_count);
                if (state->setup == NULL) {
                        DEBUG(0,("reply_nttrans : Out of memory\n"));
                        SAFE_FREE(state->data);
index 5acce13e52d78e8ce15abbae9127ab41090afd56..8eb8790975e85ca037a6a116e11219d4f21aedaa 100644 (file)
@@ -170,8 +170,8 @@ static struct ea_list *get_ea_list_from_file(TALLOC_CTX *mem_ctx, connection_str
                return NULL;
        }
 
-       for (i = 0, ea_namelist = TALLOC(mem_ctx, ea_namelist_size); i < 6;
-                       ea_namelist = TALLOC_REALLOC_ARRAY(mem_ctx, ea_namelist, char, ea_namelist_size), i++) {
+       for (i = 0, ea_namelist = TALLOC_ARRAY(mem_ctx, char, ea_namelist_size); i < 6;
+            ea_namelist = TALLOC_REALLOC_ARRAY(mem_ctx, ea_namelist, char, ea_namelist_size), i++) {
 
                if (!ea_namelist) {
                        return NULL;
@@ -899,7 +899,7 @@ static int call_trans2open(connection_struct *conn, char *inbuf, char *outbuf, i
        }
 
        /* Realloc the size of parameters and data we will return */
-       *pparams = SMB_REALLOC(*pparams, 30);
+       *pparams = (char *)SMB_REALLOC(*pparams, 30);
        if(*pparams == NULL ) {
                return ERROR_NT(NT_STATUS_NO_MEMORY);
        }
index 50ab50bace33875696fbdd73883543692d7cdd33..dc3cb42dbe6cb444ab475b90aab62705db6128a7 100644 (file)
@@ -2171,7 +2171,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(const DOM_SID *domain_sid,
                if (ctr_enum.printers_2[i].devmode != NULL) {
 
                        /* copy devmode (info level 2) */
-                       ctr_dst.printers_2->devmode =
+                       ctr_dst.printers_2->devmode = (struct devicemode *)
                                TALLOC_MEMDUP(mem_ctx,
                                              ctr_enum.printers_2[i].devmode,
                                              sizeof(DEVICEMODE));
@@ -2332,7 +2332,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(const DOM_SID *domain_sid,
 
                                        value.type = REG_SZ;
                                        value.size = data.uni_str_len * 2;
-                                       value.data_p = TALLOC_MEMDUP(mem_ctx, data.buffer, value.size);
+                                       value.data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, data.buffer, value.size);
 
                                        if (opt_verbose) 
                                                display_reg_value(subkey, value);