diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-10-05 17:13:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:39:25 -0500 |
commit | 4bbb584ff0dcc172bbaeeff9e8f6dff6d2b94e66 (patch) | |
tree | 369076db6e767b0602d935d8f0869e59ce0d5f36 /source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm | |
parent | 5df3b426ee691adaaaa65424aa2cee22dcc10607 (diff) | |
download | samba-4bbb584ff0dcc172bbaeeff9e8f6dff6d2b94e66.tar.gz samba-4bbb584ff0dcc172bbaeeff9e8f6dff6d2b94e66.tar.bz2 samba-4bbb584ff0dcc172bbaeeff9e8f6dff6d2b94e66.zip |
r10734: Generate ptr, size, offset, and length elements in unions just once.
(This used to be commit 12bfa5d01bcb4cb9dad5167e1a3721fd68f06275)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm index 49c7cf5e81..d1188e7011 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm @@ -75,6 +75,7 @@ sub ParseElementLevelArray($$$$$$) if ($l->{IS_ZERO_TERMINATED}) { fatal($e, "[string] attribute not supported for Samba3 yet"); + #FIXME } @@ -123,12 +124,6 @@ sub ParseElementLevelSwitch($$$$$$) { my ($e,$l,$nl,$env,$varname,$what) = @_; - if ($what == PRIMITIVES) { - pidl "if (!prs_uint32(\"level\", ps, depth, &" . ParseExpr("level_$e->{NAME}", $env) . "))"; - pidl "\treturn False;"; - pidl ""; - } - ParseElementLevel($e,$nl,$env,$varname,$what); } @@ -353,6 +348,14 @@ sub ParseUnion($$$) pidl "\treturn False;"; pidl ""; + if (has_property($u, "nodiscriminant")) { + pidl "if (!prs_uint32(\"switch_value\", ps, depth, &v->switch_value))"; + pidl "\treturn False;"; + pidl ""; + } + + # Maybe check here that level and v->switch_value are equal? + pidl "switch (level) {"; indent; |