summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm4
-rwxr-xr-xpidl/tests/samba3-cli.pl2
2 files changed, 3 insertions, 3 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
index 3fc63a4999..b26a08e029 100644
--- a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
+++ b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
@@ -105,9 +105,9 @@ sub ParseOutputArgument($$$;$$)
} else {
my $size_is = ParseExpr($l->{SIZE_IS}, $env, $e->{ORIGINAL});
if (has_property($e, "charset")) {
- $self->pidl("memcpy(CONST_DISCARD(char *, $o$e->{NAME}), ${r}out.$e->{NAME}, $size_is * sizeof(*$o$e->{NAME}));");
+ $self->pidl("memcpy(discard_const_p(uint8_t, $o$e->{NAME}), ${r}out.$e->{NAME}, ($size_is) * sizeof(*$o$e->{NAME}));");
} else {
- $self->pidl("memcpy($o$e->{NAME}, ${r}out.$e->{NAME}, $size_is * sizeof(*$o$e->{NAME}));");
+ $self->pidl("memcpy($o$e->{NAME}, ${r}out.$e->{NAME}, ($size_is) * sizeof(*$o$e->{NAME}));");
}
}
} else {
diff --git a/pidl/tests/samba3-cli.pl b/pidl/tests/samba3-cli.pl
index 1820a69bb3..fcf1fb171b 100755
--- a/pidl/tests/samba3-cli.pl
+++ b/pidl/tests/samba3-cli.pl
@@ -301,4 +301,4 @@ my $e = { NAME => "foo", ORIGINAL => { FILE => "f", LINE => -1 },
LEVELS => [ { TYPE => "ARRAY", SIZE_IS => "mysize" }, { TYPE => "DATA", DATA_TYPE => "int" } ]};
$x->ParseOutputArgument($fn, $e);
-is($x->{res}, "memcpy(foo, r.out.foo, mysize * sizeof(*foo));\n");
+is($x->{res}, "memcpy(foo, r.out.foo, (mysize) * sizeof(*foo));\n");