diff options
author | Tim Prouty <tprouty@samba.org> | 2009-02-07 00:43:16 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-02-07 00:47:32 -0800 |
commit | 7168cf440ecacb3c49c1026320347632b629668d (patch) | |
tree | 1d7b7deb339ac540071ddfede0595d74de4978d7 /pidl/lib/Parse/Pidl/Samba3 | |
parent | 04c971dc6c5b1f4a621b1a28bdfbb396bc6d1a9e (diff) | |
download | samba-7168cf440ecacb3c49c1026320347632b629668d.tar.gz samba-7168cf440ecacb3c49c1026320347632b629668d.tar.bz2 samba-7168cf440ecacb3c49c1026320347632b629668d.zip |
pidl: Fix a const build warning in the samba3 merged build
../librpc/gen_ndr/cli_spoolss.c: In function `rpccli_spoolss_EnumPrinterData':
../librpc/gen_ndr/cli_spoolss.c:3400: warning: passing arg 1 of `memcpy' discards qualifiers from pointer target type
This is a very similar fix to:
2337f402f0f2fd6c1fa077b1b35347905a38c715
Diffstat (limited to 'pidl/lib/Parse/Pidl/Samba3')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm index 1a0eb51438..ed1b71a236 100644 --- a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm +++ b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm @@ -97,7 +97,11 @@ sub ParseOutputArgument($$$) # to allocate a structure of the right size. my $env = GenerateFunctionInEnv($fn, "r."); my $size_is = ParseExpr($e->{LEVELS}[$level]->{SIZE_IS}, $env, $e->{ORIGINAL}); - $self->pidl("memcpy($e->{NAME}, r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));"); + if (has_property($e, "charset")) { + $self->pidl("memcpy(CONST_DISCARD(char *, $e->{NAME}), r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));"); + } else { + $self->pidl("memcpy($e->{NAME}, r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));"); + } } else { $self->pidl("*$e->{NAME} = *r.out.$e->{NAME};"); } |