summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-04-02 20:57:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:23 -0500
commit3b8c824c16a7649057c87fd33ac17d496976bdfb (patch)
tree6584c2f3c4f98c5c2107228df9e6b5f44b10471b /source4/build/pidl
parent3abce73193dcc393fee5ca6e326678009e87cbd7 (diff)
downloadsamba-3b8c824c16a7649057c87fd33ac17d496976bdfb.tar.gz
samba-3b8c824c16a7649057c87fd33ac17d496976bdfb.tar.bz2
samba-3b8c824c16a7649057c87fd33ac17d496976bdfb.zip
r6180: Use token_lists for storing switch values
(This used to be commit f66e11137eed69b44f0739f1064625cbd96243bd)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/ndr_parser.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/source4/build/pidl/ndr_parser.pm b/source4/build/pidl/ndr_parser.pm
index 0ec24b3526..5bb064c963 100644
--- a/source4/build/pidl/ndr_parser.pm
+++ b/source4/build/pidl/ndr_parser.pm
@@ -670,12 +670,14 @@ sub ParseElementPrint($$)
if (util::array_size($e)) {
ParseArrayPrint($e, $var_prefix)
- } elsif (my $switch = util::has_property($e, "switch_is")) {
- my $switch_var = ParseExpr($e, $switch, $var_prefix);
- check_null_pointer_void($switch_var);
-
- pidl "ndr_print_$e->{TYPE}(ndr, \"$e->{NAME}\", $switch_var, $cprefix$var_prefix$e->{NAME});";
} else {
+ if (my $switch = util::has_property($e, "switch_is")) {
+ my $switch_var = ParseExpr($e, $switch, $var_prefix);
+ check_null_pointer_void($switch_var);
+
+ pidl "ndr_print_set_switch_value(ndr, $cprefix$var_prefix$e->{NAME}, $switch_var);";
+ }
+
pidl "ndr_print_$e->{TYPE}(ndr, \"$e->{NAME}\", $cprefix$var_prefix$e->{NAME});";
}
@@ -1406,6 +1408,8 @@ sub ParseUnionPrint($)
my $have_default = 0;
my($name) = $e->{PARENT}->{NAME};
+ pidl "int level = ndr_print_get_switch_value(ndr, r);";
+
pidl "ndr_print_union(ndr, name, level, \"$name\");";
start_flags($e);
@@ -1535,7 +1539,7 @@ sub ArgsUnionPush($)
sub ArgsUnionPrint($)
{
my $e = shift;
- return "struct ndr_print *ndr, const char *name, int level, union $e->{NAME} *r";
+ return "struct ndr_print *ndr, const char *name, union $e->{NAME} *r";
}
sub ArgsUnionPull($)