svn commit: samba r17334 - in branches/SAMBA_3_0/source: lib popt
vlendec at samba.org
vlendec at samba.org
Mon Jul 31 04:30:55 GMT 2006
Author: vlendec
Date: 2006-07-31 04:30:55 +0000 (Mon, 31 Jul 2006)
New Revision: 17334
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17334
Log:
Some C++ warnings
Modified:
branches/SAMBA_3_0/source/lib/account_pol.c
branches/SAMBA_3_0/source/lib/debug.c
branches/SAMBA_3_0/source/lib/dprintf.c
branches/SAMBA_3_0/source/lib/gencache.c
branches/SAMBA_3_0/source/lib/interface.c
branches/SAMBA_3_0/source/lib/ldap_escape.c
branches/SAMBA_3_0/source/lib/privileges.c
branches/SAMBA_3_0/source/lib/smbldap.c
branches/SAMBA_3_0/source/lib/sysacls.c
branches/SAMBA_3_0/source/lib/util_pw.c
branches/SAMBA_3_0/source/lib/xfile.c
branches/SAMBA_3_0/source/popt/findme.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/account_pol.c
===================================================================
--- branches/SAMBA_3_0/source/lib/account_pol.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/account_pol.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -94,7 +94,7 @@
len += strlen(account_policy_names[i].string) + 1;
}
len++;
- nl = SMB_MALLOC(len);
+ nl = (char *)SMB_MALLOC(len);
if (!nl) {
return NULL;
}
Modified: branches/SAMBA_3_0/source/lib/debug.c
===================================================================
--- branches/SAMBA_3_0/source/lib/debug.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/debug.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -236,7 +236,7 @@
}
/* create single string list - add space for newline */
- b = buf = SMB_MALLOC(dim+1);
+ b = buf = (char *)SMB_MALLOC(dim+1);
if (!buf) {
err = True;
goto done;
@@ -320,7 +320,7 @@
new_ptr = SMB_REALLOC_ARRAY(new_ptr, int, debug_num_classes + 1);
if (!new_ptr)
return -1;
- DEBUGLEVEL_CLASS = new_ptr;
+ DEBUGLEVEL_CLASS = (int *)new_ptr;
DEBUGLEVEL_CLASS[ndx] = 0;
/* debug_level is the pointer used for the DEBUGLEVEL-thingy */
@@ -337,13 +337,13 @@
new_ptr = SMB_REALLOC_ARRAY(new_ptr, BOOL, debug_num_classes + 1);
if (!new_ptr)
return -1;
- DEBUGLEVEL_CLASS_ISSET = new_ptr;
+ DEBUGLEVEL_CLASS_ISSET = (int *)new_ptr;
DEBUGLEVEL_CLASS_ISSET[ndx] = False;
new_ptr = SMB_REALLOC_ARRAY(classname_table, char *, debug_num_classes + 1);
if (!new_ptr)
return -1;
- classname_table = new_ptr;
+ classname_table = (char **)new_ptr;
classname_table[ndx] = SMB_STRDUP(classname);
if (! classname_table[ndx])
@@ -474,7 +474,7 @@
static void debug_message(int msg_type, struct process_id src,
void *buf, size_t len)
{
- const char *params_str = buf;
+ const char *params_str = (const char *)buf;
/* Check, it's a proper string! */
if (params_str[len-1] != '\0') {
Modified: branches/SAMBA_3_0/source/lib/dprintf.c
===================================================================
--- branches/SAMBA_3_0/source/lib/dprintf.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/dprintf.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -54,7 +54,7 @@
charset, but beware of it growing */
maxlen = ret*2;
again:
- p2 = SMB_MALLOC(maxlen);
+ p2 = (char *)SMB_MALLOC(maxlen);
if (!p2) {
SAFE_FREE(p);
return -1;
Modified: branches/SAMBA_3_0/source/lib/gencache.c
===================================================================
--- branches/SAMBA_3_0/source/lib/gencache.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/gencache.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -260,7 +260,7 @@
int status;
char *fmt;
- v = SMB_MALLOC(databuf.dsize + 1 - TIMEOUT_LEN);
+ v = (char *)SMB_MALLOC(databuf.dsize + 1 - TIMEOUT_LEN);
if (!v) {
return False;
}
@@ -372,7 +372,7 @@
SAFE_FREE(databuf.dptr);
- valstr = SMB_MALLOC(databuf.dsize + 1 - TIMEOUT_LEN);
+ valstr = (char *)SMB_MALLOC(databuf.dsize + 1 - TIMEOUT_LEN);
if (!valstr) {
SAFE_FREE(entry);
SAFE_FREE(keystr);
Modified: branches/SAMBA_3_0/source/lib/interface.c
===================================================================
--- branches/SAMBA_3_0/source/lib/interface.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/interface.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -187,7 +187,7 @@
total_probed = get_interfaces(ifaces, MAX_INTERFACES);
if (total_probed > 0) {
- probed_ifaces = memdup(ifaces, sizeof(ifaces[0])*total_probed);
+ probed_ifaces = (struct iface_struct *)memdup(ifaces, sizeof(ifaces[0])*total_probed);
if (!probed_ifaces) {
DEBUG(0,("ERROR: memdup failed\n"));
exit(1);
Modified: branches/SAMBA_3_0/source/lib/ldap_escape.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldap_escape.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/ldap_escape.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -36,7 +36,7 @@
char *escape_ldap_string_alloc(const char *s)
{
size_t len = strlen(s)+1;
- char *output = SMB_MALLOC(len);
+ char *output = (char *)SMB_MALLOC(len);
const char *sub;
int i = 0;
char *p = output;
@@ -68,7 +68,7 @@
if (sub) {
len = len + 3;
- output = SMB_REALLOC(output, len);
+ output = (char *)SMB_REALLOC(output, len);
if (!output) {
return NULL;
}
Modified: branches/SAMBA_3_0/source/lib/privileges.c
===================================================================
--- branches/SAMBA_3_0/source/lib/privileges.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/privileges.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -473,7 +473,7 @@
static int priv_traverse_fn(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void *state)
{
- PRIV_SID_LIST *priv = state;
+ PRIV_SID_LIST *priv = (PRIV_SID_LIST *)state;
int prefixlen = strlen(PRIVPREFIX);
DOM_SID sid;
fstring sid_string;
Modified: branches/SAMBA_3_0/source/lib/smbldap.c
===================================================================
--- branches/SAMBA_3_0/source/lib/smbldap.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/smbldap.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -841,7 +841,8 @@
ber_tag_t request,
ber_int_t msgid, void *arg)
{
- struct smbldap_state *ldap_state = arg;
+ struct smbldap_state *ldap_state =
+ (struct smbldap_state *)arg;
int rc;
int version;
@@ -1289,7 +1290,7 @@
/* construct cookie */
if (*cookie != NULL) {
ber_printf(cookie_be, "{iO}", (ber_int_t) pagesize, *cookie);
- ber_bvfree(*cookie); /* don't need it from last time */
+ ber_bvfree((struct berval *)*cookie); /* don't need it from last time */
*cookie = NULL;
} else {
ber_printf(cookie_be, "{io}", (ber_int_t) pagesize, "", 0);
Modified: branches/SAMBA_3_0/source/lib/sysacls.c
===================================================================
--- branches/SAMBA_3_0/source/lib/sysacls.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/sysacls.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -141,7 +141,7 @@
*/
len = 0;
maxlen = 20 * acl_d->count;
- if ((text = SMB_MALLOC(maxlen)) == NULL) {
+ if ((text = (char *)SMB_MALLOC(maxlen)) == NULL) {
errno = ENOMEM;
return NULL;
}
@@ -212,7 +212,7 @@
*/
if ((len + nbytes) > maxlen) {
maxlen += nbytes + 20 * (acl_d->count - i);
- if ((text = SMB_REALLOC(text, maxlen)) == NULL) {
+ if ((text = (char *)SMB_REALLOC(text, maxlen)) == NULL) {
errno = ENOMEM;
return NULL;
}
@@ -243,8 +243,9 @@
* acl[] array, this actually allocates an ACL with room
* for (count+1) entries
*/
- if ((a = SMB_MALLOC(sizeof(struct smb_acl_t) +
- count * sizeof(struct smb_acl_entry))) == NULL) {
+ if ((a = (struct smb_acl_t *)SMB_MALLOC(
+ sizeof(struct smb_acl_t) +
+ count * sizeof(struct smb_acl_entry))) == NULL) {
errno = ENOMEM;
return NULL;
}
Modified: branches/SAMBA_3_0/source/lib/util_pw.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util_pw.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/util_pw.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -74,7 +74,7 @@
if ((pwnam_cache[i] != NULL) &&
(strcmp(name, pwnam_cache[i]->pw_name) == 0)) {
DEBUG(10, ("Got %s from pwnam_cache\n", name));
- return talloc_reference(mem_ctx, pwnam_cache[i]);
+ return (struct passwd *)talloc_reference(mem_ctx, pwnam_cache[i]);
}
}
@@ -103,7 +103,7 @@
pwnam_cache[i] = tcopy_passwd(pwnam_cache, temp);
if (pwnam_cache[i]!= NULL && mem_ctx != NULL) {
- return talloc_reference(mem_ctx, pwnam_cache[i]);
+ return (struct passwd *)talloc_reference(mem_ctx, pwnam_cache[i]);
}
return tcopy_passwd(NULL, pwnam_cache[i]);
Modified: branches/SAMBA_3_0/source/lib/xfile.c
===================================================================
--- branches/SAMBA_3_0/source/lib/xfile.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/lib/xfile.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -80,7 +80,7 @@
{
if (f->buf) return 1;
if (f->bufsize == 0) return 0;
- f->buf = SMB_MALLOC(f->bufsize);
+ f->buf = (char *)SMB_MALLOC(f->bufsize);
if (!f->buf) return 0;
f->next = f->buf;
return 1;
Modified: branches/SAMBA_3_0/source/popt/findme.c
===================================================================
--- branches/SAMBA_3_0/source/popt/findme.c 2006-07-31 03:53:39 UTC (rev 17333)
+++ branches/SAMBA_3_0/source/popt/findme.c 2006-07-31 04:30:55 UTC (rev 17334)
@@ -22,8 +22,8 @@
if (path == NULL) return NULL;
- start = pathbuf = alloca(strlen(path) + 1);
- buf = malloc(strlen(path) + strlen(argv0) + sizeof("/"));
+ start = pathbuf = (char *)alloca(strlen(path) + 1);
+ buf = (char *)malloc(strlen(path) + strlen(argv0) + sizeof("/"));
if (buf == NULL) return NULL; /* XXX can't happen */
strcpy(pathbuf, path);
More information about the samba-cvs
mailing list