summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-14 07:55:43 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-14 07:55:43 +0000
commit565fd2da7613475e6f083e6257cf61a9089f72fc (patch)
tree08ca55998743cf6e0e985f746ff82f855df2d88b /source4/build/pidl
parente8a3825ebc4dfe55581b980507384153b99f534d (diff)
downloadsamba-565fd2da7613475e6f083e6257cf61a9089f72fc.tar.gz
samba-565fd2da7613475e6f083e6257cf61a9089f72fc.tar.bz2
samba-565fd2da7613475e6f083e6257cf61a9089f72fc.zip
fixed another problem with pointers to arrays in structures
(This used to be commit cf880a83121421403db43ef87e95a5326e9c9cb8)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/parser.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index 6c09c3a924..82204e28d6 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -76,10 +76,12 @@ sub struct_alignment($)
#####################################################################
# parse an array - push side
-sub ParseArrayPush($$)
+sub ParseArrayPush($$$)
{
my $e = shift;
my $var_prefix = shift;
+ my $ndr_flags = shift;
+
my $size = find_size_var($e, util::array_size($e));
if (defined $e->{CONFORMANT_SIZE}) {
@@ -113,10 +115,12 @@ sub ParseArrayPrint($$)
#####################################################################
# parse an array - pull side
-sub ParseArrayPull($$)
+sub ParseArrayPull($$$)
{
my $e = shift;
my $var_prefix = shift;
+ my $ndr_flags = shift;
+
my $size = find_size_var($e, util::array_size($e));
my $alloc_size = $size;
@@ -150,7 +154,7 @@ sub ParseArrayPull($$)
if (util::is_scalar_type($e->{TYPE})) {
$res .= "\t\tNDR_CHECK(ndr_pull_array_$e->{TYPE}(ndr, $var_prefix$e->{NAME}, $size));\n";
} else {
- $res .= "\t\tNDR_CHECK(ndr_pull_array(ndr, ndr_flags, (void **)$var_prefix$e->{NAME}, sizeof($var_prefix$e->{NAME}\[0]), $size, (ndr_pull_flags_fn_t)ndr_pull_$e->{TYPE}));\n";
+ $res .= "\t\tNDR_CHECK(ndr_pull_array(ndr, $ndr_flags, (void **)$var_prefix$e->{NAME}, sizeof($var_prefix$e->{NAME}\[0]), $size, (ndr_pull_flags_fn_t)ndr_pull_$e->{TYPE}));\n";
}
}
@@ -296,7 +300,7 @@ sub ParseElementPushBuffer($$$)
}
if (util::array_size($e)) {
- ParseArrayPush($e, "r->");
+ ParseArrayPush($e, "r->", "NDR_SCALARS|NDR_BUFFERS");
} elsif (my $switch = util::has_property($e, "switch_is")) {
if ($e->{POINTERS}) {
ParseElementPushSwitch($e, $var_prefix, "NDR_BUFFERS|NDR_SCALARS", $switch);
@@ -362,7 +366,7 @@ sub ParseElementPullBuffer($$$)
}
if (util::array_size($e)) {
- ParseArrayPull($e, "r->");
+ ParseArrayPull($e, "r->", "NDR_SCALARS|NDR_BUFFERS");
} elsif (my $switch = util::has_property($e, "switch_is")) {
if ($e->{POINTERS}) {
ParseElementPullSwitch($e, $var_prefix, "NDR_SCALARS|NDR_BUFFERS", $switch);
@@ -771,7 +775,7 @@ sub ParseFunctionPush($)
if (!util::is_scalar_type($e->{TYPE})) {
$res .= "\t\tint ndr_flags = NDR_SCALARS|NDR_BUFFERS;\n";
}
- ParseArrayPush($e, "r->in.");
+ ParseArrayPush($e, "r->in.", "ndr_flags");
$res .= "\t}\n";
} else {
ParseElementPushScalar($e, "r->in.", "NDR_SCALARS|NDR_BUFFERS");
@@ -809,7 +813,7 @@ sub ParseFunctionPull($)
if (!util::is_scalar_type($e->{TYPE})) {
$res .= "\t\tint ndr_flags = NDR_SCALARS|NDR_BUFFERS;\n";
}
- ParseArrayPull($e, "r->out.");
+ ParseArrayPull($e, "r->out.", "ndr_flags");
$res .= "\t}\n";
} else {
ParseElementPullScalar($e, "r->out.", "NDR_SCALARS|NDR_BUFFERS");