summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-11-06 11:02:51 -0800
committerGuy Harris <guy@alum.mit.edu>2016-11-06 19:03:21 +0000
commit5ae9af9e50c89d8700e5a166a9c345fc46b3a4ca (patch)
treea6d52d04f6f9ce8987aa6231726dc574d9c688f1 /tools
parenta5a179dd4975b00fbb65c86f8f573d1a73b7ef58 (diff)
downloadwireshark-5ae9af9e50c89d8700e5a166a9c345fc46b3a4ca.tar.gz
Get rid of Boolean "flags" that don't have any bit set.
And tweak the Pidl generator for Wireshark not to generate "flags" like that. (The generator also does field name and true/false strings' case differently, so I didn't use it to regenerate the dissectors; that needs to be looked at.) Change-Id: Ie1657a782ebdb107e58792cedd29bbaa79b17bd4 Reviewed-on: https://code.wireshark.org/review/18695 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tools')
-rw-r--r--tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm29
1 files changed, 17 insertions, 12 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index 9c2983fc6b..2b2683f2fa 100644
--- a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -226,8 +226,10 @@ sub Bitmap($$$$)
my $hf_bitname = "hf_$ifname\_$name\_$1";
$ev =~ s/[()\s]//g;
- $total_ev += hex($ev);
- $self->pidl_code("&$hf_bitname,");
+ if (hex($ev) != 0) {
+ $total_ev += hex($ev);
+ $self->pidl_code("&$hf_bitname,");
+ }
}
$self->pidl_code("NULL");
$self->deindent;
@@ -267,18 +269,21 @@ sub Bitmap($$$$)
$self->{hf_used}->{$hf_bitname} = 1;
- $self->register_hf_field($hf_bitname, field2name($en), $filtername, "FT_BOOLEAN", $e->{ALIGN} * 8, "TFS(&$name\_$en\_tfs)", $ev, "");
+ $ev =~ s/[()\s]//g;
+ if (hex($ev) != 0) {
+ $self->register_hf_field($hf_bitname, field2name($en), $filtername, "FT_BOOLEAN", $e->{ALIGN} * 8, "TFS(&$name\_$en\_tfs)", "( $ev )", "");
- $self->pidl_def("static const true_false_string $name\_$en\_tfs = {");
- if (defined($self->{conformance}->{tfs}->{$hf_bitname})) {
- $self->pidl_def(" $self->{conformance}->{tfs}->{$hf_bitname}->{TRUE_STRING},");
- $self->pidl_def(" $self->{conformance}->{tfs}->{$hf_bitname}->{FALSE_STRING},");
- $self->{conformance}->{tfs}->{$hf_bitname}->{USED} = 1;
- } else {
- $self->pidl_def(" \"$en is SET\",");
- $self->pidl_def(" \"$en is NOT SET\",");
+ $self->pidl_def("static const true_false_string $name\_$en\_tfs = {");
+ if (defined($self->{conformance}->{tfs}->{$hf_bitname})) {
+ $self->pidl_def(" $self->{conformance}->{tfs}->{$hf_bitname}->{TRUE_STRING},");
+ $self->pidl_def(" $self->{conformance}->{tfs}->{$hf_bitname}->{FALSE_STRING},");
+ $self->{conformance}->{tfs}->{$hf_bitname}->{USED} = 1;
+ } else {
+ $self->pidl_def(" \"$en is SET\",");
+ $self->pidl_def(" \"$en is NOT SET\",");
+ }
+ $self->pidl_def("};");
}
- $self->pidl_def("};");
}
if ($element_count > 0) {