diff options
author | Michael Mann <mmann78@netscape.net> | 2017-04-18 15:55:26 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-04-18 23:06:41 +0000 |
commit | 243da1fb3c856e4d3973ecec200a85b9e502ea1c (patch) | |
tree | a869db571df1c5f1fc27092133e55e306aa87d04 /tools | |
parent | 913f9fb35335acd30aa231b00b23fd8f0dc379fb (diff) |
X11: Replace UNUSED macro
Change-Id: Ieed2c672fd2acb76dba0ef1c3182eb9f00a04253
Reviewed-on: https://code.wireshark.org/review/21205
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/process-x11-xcb.pl | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/tools/process-x11-xcb.pl b/tools/process-x11-xcb.pl index 80342fb4a8..757050dca9 100755 --- a/tools/process-x11-xcb.pl +++ b/tools/process-x11-xcb.pl @@ -375,7 +375,8 @@ eot print $impl " *offsetp += 1;\n"; $length += 1; } - print $impl " UNUSED(2);\n"; + print $impl " proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, 2, ENC_NA);\n"; + print $impl " *offsetp += 2;\n"; $length += 2; foreach my $wholename (('row length', 'skip rows', 'skip pixels', 'alignment')) { # Integer values @@ -431,19 +432,23 @@ eot say $impl " switch($variable_param) {"; say $impl " case 0x1400: /* BYTE */"; say $impl " listOfByte(tvb, offsetp, t, ${regname}_signed, $count, byte_order);"; - say $impl " UNUSED(length - $length - $count);"; + say $impl " proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, (length - $length - $count), ENC_NA);"; + say $impl " *offsetp += (length - $length - $count);"; say $impl " break;"; say $impl " case 0x1401: /* UNSIGNED_BYTE */"; say $impl " listOfByte(tvb, offsetp, t, ${regname}_unsigned, $count, byte_order);"; - say $impl " UNUSED(length - $length - $count);"; + say $impl " proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, (length - $length - $count), ENC_NA);"; + say $impl " *offsetp += (length - $length - $count);"; say $impl " break;"; say $impl " case 0x1402: /* SHORT */"; say $impl " listOfInt16(tvb, offsetp, t, $regname, ${regname}_item_int16, $count, byte_order);"; - say $impl " UNUSED(length - $length - 2 * $count);"; + say $impl " proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, (length - $length - 2 * $count), ENC_NA);"; + say $impl " *offsetp += (length - $length - 2 * $count);"; say $impl " break;"; say $impl " case 0x1403: /* UNSIGNED_SHORT */"; say $impl " listOfCard16(tvb, offsetp, t, $regname, ${regname}_item_card16, $count, byte_order);"; - say $impl " UNUSED(length - $length - 2 * $count);"; + say $impl " proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, (length - $length - 2 * $count), ENC_NA);"; + say $impl " *offsetp += (length - $length - 2 * $count);"; say $impl " break;"; say $impl " case 0x1404: /* INT */"; say $impl " listOfInt32(tvb, offsetp, t, $regname, ${regname}_item_int32, $count, byte_order);"; @@ -456,18 +461,21 @@ eot say $impl " break;"; say $impl " case 0x1407: /* 2_BYTES */"; say $impl " listOfCard16(tvb, offsetp, t, $regname, ${regname}_item_card16, $count, ENC_BIG_ENDIAN);"; - say $impl " UNUSED(length - $length - 2 * $count);"; + say $impl " proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, (length - $length - 2 * $count), ENC_NA);"; + say $impl " *offsetp += (length - $length - 2 * $count);"; say $impl " break;"; say $impl " case 0x1408: /* 3_BYTES */"; say $impl " UNDECODED(3 * $count);"; - say $impl " UNUSED(length - $length - 3 * $count);"; + say $impl " proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, (length - $length - 3 * $count), ENC_NA);"; + say $impl " *offsetp += (length - $length - 3 * $count);"; say $impl " break;"; say $impl " case 0x1409: /* 4_BYTES */"; say $impl " listOfCard32(tvb, offsetp, t, $regname, ${regname}_item_card32, $count, ENC_BIG_ENDIAN);"; say $impl " break;"; say $impl " case 0x140B: /* HALF_FLOAT */"; say $impl " UNDECODED(2 * $count);"; - say $impl " UNUSED(length - $length - 2 * $count);"; + say $impl " proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, (length - $length - 2 * $count), ENC_NA);"; + say $impl " *offsetp += (length - $length - 2 * $count);"; say $impl " break;"; say $impl " default: /* Unknown */"; say $impl " UNDECODED(length - $length);"; @@ -760,11 +768,13 @@ sub dissect_element($$$$$;$$) my $bytes = $e->att('bytes'); my $align = $e->att('align'); if (defined $bytes) { - print $impl $indent."UNUSED($bytes);\n"; + print $impl $indent."proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, $bytes, ENC_NA);\n"; + print $impl $indent."*offsetp += $bytes;\n"; $length += $bytes; } else { say $impl $indent.'if (*offsetp % '.$align.') {'; - say $impl $indent." UNUSED($align - *offsetp % $align);"; + say $impl $indent." proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, ($align - *offsetp % $align), ENC_NA);"; + say $impl $indent." *offsetp += ($align - *offsetp % $align);"; say $impl $indent."}"; if ($length % $align != 0) { $length += $align - $length % $align; |