From 7fd9b2ae1c915789359dc44186a20d09a10c69ef Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 9 Dec 2001 08:07:20 +0000 Subject: 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) --- source4/build/pidl/eparser.pm | 20 +++++++++++--------- 1 file 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"; } -- cgit