+2001-11-26 Akim Demaille <akim@epita.fr>
+
+ * bin/autoscan.in (%c_keywords): Build it at top level.
+ Map to 1 in order to simplify its uses.
+
+
2001-11-26 Akim Demaille <akim@epita.fr>
* bin/autoscan.in (&scan_c_file, &scan_sh_file, &scan_makefile):
use File::Find;
use strict;
-use vars qw(@cfiles @makefiles @shfiles %c_keywords %printed);
+use vars qw(@cfiles @makefiles @shfiles %printed);
+
+# The list of C keywords.
+my %c_keywords = map { $_ => 1}
+ qw (int char float double struct union long short unsigned
+ auto extern register typedef static goto return sizeof break
+ continue if else for do while switch case default);
# $USED{KIND}{ITEM} is set if ITEM is used in the program.
# It is set to its list of locations.
# ANSI C, GNU C, and C++ keywords can introduce portability problems,
# so don't ignore them.
- foreach (qw (int char float double struct union long short unsigned
- auto extern register typedef static goto return sizeof break
- continue if else for do while switch case default))
- {
- $c_keywords{$_} = 0;
- }
-
# The data file format supports only one line of macros per function.
# If more than that is required for a common portability problem,
# a new Autoconf macro should probably be written for that case,
while (s/\b([a-zA-Z_]\w*)\s*\(/ /)
{
used ('functions', $1)
- if !defined $c_keywords{$1};
+ if !$c_keywords{$1};
}
while (s/\b([a-zA-Z_]\w*)\b/ /)
{
used ('identifiers', $1)
- if !defined $c_keywords{$1};
+ if !$c_keywords{$1};
}
}