From e23781b3b304d1e69ad80af5ae9c0ed8d02cf996 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 30 Jul 2006 16:36:56 +0000 Subject: r17316: More C++ warnings -- 456 left (This used to be commit 1e4ee728df7eeafc1b4d533240acb032f73b4f5c) --- source3/lib/data_blob.c | 8 ++++---- source3/lib/messages.c | 4 ++-- source3/lib/util_file.c | 2 +- source3/lib/util_sid.c | 4 ++-- source3/lib/util_str.c | 15 ++++++++------- source3/lib/util_unistr.c | 14 ++++++++------ 6 files changed, 25 insertions(+), 22 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/data_blob.c b/source3/lib/data_blob.c index 860ef5ad10..4d5dda2435 100644 --- a/source3/lib/data_blob.c +++ b/source3/lib/data_blob.c @@ -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"); } diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 410e4af659..93e12ebe35 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -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; diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index ed7be3f6c1..77ee95cc38 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -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); diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index 09fe30f81b..4d31080ec9 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -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); diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 2580521c3b..6677d075bd 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -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