summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-23 07:14:17 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-23 07:14:17 +0000
commit1b9452ffc5d21bcc621806273a1ab0366843451f (patch)
tree49c397ff24a839b19fd52ea3ea46c903038fac52 /source4/build/pidl
parent03eda9064143093d97b055b1c2a4e5110b139426 (diff)
downloadsamba-1b9452ffc5d21bcc621806273a1ab0366843451f.tar.gz
samba-1b9452ffc5d21bcc621806273a1ab0366843451f.tar.bz2
samba-1b9452ffc5d21bcc621806273a1ab0366843451f.zip
fixed the handling of value() attributes on scalars in IDL that
reference other elements of the same structure (This used to be commit d8d17be290730670bad0fea91188d394160cb879)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/parser.pm14
1 files changed, 5 insertions, 9 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index 41976cfdc9..59ff73b8e6 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -334,14 +334,14 @@ sub ParseElementPushScalar($$$)
start_flags($e);
+ if (my $value = util::has_property($e, "value")) {
+ pidl "\t$cprefix$var_prefix$e->{NAME} = $value;\n";
+ }
+
if (util::has_property($e, "relative")) {
pidl "\tNDR_CHECK(ndr_push_relative(ndr, NDR_SCALARS, $var_prefix$e->{NAME}, (ndr_push_const_fn_t) ndr_push_$e->{TYPE}));\n";
} elsif (util::is_inline_array($e)) {
ParseArrayPush($e, "r->", "NDR_SCALARS");
- } elsif (my $value = util::has_property($e, "value")) {
- pidl "\tNDR_CHECK(ndr_push_$e->{TYPE}(ndr, $value));\n";
- } elsif (defined $e->{VALUE}) {
- pidl "\tNDR_CHECK(ndr_push_$e->{TYPE}(ndr, $e->{VALUE}));\n";
} elsif (util::need_wire_pointer($e)) {
pidl "\tNDR_CHECK(ndr_push_ptr(ndr, $var_prefix$e->{NAME}));\n";
} elsif (util::need_alloc($e)) {
@@ -375,9 +375,7 @@ sub ParseElementPrintScalar($$)
return;
}
- if (defined $e->{VALUE}) {
- pidl "\tndr_print_$e->{TYPE}(ndr, \"$e->{NAME}\", $e->{VALUE});\n";
- } elsif (util::has_direct_buffers($e)) {
+ if (util::has_direct_buffers($e)) {
pidl "\tndr_print_ptr(ndr, \"$e->{NAME}\", $var_prefix$e->{NAME});\n";
pidl "\tndr->depth++;\n";
ParseElementPrintBuffer($e, $var_prefix);
@@ -478,8 +476,6 @@ sub ParseElementPullScalar($$$)
if (util::has_property($e, "relative")) {
pidl "\tNDR_CHECK(ndr_pull_relative(ndr, (const void **)&$var_prefix$e->{NAME}, sizeof(*$var_prefix$e->{NAME}), (ndr_pull_flags_fn_t)ndr_pull_$e->{TYPE}));\n";
- } elsif (defined $e->{VALUE}) {
- pidl "\tNDR_CHECK(ndr_pull_$e->{TYPE}(ndr, $e->{VALUE}));\n";
} elsif (util::is_inline_array($e)) {
ParseArrayPull($e, "r->", "NDR_SCALARS");
} elsif (util::need_wire_pointer($e)) {