summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-08-12 05:15:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:54 -0500
commite2357c67f5afbfeacafab6997b57ea262cd3c05a (patch)
treef003a9ce63846a5ce8340b366df502d8bf49c381 /source4/build/pidl
parentfa8d37adae70a5f479262b722e47aa7fc21aaf5c (diff)
downloadsamba-e2357c67f5afbfeacafab6997b57ea262cd3c05a.tar.gz
samba-e2357c67f5afbfeacafab6997b57ea262cd3c05a.tar.bz2
samba-e2357c67f5afbfeacafab6997b57ea262cd3c05a.zip
r1757: much simpler (and smaller, faster etc) way of doing relative pointers
in pidl. This mechanism should be much easier to extend to the "retrospective subcontexts" that jelmer needs. also produced more standards complient full-pointer offsets. This keeps ethereal happy with decoding our epmapper frames. (This used to be commit ecb7378bbcd86727aedfa04a9e302e06b0a2ccd9)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/parser.pm13
1 files changed, 5 insertions, 8 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index 51d561d4b2..5b85337212 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -364,7 +364,7 @@ sub ParseElementPushScalar($$$)
}
if (util::has_property($e, "relative")) {
- pidl "\tNDR_CHECK(ndr_push_relative(ndr, NDR_SCALARS, $var_prefix$e->{NAME}));\n";
+ pidl "\tNDR_CHECK(ndr_push_relative1(ndr, $var_prefix$e->{NAME}));\n";
} elsif (util::is_inline_array($e)) {
ParseArrayPush($e, "r->", "NDR_SCALARS");
} elsif (util::need_wire_pointer($e)) {
@@ -521,11 +521,9 @@ sub ParseElementPullScalar($$$)
} elsif (util::need_wire_pointer($e)) {
pidl "\tNDR_CHECK(ndr_pull_ptr(ndr, &_ptr_$e->{NAME}));\n";
pidl "\tif (_ptr_$e->{NAME}) {\n";
+ pidl "\t\tNDR_ALLOC(ndr, $var_prefix$e->{NAME});\n";
if (util::has_property($e, "relative")) {
- # NOTE: this assumes a pointer can hold a uint32. Not legal C
- pidl "\t\t$var_prefix$e->{NAME} = (void *)_ptr_$e->{NAME};\n";
- } else {
- pidl "\t\tNDR_ALLOC(ndr, $var_prefix$e->{NAME});\n";
+ pidl "\t\tNDR_CHECK(ndr_pull_relative1(ndr, $var_prefix$e->{NAME}, _ptr_$e->{NAME}));";
}
pidl "\t} else {\n";
pidl "\t\t$var_prefix$e->{NAME} = NULL;\n";
@@ -568,7 +566,7 @@ sub ParseElementPushBuffer($$$)
if (util::need_wire_pointer($e)) {
pidl "\tif ($var_prefix$e->{NAME}) {\n";
if (util::has_property($e, "relative")) {
- pidl "\t\tNDR_CHECK(ndr_push_relative(ndr, NDR_BUFFERS, $var_prefix$e->{NAME}));\n";
+ pidl "\t\tNDR_CHECK(ndr_push_relative2(ndr, $var_prefix$e->{NAME}));\n";
}
}
@@ -652,8 +650,7 @@ sub ParseElementPullBuffer($$$)
if (util::has_property($e, "relative")) {
pidl "\t\tstruct ndr_pull_save _relative_save;\n";
pidl "\t\tndr_pull_save(ndr, &_relative_save);\n";
- pidl "\t\tNDR_CHECK(ndr_pull_set_offset(ndr, (uint32_t)$var_prefix$e->{NAME}));\n";
- pidl "\t\tNDR_ALLOC(ndr, $var_prefix$e->{NAME});\n";
+ pidl "\t\tNDR_CHECK(ndr_pull_relative2(ndr, $var_prefix$e->{NAME}));\n";
}
}