aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppfiles.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-04-30 17:11:25 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-04-30 17:11:25 +0000
commit638d694d84aedb360309dd956b261e428d85f092 (patch)
treeb2cbd4667ef9d395099460fd9be30ff0ec56ed29 /gcc/cppfiles.c
parent3f49b8429cb6e4f440d796b8ed8bd75185ada516 (diff)
downloadgcc-638d694d84aedb360309dd956b261e428d85f092.zip
gcc-638d694d84aedb360309dd956b261e428d85f092.tar.gz
gcc-638d694d84aedb360309dd956b261e428d85f092.tar.bz2
cppfiles.c (redundant_include_p): Provide length of token to cpp_defined.
* cppfiles.c (redundant_include_p): Provide length of token to cpp_defined. * cpphash.c (_cpp_make_hashnode, _cpp_lookup_slot): Hash values are unsigned int. (_cpp_lookup, _cpp_lookup_slot): Do not calculate the length. (_cpp_lookup_slot): Do not calculate the hash, either. * cpphash.h: Update prototypes. * cpplib.c (do_define, do_undef, do_pragma_poison, do_assert): Hashes are unsigned int. Calculate hash here, pass by value to _cpp_lookup_slot. From-SVN: r33551
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r--gcc/cppfiles.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index ddf4439..d92b84d 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -132,7 +132,8 @@ redundant_include_p (pfile, ihash, ilist)
included again if the string is the name of a defined macro. */
return (i->control_macro
&& (i->control_macro[0] == '\0'
- || cpp_defined (pfile, i->control_macro, -1)))
+ || cpp_defined (pfile, i->control_macro,
+ strlen (i->control_macro))))
? (IHASH *)-1 : i;
return 0;