x11 generator: Fix indent (use always 4 spaces) and add modelines

Change-Id: I91739bb6f4acc4da060cf389ec288ee910965b2a
Reviewed-on: https://code.wireshark.org/review/11113
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexis La Goutte 2015-10-17 15:39:06 +02:00 committed by Michael Mann
parent 99406bafe1
commit 2b8caf31cc
2 changed files with 621 additions and 595 deletions

View File

@ -80,26 +80,26 @@ while(<>) {
$subfield = $1; $subfield = $1;
if (length $subfield != $subfieldStringLength) { if (length $subfield != $subfieldStringLength) {
if (!length $subfield) { if (!length $subfield) {
$prefix = ''; $prefix = '';
} elsif (length $subfield > $subfieldStringLength) { } elsif (length $subfield > $subfieldStringLength) {
$prefix .= "$lastAbbrev."; $prefix .= "$lastAbbrev.";
} else { } else {
$prefix =~ s/^(.*)\.[^\.]+\.$/$1./o; $prefix =~ s/^(.*)\.[^\.]+\.$/$1./o;
} }
$subfieldStringLength = length $subfield; $subfieldStringLength = length $subfield;
} }
@fields = split /\s+/o ; @fields = split /\s+/o ;
if ($fields[0] eq '#') { if ($fields[0] eq '#') {
# #
# If the line begins with "#", treat it as a comment, by # If the line begins with "#", treat it as a comment, by
# ignoring it. # ignoring it.
# #
# (We don't support comments at the end of a line; that would # (We don't support comments at the end of a line; that would
# require some more pain in our simple parser.) # require some more pain in our simple parser.)
# #
next; next;
} }
$abbrev = shift @fields; $abbrev = shift @fields;
$type = shift @fields; $type = shift @fields;
@ -108,47 +108,47 @@ while(<>) {
$field = $prefix.$abbrev; $field = $prefix.$abbrev;
if ($fields[0] =~ /^\d+$/o) { if ($fields[0] =~ /^\d+$/o) {
# #
# This is presumably a Boolean bitfield, and this is the number # This is presumably a Boolean bitfield, and this is the number
# of bits in the parent field. # of bits in the parent field.
# #
$fieldDisplay = shift @fields; $fieldDisplay = shift @fields;
} else { } else {
# #
# The next token is the base for the field. # The next token is the base for the field.
# #
$fieldDisplay = "BASE_".shift @fields; $fieldDisplay = "BASE_".shift @fields;
} }
if ($fields[0] eq 'VALS') { if ($fields[0] eq 'VALS') {
# #
# It's an enumerated field, with the value_string table having a # It's an enumerated field, with the value_string table having a
# name based on the field's name. # name based on the field's name.
# #
shift @fields; shift @fields;
$fieldStrings = "VALS(${abbrev}_vals)"; $fieldStrings = "VALS(${abbrev}_vals)";
$fieldStrings =~ s/-/_/go; $fieldStrings =~ s/-/_/go;
} elsif ($fields[0] =~ /^VALS\(/o) { } elsif ($fields[0] =~ /^VALS\(/o) {
# #
# It's an enumerated field, with a specified name for the # It's an enumerated field, with a specified name for the
# value_string table. # value_string table.
# #
$fieldStrings = shift @fields; $fieldStrings = shift @fields;
$fieldStrings =~ s/\)/_vals\)/o; $fieldStrings =~ s/\)/_vals\)/o;
} else { } else {
# #
# It's not an enumerated field. # It's not an enumerated field.
# #
$fieldStrings = 'NULL'; $fieldStrings = 'NULL';
} }
if ($fields[0] =~ /^0x/) { if ($fields[0] =~ /^0x/) {
# #
# The next token looks like a bitmask for a bitfield. # The next token looks like a bitmask for a bitfield.
# #
$mask = shift @fields; $mask = shift @fields;
} else { } else {
$mask = 0; $mask = 0;
} }
$rest = join(' ', @fields); $rest = join(' ', @fields);
@ -167,3 +167,16 @@ while(<>) {
{ &hf_x11_$variable, { "$abbrev", "x11.$field", FT_$type, $fieldDisplay, $fieldStrings, $mask, $longName, HFILL }}, { &hf_x11_$variable, { "$abbrev", "x11.$field", FT_$type, $fieldDisplay, $fieldStrings, $mask, $longName, HFILL }},
END END
} }
#
# Editor modelines
#
# Local Variables:
# c-basic-offset: 4
# tab-width: 8
# indent-tabs-mode: nil
# End:
#
# ex: set shiftwidth=4 tabstop=8 expandtab:
# :indentSize=4:tabSize=8:noTabs=true:
#

File diff suppressed because it is too large Load Diff