diff options
author | Tim Potter <tpot@samba.org> | 2001-12-09 08:07:20 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-12-09 08:07:20 +0000 |
commit | 7fd9b2ae1c915789359dc44186a20d09a10c69ef (patch) | |
tree | 65ec929cb2fbeb4edca08c8ba39fa08c35f5058c | |
parent | 3c3fb798fd916a2f03d313c260720f9e0d59595a (diff) | |
download | samba-7fd9b2ae1c915789359dc44186a20d09a10c69ef.tar.gz samba-7fd9b2ae1c915789359dc44186a20d09a10c69ef.tar.bz2 samba-7fd9b2ae1c915789359dc44186a20d09a10c69ef.zip |
Misc fixes:
- pass correct args when doing arrays of scalar vs buffer types
- add NULL data argument to all calls
- get rid of unecessary curly brackets
- typos
(This used to be commit 42a688ea1c012626e247820dec927456e3de9b79)
-rw-r--r-- | source4/build/pidl/eparser.pm | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm index 7bcef92da6..f2129dc59a 100644 --- a/source4/build/pidl/eparser.pm +++ b/source4/build/pidl/eparser.pm @@ -68,7 +68,7 @@ sub ParseArray($) $res .= "\tfor (i = 0; i < count; i++) {\n"; if (is_scalar_type($elt)) { - $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, \"$elt->{NAME});\n"; + $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, NULL, \"$elt->{NAME});\n"; $res .= "\t}\n\n"; } else { $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, \"PARSE_SCALARS\", \"$elt->{NAME}\");\n"; @@ -107,7 +107,7 @@ sub ParseElement($$) # Simple type are scalars too if (is_scalar_type($elt->{TYPE})) { - $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, \"$elt->{NAME}}\");\n\n"; + $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, NULL, \"$elt->{NAME}\");\n\n"; } } @@ -122,17 +122,19 @@ sub ParseElement($$) # If we have a pointer, check it if ($elt->{POINTERS}) { - $res .= "\t\tif (ptr_$elt->{NAME}) {\n\t"; + $res .= "\t\tif (ptr_$elt->{NAME})\n\t"; } if (has_property($elt->{PROPERTIES}, "size_is")) { ParseArray($elt); } else { - $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, flags, \"$elt->{NAME}\");\n\n"; - } - - if ($elt->{POINTERS}) { - $res .= "\t\t}\n\n"; + $res .= "\t\toffset = prs_$elt->{TYPE}(tvb, offset, pinfo, tree, "; + if (is_scalar_type($elt->{TYPE})) { + $res .= "NULL, "; + } else { + $res .= "flags, "; + } + $res .= "\"$elt->{NAME}\");\n\n"; } } } @@ -221,7 +223,7 @@ sub ParseTypedef($) my($typedef) = shift; $res .= "static int prs_$typedef->{NAME}(tvbuff_t *tvb, int offset,\ -\tpacket_info *pinfo, proto_tree *tree)\n{\n"; +\tpacket_info *pinfo, proto_tree *tree, int flags, char *name)\n{\n"; ParseType($typedef->{DATA}); $res .= "}\n\n"; } |