diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-09-07 15:08:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:05:27 -0500 |
commit | cd962355abad90a2161765a7be7d26e63572cab7 (patch) | |
tree | 21a1e180cfa6396c491301e3e171d8105208bb44 /source4/librpc | |
parent | 6c79213eb80283bb211d2e2161c25337c0a549b7 (diff) | |
download | samba-cd962355abad90a2161765a7be7d26e63572cab7.tar.gz samba-cd962355abad90a2161765a7be7d26e63572cab7.tar.bz2 samba-cd962355abad90a2161765a7be7d26e63572cab7.zip |
r25000: Fix some more C++ compatibility warnings.
(This used to be commit 08bb1ef643ab906f1645cf6f32763dc73b1884e4)
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/ndr/libndr.h | 2 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr.c | 15 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_string.c | 4 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc.c | 2 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_sock.c | 2 |
5 files changed, 14 insertions, 11 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 09a2680190..522031b8e4 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -269,7 +269,7 @@ enum ndr_compression_alg { #define NDR_PUSH_ALLOC_SIZE(ndr, s, size) do { \ - (s) = talloc_size(ndr, size); \ + (s) = talloc_array(ndr, uint8_t, size); \ if (!(s)) return ndr_push_error(ndr, NDR_ERR_ALLOC, "push alloc %u failed: %s\n", (unsigned)size, __location__); \ } while (0) diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index 9fb39beff3..a9e42f1eb6 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -200,13 +200,16 @@ _PUBLIC_ void ndr_print_string_helper(struct ndr_print *ndr, const char *format, int i; for (i=0;i<ndr->depth;i++) { - ndr->private_data = talloc_asprintf_append(ndr->private_data, " "); + ndr->private_data = talloc_asprintf_append( + (char *)ndr->private_data, " "); } va_start(ap, format); - ndr->private_data = talloc_vasprintf_append(ndr->private_data, format, ap); + ndr->private_data = talloc_vasprintf_append((char *)ndr->private_data, + format, ap); va_end(ap); - ndr->private_data = talloc_asprintf_append(ndr->private_data, "\n"); + ndr->private_data = talloc_asprintf_append((char *)ndr->private_data, + "\n"); } /* @@ -276,7 +279,7 @@ _PUBLIC_ char *ndr_print_struct_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, c ndr->depth = 1; ndr->flags = 0; fn(ndr, name, ptr); - ret = talloc_steal(mem_ctx, ndr->private_data); + ret = talloc_steal(mem_ctx, (char *)ndr->private_data); failed: talloc_free(ndr); return ret; @@ -301,7 +304,7 @@ _PUBLIC_ char *ndr_print_union_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, co ndr->flags = 0; ndr_print_set_switch_value(ndr, ptr, level); fn(ndr, name, ptr); - ret = talloc_steal(mem_ctx, ndr->private_data); + ret = talloc_steal(mem_ctx, (char *)ndr->private_data); failed: talloc_free(ndr); return ret; @@ -327,7 +330,7 @@ _PUBLIC_ char *ndr_print_function_string(TALLOC_CTX *mem_ctx, ndr->depth = 1; ndr->flags = 0; fn(ndr, name, flags, ptr); - ret = talloc_steal(mem_ctx, ndr->private_data); + ret = talloc_steal(mem_ctx, (char *)ndr->private_data); failed: talloc_free(ndr); return ret; diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c index fca864a5eb..b611f87a41 100644 --- a/source4/librpc/ndr/ndr_string.c +++ b/source4/librpc/ndr/ndr_string.c @@ -640,7 +640,7 @@ _PUBLIC_ uint32_t ndr_string_length(const void *_var, uint32_t element_size) { uint32_t i; uint8_t zero[4] = {0,0,0,0}; - const char *var = _var; + const char *var = (const char *)_var; for (i = 0; memcmp(var+i*element_size,zero,element_size) != 0; i++); @@ -731,5 +731,5 @@ _PUBLIC_ uint32_t ndr_charset_length(const void *var, charset_t chset) { /* FIXME: Treat special chars special here, taking chset into account */ /* Also include 0 byte */ - return strlen(var)+1; + return strlen((const char *)var)+1; } diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index 160b9772f4..56e603645c 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -959,7 +959,7 @@ static struct rpc_request *dcerpc_request_send(struct dcerpc_pipe *p, req->recv_handler = NULL; if (object != NULL) { - req->object = talloc_memdup(req, (void *)object, sizeof(*object)); + req->object = (struct GUID *)talloc_memdup(req, (void *)object, sizeof(*object)); if (req->object == NULL) { talloc_free(req); return NULL; diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c index 974cbd2692..a28b21b5c3 100644 --- a/source4/librpc/rpc/dcerpc_sock.c +++ b/source4/librpc/rpc/dcerpc_sock.c @@ -193,7 +193,7 @@ static NTSTATUS sock_send_request(struct dcerpc_connection *p, DATA_BLOB *data, */ static NTSTATUS sock_shutdown_pipe(struct dcerpc_connection *p, NTSTATUS status) { - struct sock_private *sock = p->transport.private_data; + struct sock_private *sock = (struct sock_private *)p->transport.private_data; if (sock && sock->sock) { sock_dead(p, status); |