[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
54-fyi-autoscan-c-keywords.patch
From: |
Akim Demaille |
Subject: |
54-fyi-autoscan-c-keywords.patch |
Date: |
Mon, 26 Nov 2001 11:49:54 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* bin/autoscan.in (%c_keywords): Build it at top level.
Map to 1 in order to simplify its uses.
Index: bin/autoscan.in
--- bin/autoscan.in Sun, 25 Nov 2001 10:46:18 +0100 akim
+++ bin/autoscan.in Sun, 25 Nov 2001 22:57:10 +0100 akim
@@ -35,7 +35,13 @@
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};
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 54-fyi-autoscan-c-keywords.patch,
Akim Demaille <=