]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* bin/autoscan.in (%c_keywords): Build it at top level.
authorAkim Demaille <akim@epita.fr>
Mon, 26 Nov 2001 10:53:00 +0000 (10:53 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 26 Nov 2001 10:53:00 +0000 (10:53 +0000)
Map to 1 in order to simplify its uses.

ChangeLog
bin/autoscan.in

index fa48c1ee47557d077f680ec85678a115db094176..e907b80cdb646aa0c9b976bc507f61552085e6d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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):
index 3626cc379d6532608deff28865c4d886b42a1ccf..06a124d73837d72ebca1ced69a87076bf177bee4 100644 (file)
@@ -35,7 +35,13 @@ use File::Basename;
 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.
@@ -138,13 +144,6 @@ sub init_tables ()
   # 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,
@@ -260,12 +259,12 @@ sub scan_c_file ($)
       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};
        }
     }