summaryrefslogtreecommitdiff
path: root/pidl/lib
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2008-12-30 13:47:58 -0800
committerTim Prouty <tprouty@samba.org>2008-12-30 16:19:43 -0800
commit2337f402f0f2fd6c1fa077b1b35347905a38c715 (patch)
tree24b1dfa12caebd67fcc5c08ab363e47d6bc150dd /pidl/lib
parent0cb430c22e9c0af2248fbc15ce97a4d760df189d (diff)
downloadsamba-2337f402f0f2fd6c1fa077b1b35347905a38c715.tar.gz
samba-2337f402f0f2fd6c1fa077b1b35347905a38c715.tar.bz2
samba-2337f402f0f2fd6c1fa077b1b35347905a38c715.zip
pidl: Fix a const build warning in the samba3 merged build
The warning: ../librpc/gen_ndr/ndr_spoolss.c: In function ‘ndr_pull_spoolss_EnumPrinterData’: ../librpc/gen_ndr/ndr_spoolss.c:14792: warning: passing argument 1 of ‘memset’ discards qualifiers from pointer target type In some case the pidl generated code needs to memset a const struct field. This causes the above warning. This patch discardeds the const in this case. I'm open to a more elegant fix, but this eliminates the warning and should be relatively safe.
Diffstat (limited to 'pidl/lib')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index ee81e51f25..5c9123a2a8 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -2165,7 +2165,7 @@ sub ParseFunctionPull($$)
if (grep(/in/, @{$e->{DIRECTION}})) {
$self->pidl("memcpy(r->out.$e->{NAME}, r->in.$e->{NAME}, ($size) * sizeof(*r->in.$e->{NAME}));");
} else {
- $self->pidl("memset(r->out.$e->{NAME}, 0, ($size) * sizeof(*r->out.$e->{NAME}));");
+ $self->pidl("memset(CONST_DISCARD(struct $fn->{NAME} *,r->out.$e->{NAME}), 0, ($size) * sizeof(*r->out.$e->{NAME}));");
}
} else {
$self->pidl("NDR_PULL_ALLOC($ndr, r->out.$e->{NAME});");