summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-07-30 16:36:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:25 -0500
commite23781b3b304d1e69ad80af5ae9c0ed8d02cf996 (patch)
treed3a6eb0774d9ce907152e886c4c920d24ac2d715 /source3/lib
parent5a5deade6e4634aad561139f39337c9a960c0b80 (diff)
downloadsamba-e23781b3b304d1e69ad80af5ae9c0ed8d02cf996.tar.gz
samba-e23781b3b304d1e69ad80af5ae9c0ed8d02cf996.tar.bz2
samba-e23781b3b304d1e69ad80af5ae9c0ed8d02cf996.zip
r17316: More C++ warnings -- 456 left
(This used to be commit 1e4ee728df7eeafc1b4d533240acb032f73b4f5c)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/data_blob.c8
-rw-r--r--source3/lib/messages.c4
-rw-r--r--source3/lib/util_file.c2
-rw-r--r--source3/lib/util_sid.c4
-rw-r--r--source3/lib/util_str.c15
-rw-r--r--source3/lib/util_unistr.c14
6 files changed, 25 insertions, 22 deletions
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<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) {
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index a0015c265f..31114feb92 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -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);
}