@@ -2980,13 +2980,11 @@ _cpp_backup_tokens (cpp_reader *pfile, unsigned int count)
2980
2980
2981
2981
/* #define directive parsing and handling. */
2982
2982
2983
- /* Returns nonzero if a macro redefinition warning is required. */
2983
+ /* Returns true if a macro redefinition warning is required. */
2984
2984
static bool
2985
2985
warn_of_redefinition (cpp_reader * pfile , cpp_hashnode * node ,
2986
2986
const cpp_macro * macro2 )
2987
2987
{
2988
- unsigned int i ;
2989
-
2990
2988
/* Some redefinitions need to be warned about regardless. */
2991
2989
if (node -> flags & NODE_WARN )
2992
2990
return true;
@@ -3021,18 +3019,18 @@ warn_of_redefinition (cpp_reader *pfile, cpp_hashnode *node,
3021
3019
return true;
3022
3020
3023
3021
/* Check parameter spellings. */
3024
- for (i = 0 ; i < macro1 -> paramc ; i ++ )
3022
+ for (unsigned i = macro1 -> paramc ; i -- ; )
3025
3023
if (macro1 -> parm .params [i ] != macro2 -> parm .params [i ])
3026
3024
return true;
3027
3025
3028
3026
/* Check the replacement text or tokens. */
3029
- if (CPP_OPTION ( pfile , traditional ) )
3027
+ if (macro1 -> kind == cmk_traditional )
3030
3028
return _cpp_expansions_different_trad (macro1 , macro2 );
3031
3029
3032
3030
if (macro1 -> count != macro2 -> count )
3033
3031
return true;
3034
3032
3035
- for (i = 0 ; i < macro1 -> count ; i ++ )
3033
+ for (unsigned i = macro1 -> count ; i -- ; )
3036
3034
if (!_cpp_equiv_tokens (& macro1 -> exp .tokens [i ], & macro2 -> exp .tokens [i ]))
3037
3035
return true;
3038
3036
@@ -3439,7 +3437,7 @@ create_iso_definition (cpp_reader *pfile)
3439
3437
(pfile , sizeof (cpp_macro ) - sizeof (cpp_token )
3440
3438
+ sizeof (cpp_token ) * macro -> count );
3441
3439
3442
- /* Clear whitespace on first token for warn_of_redefinition() . */
3440
+ /* Clear whitespace on first token. */
3443
3441
if (macro -> count )
3444
3442
macro -> exp .tokens [0 ].flags &= ~PREV_WHITE ;
3445
3443
@@ -3767,11 +3765,3 @@ cpp_macro_definition (cpp_reader *pfile, cpp_hashnode *node)
3767
3765
* buffer = '\0' ;
3768
3766
return pfile -> macro_buffer ;
3769
3767
}
3770
-
3771
- /* Get the line at which the macro was defined. */
3772
-
3773
- source_location
3774
- cpp_macro_definition_location (cpp_hashnode * node )
3775
- {
3776
- return node -> value .macro -> line ;
3777
- }
0 commit comments