diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2002-07-17 17:27:14 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-07-17 17:27:14 +0000 |
commit | 23ff022370f122c6736883f059c54f89fb5163cb (patch) | |
tree | d4ad3cdbbbc267253c90d548d8d59d8f399a5435 /gcc/cppmacro.c | |
parent | db50171f40e718db91d21f13828a2e74f879c04c (diff) | |
download | gcc-23ff022370f122c6736883f059c54f89fb5163cb.zip gcc-23ff022370f122c6736883f059c54f89fb5163cb.tar.gz gcc-23ff022370f122c6736883f059c54f89fb5163cb.tar.bz2 |
cppexp.c (cpp_interpret_integer, [...]): Clarify and correct use of "bool" variables.
* cppexp.c (cpp_interpret_integer, append_digit, parse_defined,
eval_token): Clarify and correct use of "bool" variables.
* cpplib.h (struct cpp_options): Similarly.
* cppmacro.c (parse_params, _cpp_save_parameter): Ditto.
* cpptrad.c (recursive_macro): Similarly.
From-SVN: r55536
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r-- | gcc/cppmacro.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 6b1fcec..4d807a2 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -69,7 +69,7 @@ static cpp_token *alloc_expansion_token PARAMS ((cpp_reader *, cpp_macro *)); static cpp_token *lex_expansion_token PARAMS ((cpp_reader *, cpp_macro *)); static bool warn_of_redefinition PARAMS ((cpp_reader *, const cpp_hashnode *, const cpp_macro *)); -static int parse_params PARAMS ((cpp_reader *, cpp_macro *)); +static bool parse_params PARAMS ((cpp_reader *, cpp_macro *)); static void check_trad_stringification PARAMS ((cpp_reader *, const cpp_macro *, const cpp_string *)); @@ -1245,7 +1245,7 @@ _cpp_save_parameter (pfile, macro, node) { cpp_error (pfile, DL_ERROR, "duplicate macro parameter \"%s\"", NODE_NAME (node)); - return 1; + return true; } if (BUFF_ROOM (pfile->a_buff) @@ -1254,11 +1254,12 @@ _cpp_save_parameter (pfile, macro, node) ((cpp_hashnode **) BUFF_FRONT (pfile->a_buff))[macro->paramc++] = node; node->arg_index = macro->paramc; - return 0; + return false; } -/* Check the syntax of the parameters in a MACRO definition. */ -static int +/* Check the syntax of the parameters in a MACRO definition. Returns + false if an error occurs. */ +static bool parse_params (pfile, macro) cpp_reader *pfile; cpp_macro *macro; @@ -1281,31 +1282,31 @@ parse_params (pfile, macro) cpp_error (pfile, DL_ERROR, "\"%s\" may not appear in macro parameter list", cpp_token_as_text (pfile, token)); - return 0; + return false; case CPP_NAME: if (prev_ident) { cpp_error (pfile, DL_ERROR, "macro parameters must be comma-separated"); - return 0; + return false; } prev_ident = 1; if (_cpp_save_parameter (pfile, macro, token->val.node)) - return 0; + return false; continue; case CPP_CLOSE_PAREN: if (prev_ident || macro->paramc == 0) - return 1; + return true; /* Fall through to pick up the error. */ case CPP_COMMA: if (!prev_ident) { cpp_error (pfile, DL_ERROR, "parameter name missing"); - return 0; + return false; } prev_ident = 0; continue; @@ -1328,12 +1329,12 @@ parse_params (pfile, macro) /* We're at the end, and just expect a closing parenthesis. */ token = _cpp_lex_token (pfile); if (token->type == CPP_CLOSE_PAREN) - return 1; + return true; /* Fall through. */ case CPP_EOF: cpp_error (pfile, DL_ERROR, "missing ')' in macro parameter list"); - return 0; + return false; } } } |