Commit df383483 by Kazu Hirata Committed by Kazu Hirata

cpperror.c: Fix formatting.

	* cpperror.c: Fix formatting.
	* cppexp.c: Likewise.
	* cppfiles.c: Likewise.
	* cpphash.c: Likewise.
	* cpphash.h: Likewise.
	* cppinit.c: Likewise.
	* cpplex.c: Likewise.
	* cpplib.c: Likewise.
	* cppmacro.c: Likewise.
	* cppmain.c: Likewise.
	* cppspec.c: Likewise.

From-SVN: r53751
parent 2dd36f90
2002-05-22 Kazu Hirata <kazu@cs.umass.edu>
* cpperror.c: Fix formatting.
* cppexp.c: Likewise.
* cppfiles.c: Likewise.
* cpphash.c: Likewise.
* cpphash.h: Likewise.
* cppinit.c: Likewise.
* cpplex.c: Likewise.
* cpplib.c: Likewise.
* cppmacro.c: Likewise.
* cppmain.c: Likewise.
* cppspec.c: Likewise.
2002-05-22 Jakub Jelinek <jakub@redhat.com> 2002-05-22 Jakub Jelinek <jakub@redhat.com>
* combine.c (force_to_mode): Use gen_int_mode. * combine.c (force_to_mode): Use gen_int_mode.
......
...@@ -98,7 +98,7 @@ _cpp_begin_message (pfile, code, line, column) ...@@ -98,7 +98,7 @@ _cpp_begin_message (pfile, code, line, column)
else if (CPP_OPTION (pfile, inhibit_warnings)) else if (CPP_OPTION (pfile, inhibit_warnings))
return 0; return 0;
break; break;
case DL_ERROR: case DL_ERROR:
if (CPP_OPTION (pfile, inhibit_errors)) if (CPP_OPTION (pfile, inhibit_errors))
return 0; return 0;
......
...@@ -150,7 +150,7 @@ parse_number (pfile, tok) ...@@ -150,7 +150,7 @@ parse_number (pfile, tok)
|| (base == 16 && (c == 'P' || c == 'p') || (base == 16 && (c == 'P' || c == 'p')
&& p+1 < end && (p[1] == '+' || p[1] == '-'))) && p+1 < end && (p[1] == '+' || p[1] == '-')))
SYNTAX_ERROR ("floating point numbers are not valid in #if"); SYNTAX_ERROR ("floating point numbers are not valid in #if");
/* Determine the suffix. l means long, and u means unsigned. /* Determine the suffix. l means long, and u means unsigned.
See the suffix tables, above. */ See the suffix tables, above. */
switch (end - p) switch (end - p)
...@@ -177,7 +177,7 @@ parse_number (pfile, tok) ...@@ -177,7 +177,7 @@ parse_number (pfile, tok)
cpp_error (pfile, DL_PEDWARN, cpp_error (pfile, DL_PEDWARN,
"too many 'l' suffixes in integer constant"); "too many 'l' suffixes in integer constant");
} }
if (base <= largest_digit) if (base <= largest_digit)
cpp_error (pfile, DL_PEDWARN, cpp_error (pfile, DL_PEDWARN,
"integer constant contains digits beyond the radix"); "integer constant contains digits beyond the radix");
...@@ -491,7 +491,7 @@ static const struct operator ...@@ -491,7 +491,7 @@ static const struct operator
top->value = PSH (pfile, v1, unsigned1, v2); top->value = PSH (pfile, v1, unsigned1, v2);
/* Parse and evaluate a C expression, reading from PFILE. /* Parse and evaluate a C expression, reading from PFILE.
Returns the truth value of the expression. Returns the truth value of the expression.
The implementation is an operator precedence parser, i.e. a The implementation is an operator precedence parser, i.e. a
bottom-up parser, using a stack for not-yet-reduced tokens. bottom-up parser, using a stack for not-yet-reduced tokens.
...@@ -631,7 +631,7 @@ _cpp_parse_expr (pfile) ...@@ -631,7 +631,7 @@ _cpp_parse_expr (pfile)
/* Check for and handle stack overflow. */ /* Check for and handle stack overflow. */
if (++top == pfile->op_limit) if (++top == pfile->op_limit)
top = _cpp_expand_op_stack (pfile); top = _cpp_expand_op_stack (pfile);
top->op = op.op; top->op = op.op;
} }
......
...@@ -250,7 +250,7 @@ open_file (pfile, filename) ...@@ -250,7 +250,7 @@ open_file (pfile, filename)
/* Don't reopen an idempotent file. */ /* Don't reopen an idempotent file. */
if (DO_NOT_REREAD (file)) if (DO_NOT_REREAD (file))
return file; return file;
/* Don't reopen one which is already loaded. */ /* Don't reopen one which is already loaded. */
if (file->buffer != NULL) if (file->buffer != NULL)
return file; return file;
...@@ -276,7 +276,7 @@ open_file (pfile, filename) ...@@ -276,7 +276,7 @@ open_file (pfile, filename)
/* For DJGPP redirected input is opened in text mode. Change it /* For DJGPP redirected input is opened in text mode. Change it
to binary mode. */ to binary mode. */
if (! isatty (file->fd)) if (! isatty (file->fd))
setmode (file->fd, O_BINARY); setmode (file->fd, O_BINARY);
#endif #endif
} }
else else
...@@ -520,7 +520,7 @@ cpp_included (pfile, fname) ...@@ -520,7 +520,7 @@ cpp_included (pfile, fname)
nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname); nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname);
return (nd && nd->value); return (nd && nd->value);
} }
/* Search directory path for the file. */ /* Search directory path for the file. */
name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2); name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
for (path = CPP_OPTION (pfile, quote_include); path; path = path->next) for (path = CPP_OPTION (pfile, quote_include); path; path = path->next)
...@@ -712,7 +712,7 @@ _cpp_compare_file_date (pfile, header) ...@@ -712,7 +712,7 @@ _cpp_compare_file_date (pfile, header)
const cpp_token *header; const cpp_token *header;
{ {
struct include_file *inc = find_include_file (pfile, header, 0); struct include_file *inc = find_include_file (pfile, header, 0);
if (inc == NULL || inc == NO_INCLUDE_PATH) if (inc == NULL || inc == NO_INCLUDE_PATH)
return -1; return -1;
...@@ -721,7 +721,7 @@ _cpp_compare_file_date (pfile, header) ...@@ -721,7 +721,7 @@ _cpp_compare_file_date (pfile, header)
close (inc->fd); close (inc->fd);
inc->fd = -1; inc->fd = -1;
} }
return inc->st.st_mtime > pfile->buffer->inc->st.st_mtime; return inc->st.st_mtime > pfile->buffer->inc->st.st_mtime;
} }
...@@ -936,7 +936,7 @@ read_name_map (pfile, dirname) ...@@ -936,7 +936,7 @@ read_name_map (pfile, dirname)
ptr->map_to[dirlen] = '/'; ptr->map_to[dirlen] = '/';
strcpy (ptr->map_to + dirlen + 1, to); strcpy (ptr->map_to + dirlen + 1, to);
free (to); free (to);
} }
ptr->map_next = map_list_ptr->map_list_map; ptr->map_next = map_list_ptr->map_list_map;
map_list_ptr->map_list_map = ptr; map_list_ptr->map_list_map = ptr;
...@@ -947,13 +947,13 @@ read_name_map (pfile, dirname) ...@@ -947,13 +947,13 @@ read_name_map (pfile, dirname)
} }
fclose (f); fclose (f);
} }
/* Add this information to the cache. */ /* Add this information to the cache. */
map_list_ptr->map_list_next = CPP_OPTION (pfile, map_list); map_list_ptr->map_list_next = CPP_OPTION (pfile, map_list);
CPP_OPTION (pfile, map_list) = map_list_ptr; CPP_OPTION (pfile, map_list) = map_list_ptr;
return map_list_ptr->map_list_map; return map_list_ptr->map_list_map;
} }
/* Remap an unsimplified path NAME based on the file_name_map (if any) /* Remap an unsimplified path NAME based on the file_name_map (if any)
for LOC. */ for LOC. */
...@@ -978,10 +978,10 @@ remap_filename (pfile, name, loc) ...@@ -978,10 +978,10 @@ remap_filename (pfile, name, loc)
if (! loc->name_map) if (! loc->name_map)
return name; return name;
} }
/* This works since NAME has not been simplified yet. */ /* This works since NAME has not been simplified yet. */
from = name + loc->len + 1; from = name + loc->len + 1;
for (map = loc->name_map; map; map = map->map_next) for (map = loc->name_map; map; map = map->map_next)
if (!strcmp (map->map_from, from)) if (!strcmp (map->map_from, from))
return map->map_to; return map->map_to;
...@@ -1002,7 +1002,7 @@ remap_filename (pfile, name, loc) ...@@ -1002,7 +1002,7 @@ remap_filename (pfile, name, loc)
memcpy (dir, name, p - name); memcpy (dir, name, p - name);
dir[p - name] = '\0'; dir[p - name] = '\0';
from = p + 1; from = p + 1;
for (map = read_name_map (pfile, dir); map; map = map->map_next) for (map = read_name_map (pfile, dir); map; map = map->map_next)
if (! strcmp (map->map_from, from)) if (! strcmp (map->map_from, from))
return map->map_to; return map->map_to;
...@@ -1052,7 +1052,7 @@ remove_component_p (path) ...@@ -1052,7 +1052,7 @@ remove_component_p (path)
nonzero if an error occurred when using stat () or lstat (). */ nonzero if an error occurred when using stat () or lstat (). */
char * char *
_cpp_simplify_pathname (path) _cpp_simplify_pathname (path)
char *path; char *path;
{ {
#ifndef VMS #ifndef VMS
char *from, *to; char *from, *to;
...@@ -1068,7 +1068,7 @@ _cpp_simplify_pathname (path) ...@@ -1068,7 +1068,7 @@ _cpp_simplify_pathname (path)
/* Convert all backslashes to slashes. */ /* Convert all backslashes to slashes. */
for (from = path; *from; from++) for (from = path; *from; from++)
if (*from == '\\') *from = '/'; if (*from == '\\') *from = '/';
/* Skip over leading drive letter if present. */ /* Skip over leading drive letter if present. */
if (ISALPHA (path[0]) && path[1] == ':') if (ISALPHA (path[0]) && path[1] == ':')
from = to = &path[2]; from = to = &path[2];
...@@ -1077,7 +1077,7 @@ _cpp_simplify_pathname (path) ...@@ -1077,7 +1077,7 @@ _cpp_simplify_pathname (path)
#else #else
from = to = path; from = to = path;
#endif #endif
/* Remove redundant leading /s. */ /* Remove redundant leading /s. */
if (*from == '/') if (*from == '/')
{ {
...@@ -1152,7 +1152,7 @@ _cpp_simplify_pathname (path) ...@@ -1152,7 +1152,7 @@ _cpp_simplify_pathname (path)
if (move_base) if (move_base)
base = to; base = to;
} }
/* Change the empty string to "." so that it is not treated as stdin. /* Change the empty string to "." so that it is not treated as stdin.
Null terminate. */ Null terminate. */
if (to == path) if (to == path)
......
...@@ -37,7 +37,7 @@ alloc_node (table) ...@@ -37,7 +37,7 @@ alloc_node (table)
hash_table *table; hash_table *table;
{ {
cpp_hashnode *node; cpp_hashnode *node;
node = (cpp_hashnode *) obstack_alloc (&table->pfile->hash_ob, node = (cpp_hashnode *) obstack_alloc (&table->pfile->hash_ob,
sizeof (cpp_hashnode)); sizeof (cpp_hashnode));
memset ((PTR) node, 0, sizeof (cpp_hashnode)); memset ((PTR) node, 0, sizeof (cpp_hashnode));
......
...@@ -173,7 +173,7 @@ struct lexer_state ...@@ -173,7 +173,7 @@ struct lexer_state
unsigned char poisoned_ok; unsigned char poisoned_ok;
/* Nonzero to prevent macro expansion. */ /* Nonzero to prevent macro expansion. */
unsigned char prevent_expansion; unsigned char prevent_expansion;
/* Nonzero when parsing arguments to a function-like macro. */ /* Nonzero when parsing arguments to a function-like macro. */
unsigned char parsing_args; unsigned char parsing_args;
...@@ -338,7 +338,7 @@ struct cpp_reader ...@@ -338,7 +338,7 @@ struct cpp_reader
/* Call backs. */ /* Call backs. */
struct cpp_callbacks cb; struct cpp_callbacks cb;
/* Identifier hash table. */ /* Identifier hash table. */
struct ht *hash_table; struct ht *hash_table;
/* Expression parser stack. */ /* Expression parser stack. */
......
...@@ -303,7 +303,7 @@ remove_dup_dirs (pfile, head) ...@@ -303,7 +303,7 @@ remove_dup_dirs (pfile, head)
for (cur = head; cur; cur = cur->next) for (cur = head; cur; cur = cur->next)
{ {
for (other = head; other != cur; other = other->next) for (other = head; other != cur; other = other->next)
if (INO_T_EQ (cur->ino, other->ino) && cur->dev == other->dev) if (INO_T_EQ (cur->ino, other->ino) && cur->dev == other->dev)
{ {
if (cur->sysp && !other->sysp) if (cur->sysp && !other->sysp)
{ {
...@@ -419,7 +419,7 @@ set_lang (pfile, lang) ...@@ -419,7 +419,7 @@ set_lang (pfile, lang)
enum c_lang lang; enum c_lang lang;
{ {
const struct lang_flags *l = &lang_defaults[(int) lang]; const struct lang_flags *l = &lang_defaults[(int) lang];
CPP_OPTION (pfile, lang) = lang; CPP_OPTION (pfile, lang) = lang;
CPP_OPTION (pfile, c99) = l->c99; CPP_OPTION (pfile, c99) = l->c99;
...@@ -1013,7 +1013,7 @@ _cpp_maybe_push_include_file (pfile) ...@@ -1013,7 +1013,7 @@ _cpp_maybe_push_include_file (pfile)
if (pfile->next_include_file) if (pfile->next_include_file)
{ {
struct pending_option *head = *pfile->next_include_file; struct pending_option *head = *pfile->next_include_file;
while (head && !push_include (pfile, head)) while (head && !push_include (pfile, head))
head = head->next; head = head->next;
...@@ -1373,10 +1373,10 @@ cpp_handle_option (pfile, argc, argv, ignore) ...@@ -1373,10 +1373,10 @@ cpp_handle_option (pfile, argc, argv, ignore)
CPP_OPTION (pfile, help_only) = 1; CPP_OPTION (pfile, help_only) = 1;
break; break;
case OPT_target__help: case OPT_target__help:
/* Print if any target specific options. cpplib has none, but /* Print if any target specific options. cpplib has none, but
make sure help_only gets set. */ make sure help_only gets set. */
CPP_OPTION (pfile, help_only) = 1; CPP_OPTION (pfile, help_only) = 1;
break; break;
/* --version inhibits compilation, -version doesn't. -v means /* --version inhibits compilation, -version doesn't. -v means
verbose and -version. Historical reasons, don't ask. */ verbose and -version. Historical reasons, don't ask. */
...@@ -1415,11 +1415,11 @@ cpp_handle_option (pfile, argc, argv, ignore) ...@@ -1415,11 +1415,11 @@ cpp_handle_option (pfile, argc, argv, ignore)
CPP_OPTION (pfile, pedantic_errors) = 1; CPP_OPTION (pfile, pedantic_errors) = 1;
/* fall through */ /* fall through */
case OPT_pedantic: case OPT_pedantic:
CPP_OPTION (pfile, pedantic) = 1; CPP_OPTION (pfile, pedantic) = 1;
CPP_OPTION (pfile, warn_endif_labels) = 1; CPP_OPTION (pfile, warn_endif_labels) = 1;
break; break;
case OPT_trigraphs: case OPT_trigraphs:
CPP_OPTION (pfile, trigraphs) = 1; CPP_OPTION (pfile, trigraphs) = 1;
break; break;
case OPT_remap: case OPT_remap:
CPP_OPTION (pfile, remap) = 1; CPP_OPTION (pfile, remap) = 1;
...@@ -1489,13 +1489,13 @@ cpp_handle_option (pfile, argc, argv, ignore) ...@@ -1489,13 +1489,13 @@ cpp_handle_option (pfile, argc, argv, ignore)
/* Args to -d specify what parts of macros to dump. /* Args to -d specify what parts of macros to dump.
Silently ignore unrecognised options; they may Silently ignore unrecognised options; they may
be aimed at the compiler proper. */ be aimed at the compiler proper. */
{ {
char c; char c;
while ((c = *arg++) != '\0') while ((c = *arg++) != '\0')
switch (c) switch (c)
{ {
case 'M': case 'M':
CPP_OPTION (pfile, dump_macros) = dump_only; CPP_OPTION (pfile, dump_macros) = dump_only;
break; break;
case 'N': case 'N':
...@@ -1529,7 +1529,7 @@ cpp_handle_option (pfile, argc, argv, ignore) ...@@ -1529,7 +1529,7 @@ cpp_handle_option (pfile, argc, argv, ignore)
case OPT_MF: case OPT_MF:
CPP_OPTION (pfile, deps_file) = arg; CPP_OPTION (pfile, deps_file) = arg;
break; break;
case OPT_MP: case OPT_MP:
CPP_OPTION (pfile, deps_phony_targets) = 1; CPP_OPTION (pfile, deps_phony_targets) = 1;
break; break;
case OPT_MQ: case OPT_MQ:
...@@ -1575,7 +1575,7 @@ cpp_handle_option (pfile, argc, argv, ignore) ...@@ -1575,7 +1575,7 @@ cpp_handle_option (pfile, argc, argv, ignore)
break; break;
case OPT_I: /* Add directory to path for includes. */ case OPT_I: /* Add directory to path for includes. */
if (!strcmp (arg, "-")) if (!strcmp (arg, "-"))
{ {
/* -I- means: /* -I- means:
Use the preceding -I directories for #include "..." Use the preceding -I directories for #include "..."
but not #include <...>. but not #include <...>.
...@@ -1595,8 +1595,8 @@ cpp_handle_option (pfile, argc, argv, ignore) ...@@ -1595,8 +1595,8 @@ cpp_handle_option (pfile, argc, argv, ignore)
cpp_error (pfile, DL_FATAL, "-I- specified twice"); cpp_error (pfile, DL_FATAL, "-I- specified twice");
return argc; return argc;
} }
} }
else else
append_include_chain (pfile, xstrdup (arg), BRACKET, 0); append_include_chain (pfile, xstrdup (arg), BRACKET, 0);
break; break;
case OPT_isystem: case OPT_isystem:
...@@ -1701,7 +1701,7 @@ cpp_handle_option (pfile, argc, argv, ignore) ...@@ -1701,7 +1701,7 @@ cpp_handle_option (pfile, argc, argv, ignore)
else if (! ignore) else if (! ignore)
return i; return i;
break; break;
} }
} }
return i + 1; return i + 1;
} }
......
...@@ -71,7 +71,7 @@ static void adjust_column PARAMS ((cpp_reader *)); ...@@ -71,7 +71,7 @@ static void adjust_column PARAMS ((cpp_reader *));
static int skip_whitespace PARAMS ((cpp_reader *, cppchar_t)); static int skip_whitespace PARAMS ((cpp_reader *, cppchar_t));
static cpp_hashnode *parse_identifier PARAMS ((cpp_reader *)); static cpp_hashnode *parse_identifier PARAMS ((cpp_reader *));
static uchar *parse_slow PARAMS ((cpp_reader *, const uchar *, int, static uchar *parse_slow PARAMS ((cpp_reader *, const uchar *, int,
unsigned int *)); unsigned int *));
static void parse_number PARAMS ((cpp_reader *, cpp_string *, int)); static void parse_number PARAMS ((cpp_reader *, cpp_string *, int));
static int unescaped_terminator_p PARAMS ((cpp_reader *, const uchar *)); static int unescaped_terminator_p PARAMS ((cpp_reader *, const uchar *));
static void parse_string PARAMS ((cpp_reader *, cpp_token *, cppchar_t)); static void parse_string PARAMS ((cpp_reader *, cpp_token *, cppchar_t));
...@@ -247,7 +247,7 @@ get_effective_char (pfile) ...@@ -247,7 +247,7 @@ get_effective_char (pfile)
if (__builtin_expect (next == '?' || next == '\\', 0)) if (__builtin_expect (next == '?' || next == '\\', 0))
next = skip_escaped_newlines (pfile); next = skip_escaped_newlines (pfile);
return next; return next;
} }
/* Skip a C-style block comment. We find the end of the comment by /* Skip a C-style block comment. We find the end of the comment by
...@@ -424,7 +424,7 @@ name_p (pfile, string) ...@@ -424,7 +424,7 @@ name_p (pfile, string)
if (!is_idchar (string->text[i])) if (!is_idchar (string->text[i]))
return 0; return 0;
return 1; return 1;
} }
/* Parse an identifier, skipping embedded backslash-newlines. This is /* Parse an identifier, skipping embedded backslash-newlines. This is
...@@ -533,15 +533,15 @@ parse_slow (pfile, cur, number_p, plen) ...@@ -533,15 +533,15 @@ parse_slow (pfile, cur, number_p, plen)
/* Handle normal identifier characters in this loop. */ /* Handle normal identifier characters in this loop. */
do do
{ {
prevc = c; prevc = c;
obstack_1grow (stack, c); obstack_1grow (stack, c);
if (c == '$') if (c == '$')
saw_dollar++; saw_dollar++;
c = *buffer->cur++; c = *buffer->cur++;
} }
while (is_idchar (c)); while (is_idchar (c));
} }
...@@ -665,7 +665,7 @@ parse_string (pfile, token, terminator) ...@@ -665,7 +665,7 @@ parse_string (pfile, token, terminator)
if (char_len == -1) if (char_len == -1)
{ {
cpp_error (pfile, DL_WARNING, cpp_error (pfile, DL_WARNING,
"ignoring invalid multibyte character"); "ignoring invalid multibyte character");
char_len = 1; char_len = 1;
c = *buffer->cur++; c = *buffer->cur++;
} }
...@@ -739,7 +739,7 @@ save_comment (pfile, token, from, type) ...@@ -739,7 +739,7 @@ save_comment (pfile, token, from, type)
{ {
unsigned char *buffer; unsigned char *buffer;
unsigned int len, clen; unsigned int len, clen;
len = pfile->buffer->cur - from + 1; /* + 1 for the initial '/'. */ len = pfile->buffer->cur - from + 1; /* + 1 for the initial '/'. */
/* C++ comments probably (not definitely) have moved past a new /* C++ comments probably (not definitely) have moved past a new
...@@ -756,7 +756,7 @@ save_comment (pfile, token, from, type) ...@@ -756,7 +756,7 @@ save_comment (pfile, token, from, type)
clen = (pfile->state.in_directive && type == '/') ? len + 2 : len; clen = (pfile->state.in_directive && type == '/') ? len + 2 : len;
buffer = _cpp_unaligned_alloc (pfile, clen); buffer = _cpp_unaligned_alloc (pfile, clen);
token->type = CPP_COMMENT; token->type = CPP_COMMENT;
token->val.str.len = clen; token->val.str.len = clen;
token->val.str.text = buffer; token->val.str.text = buffer;
...@@ -888,7 +888,7 @@ continue_after_nul (pfile) ...@@ -888,7 +888,7 @@ continue_after_nul (pfile)
{ {
cpp_buffer *buffer = pfile->buffer; cpp_buffer *buffer = pfile->buffer;
bool more = false; bool more = false;
buffer->saved_flags = BOL; buffer->saved_flags = BOL;
if (CPP_OPTION (pfile, traditional)) if (CPP_OPTION (pfile, traditional))
more = _cpp_read_logical_line_trad (pfile); more = _cpp_read_logical_line_trad (pfile);
...@@ -1029,19 +1029,19 @@ _cpp_lex_direct (pfile) ...@@ -1029,19 +1029,19 @@ _cpp_lex_direct (pfile)
case 'L': case 'L':
/* 'L' may introduce wide characters or strings. */ /* 'L' may introduce wide characters or strings. */
{ {
const unsigned char *pos = buffer->cur; const unsigned char *pos = buffer->cur;
c = get_effective_char (pfile); c = get_effective_char (pfile);
if (c == '\'' || c == '"') if (c == '\'' || c == '"')
{ {
result->type = (c == '"' ? CPP_WSTRING: CPP_WCHAR); result->type = (c == '"' ? CPP_WSTRING: CPP_WCHAR);
parse_string (pfile, result, c); parse_string (pfile, result, c);
break; break;
} }
buffer->cur = pos; buffer->cur = pos;
} }
/* Fall through. */ /* Fall through. */
start_ident: start_ident:
case '_': case '_':
...@@ -1091,7 +1091,7 @@ _cpp_lex_direct (pfile) ...@@ -1091,7 +1091,7 @@ _cpp_lex_direct (pfile)
&& ! buffer->warned_cplusplus_comments) && ! buffer->warned_cplusplus_comments)
{ {
cpp_error (pfile, DL_PEDWARN, cpp_error (pfile, DL_PEDWARN,
"C++ style comments are not allowed in ISO C89"); "C++ style comments are not allowed in ISO C89");
cpp_error (pfile, DL_PEDWARN, cpp_error (pfile, DL_PEDWARN,
"(this will be reported only once per input file)"); "(this will be reported only once per input file)");
buffer->warned_cplusplus_comments = 1; buffer->warned_cplusplus_comments = 1;
...@@ -1274,7 +1274,7 @@ _cpp_lex_direct (pfile) ...@@ -1274,7 +1274,7 @@ _cpp_lex_direct (pfile)
result->type = CPP_AND; result->type = CPP_AND;
} }
break; break;
case '|': case '|':
c = get_effective_char (pfile); c = get_effective_char (pfile);
if (c == '|') if (c == '|')
...@@ -1381,7 +1381,7 @@ cpp_spell_token (pfile, token, buffer) ...@@ -1381,7 +1381,7 @@ cpp_spell_token (pfile, token, buffer)
goto spell_ident; goto spell_ident;
else else
spelling = TOKEN_NAME (token); spelling = TOKEN_NAME (token);
while ((c = *spelling++) != '\0') while ((c = *spelling++) != '\0')
*buffer++ = c; *buffer++ = c;
} }
...@@ -1789,7 +1789,7 @@ cpp_parse_escape (pfile, pstr, limit, wide) ...@@ -1789,7 +1789,7 @@ cpp_parse_escape (pfile, pstr, limit, wide)
"non-ISO-standard escape sequence, '\\%c'", (int) c); "non-ISO-standard escape sequence, '\\%c'", (int) c);
c = TARGET_ESC; c = TARGET_ESC;
break; break;
case 'u': case 'U': case 'u': case 'U':
unknown = maybe_read_ucs (pfile, &str, limit, &c); unknown = maybe_read_ucs (pfile, &str, limit, &c);
break; break;
...@@ -1799,33 +1799,33 @@ cpp_parse_escape (pfile, pstr, limit, wide) ...@@ -1799,33 +1799,33 @@ cpp_parse_escape (pfile, pstr, limit, wide)
cpp_error (pfile, DL_WARNING, cpp_error (pfile, DL_WARNING,
"the meaning of '\\x' is different in traditional C"); "the meaning of '\\x' is different in traditional C");
{ {
cppchar_t i = 0, overflow = 0; cppchar_t i = 0, overflow = 0;
int digits_found = 0; int digits_found = 0;
while (str < limit) while (str < limit)
{ {
c = *str; c = *str;
if (! ISXDIGIT (c)) if (! ISXDIGIT (c))
break; break;
str++; str++;
overflow |= i ^ (i << 4 >> 4); overflow |= i ^ (i << 4 >> 4);
i = (i << 4) + hex_digit_value (c); i = (i << 4) + hex_digit_value (c);
digits_found = 1; digits_found = 1;
} }
if (!digits_found) if (!digits_found)
cpp_error (pfile, DL_ERROR, cpp_error (pfile, DL_ERROR,
"\\x used with no following hex digits"); "\\x used with no following hex digits");
if (overflow | (i != (i & mask))) if (overflow | (i != (i & mask)))
{ {
cpp_error (pfile, DL_PEDWARN, cpp_error (pfile, DL_PEDWARN,
"hex escape sequence out of range"); "hex escape sequence out of range");
i &= mask; i &= mask;
} }
c = i; c = i;
} }
break; break;
case '0': case '1': case '2': case '3': case '0': case '1': case '2': case '3':
...@@ -1949,7 +1949,7 @@ cpp_interpret_charconst (pfile, token, pchars_seen, unsignedp) ...@@ -1949,7 +1949,7 @@ cpp_interpret_charconst (pfile, token, pchars_seen, unsignedp)
if (ISPRINT (c)) if (ISPRINT (c))
c = MAP_CHARACTER (c); c = MAP_CHARACTER (c);
#endif #endif
chars_seen++; chars_seen++;
/* Truncate the character, scale the result and merge the two. */ /* Truncate the character, scale the result and merge the two. */
......
...@@ -400,8 +400,8 @@ _cpp_handle_directive (pfile, indented) ...@@ -400,8 +400,8 @@ _cpp_handle_directive (pfile, indented)
requested to expand comments into macros, then re-enable requested to expand comments into macros, then re-enable
saving of comments. */ saving of comments. */
if (dir == &dtable[T_DEFINE]) if (dir == &dtable[T_DEFINE])
pfile->state.save_comments = pfile->state.save_comments =
! CPP_OPTION (pfile, discard_comments_in_macro_exp); ! CPP_OPTION (pfile, discard_comments_in_macro_exp);
pfile->directive = dir; pfile->directive = dir;
(*pfile->directive->handler) (pfile); (*pfile->directive->handler) (pfile);
...@@ -514,7 +514,7 @@ static void ...@@ -514,7 +514,7 @@ static void
do_undef (pfile) do_undef (pfile)
cpp_reader *pfile; cpp_reader *pfile;
{ {
cpp_hashnode *node = lex_macro_node (pfile); cpp_hashnode *node = lex_macro_node (pfile);
/* 6.10.3.5 paragraph 2: [#undef] is ignored if the specified identifier /* 6.10.3.5 paragraph 2: [#undef] is ignored if the specified identifier
is not currently defined as a macro name. */ is not currently defined as a macro name. */
...@@ -787,7 +787,7 @@ do_line (pfile) ...@@ -787,7 +787,7 @@ do_line (pfile)
"\"%s\" after #line is not a positive integer", "\"%s\" after #line is not a positive integer",
cpp_token_as_text (pfile, token)); cpp_token_as_text (pfile, token));
return; return;
} }
if (CPP_PEDANTIC (pfile) && (new_lineno == 0 || new_lineno > cap)) if (CPP_PEDANTIC (pfile) && (new_lineno == 0 || new_lineno > cap))
cpp_error (pfile, DL_PEDWARN, "line number out of range"); cpp_error (pfile, DL_PEDWARN, "line number out of range");
...@@ -839,7 +839,7 @@ do_linemarker (pfile) ...@@ -839,7 +839,7 @@ do_linemarker (pfile)
cpp_error (pfile, DL_ERROR, "\"%s\" after # is not a positive integer", cpp_error (pfile, DL_ERROR, "\"%s\" after # is not a positive integer",
cpp_token_as_text (pfile, token)); cpp_token_as_text (pfile, token));
return; return;
} }
token = cpp_get_token (pfile); token = cpp_get_token (pfile);
if (token->type == CPP_STRING) if (token->type == CPP_STRING)
...@@ -1112,7 +1112,7 @@ do_pragma_once (pfile) ...@@ -1112,7 +1112,7 @@ do_pragma_once (pfile)
cpp_reader *pfile; cpp_reader *pfile;
{ {
cpp_error (pfile, DL_WARNING, "#pragma once is obsolete"); cpp_error (pfile, DL_WARNING, "#pragma once is obsolete");
if (pfile->buffer->prev == NULL) if (pfile->buffer->prev == NULL)
cpp_error (pfile, DL_WARNING, "#pragma once in main file"); cpp_error (pfile, DL_WARNING, "#pragma once in main file");
else else
...@@ -1187,7 +1187,7 @@ do_pragma_dependency (pfile) ...@@ -1187,7 +1187,7 @@ do_pragma_dependency (pfile)
{ {
const cpp_token *header; const cpp_token *header;
int ordering; int ordering;
header = parse_include (pfile); header = parse_include (pfile);
if (!header) if (!header)
return; return;
...@@ -1664,7 +1664,7 @@ do_assert (pfile) ...@@ -1664,7 +1664,7 @@ do_assert (pfile)
{ {
struct answer *new_answer; struct answer *new_answer;
cpp_hashnode *node; cpp_hashnode *node;
node = parse_assertion (pfile, &new_answer, T_ASSERT); node = parse_assertion (pfile, &new_answer, T_ASSERT);
if (node) if (node)
{ {
...@@ -1698,7 +1698,7 @@ do_unassert (pfile) ...@@ -1698,7 +1698,7 @@ do_unassert (pfile)
{ {
cpp_hashnode *node; cpp_hashnode *node;
struct answer *answer; struct answer *answer;
node = parse_assertion (pfile, &answer, T_UNASSERT); node = parse_assertion (pfile, &answer, T_UNASSERT);
/* It isn't an error to #unassert something that isn't asserted. */ /* It isn't an error to #unassert something that isn't asserted. */
if (node && node->type == NT_ASSERTION) if (node && node->type == NT_ASSERTION)
...@@ -1739,7 +1739,7 @@ cpp_define (pfile, str) ...@@ -1739,7 +1739,7 @@ cpp_define (pfile, str)
char *buf, *p; char *buf, *p;
size_t count; size_t count;
/* Copy the entire option so we can modify it. /* Copy the entire option so we can modify it.
Change the first "=" in the string to a space. If there is none, Change the first "=" in the string to a space. If there is none,
tack " 1" on the end. */ tack " 1" on the end. */
...@@ -1794,7 +1794,7 @@ cpp_unassert (pfile, str) ...@@ -1794,7 +1794,7 @@ cpp_unassert (pfile, str)
const char *str; const char *str;
{ {
handle_assertion (pfile, str, T_UNASSERT); handle_assertion (pfile, str, T_UNASSERT);
} }
/* Common code for cpp_assert (-A) and cpp_unassert (-A-). */ /* Common code for cpp_assert (-A) and cpp_unassert (-A-). */
static void static void
......
...@@ -569,7 +569,7 @@ collect_args (pfile, node) ...@@ -569,7 +569,7 @@ collect_args (pfile, node)
the invocation at all. the invocation at all.
e.g. #define debug(format, args...) something e.g. #define debug(format, args...) something
debug("string"); debug("string");
This is exactly the same as if there had been an empty rest This is exactly the same as if there had been an empty rest
argument - debug("string", ). */ argument - debug("string", ). */
...@@ -1035,7 +1035,7 @@ cpp_get_token (pfile) ...@@ -1035,7 +1035,7 @@ cpp_get_token (pfile)
if (node->type != NT_MACRO || (result->flags & NO_EXPAND)) if (node->type != NT_MACRO || (result->flags & NO_EXPAND))
break; break;
if (!(node->flags & NODE_DISABLED)) if (!(node->flags & NODE_DISABLED))
{ {
if (!pfile->state.prevent_expansion if (!pfile->state.prevent_expansion
...@@ -1480,7 +1480,7 @@ check_trad_stringification (pfile, macro, string) ...@@ -1480,7 +1480,7 @@ check_trad_stringification (pfile, macro, string)
{ {
unsigned int i, len; unsigned int i, len;
const uchar *p, *q, *limit = string->text + string->len; const uchar *p, *q, *limit = string->text + string->len;
/* Loop over the string. */ /* Loop over the string. */
for (p = string->text; p < limit; p = q) for (p = string->text; p < limit; p = q)
{ {
...@@ -1584,9 +1584,9 @@ cpp_macro_definition (pfile, node) ...@@ -1584,9 +1584,9 @@ cpp_macro_definition (pfile, node)
} }
if (i + 1 < macro->paramc) if (i + 1 < macro->paramc)
/* Don't emit a space after the comma here; we're trying /* Don't emit a space after the comma here; we're trying
to emit a Dwarf-friendly definition, and the Dwarf spec to emit a Dwarf-friendly definition, and the Dwarf spec
forbids spaces in the argument list. */ forbids spaces in the argument list. */
*buffer++ = ','; *buffer++ = ',';
else if (macro->variadic) else if (macro->variadic)
*buffer++ = '.', *buffer++ = '.', *buffer++ = '.'; *buffer++ = '.', *buffer++ = '.', *buffer++ = '.';
......
...@@ -78,7 +78,7 @@ cpp_preprocess_file (pfile) ...@@ -78,7 +78,7 @@ cpp_preprocess_file (pfile)
print.printed = 0; print.printed = 0;
print.prev = 0; print.prev = 0;
print.map = 0; print.map = 0;
/* Open the output now. We must do so even if no_output is on, /* Open the output now. We must do so even if no_output is on,
because there may be other output than from the actual because there may be other output than from the actual
preprocessing (e.g. from -dM). */ preprocessing (e.g. from -dM). */
...@@ -264,7 +264,7 @@ print_line (map, line, special_flags) ...@@ -264,7 +264,7 @@ print_line (map, line, special_flags)
size_t to_file_len = strlen (map->to_file); size_t to_file_len = strlen (map->to_file);
unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1); unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1);
unsigned char *p; unsigned char *p;
/* cpp_quote_string does not nul-terminate, so we have to do it /* cpp_quote_string does not nul-terminate, so we have to do it
ourselves. */ ourselves. */
p = cpp_quote_string (to_file_quoted, p = cpp_quote_string (to_file_quoted,
......
...@@ -90,7 +90,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -90,7 +90,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
/* Have we seen an input file? */ /* Have we seen an input file? */
int seen_input = 0; int seen_input = 0;
/* Positions to insert -xc, -xassembler-with-cpp, and -o, if necessary. /* Positions to insert -xc, -xassembler-with-cpp, and -o, if necessary.
0 means unnecessary. */ 0 means unnecessary. */
int lang_c_here = 0; int lang_c_here = 0;
...@@ -99,7 +99,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -99,7 +99,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
/* Do we need to fix up an input file with an unrecognized suffix? */ /* Do we need to fix up an input file with an unrecognized suffix? */
int need_fixups = 1; int need_fixups = 1;
int i, j, quote = 0; int i, j, quote = 0;
const char **new_argv; const char **new_argv;
int new_argc; int new_argc;
...@@ -117,7 +117,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -117,7 +117,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
quote = 0; quote = 0;
continue; continue;
} }
if (argv[i][0] == '-') if (argv[i][0] == '-')
{ {
if (argv[i][1] == '\0') if (argv[i][1] == '\0')
...@@ -228,7 +228,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -228,7 +228,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
new_argv[j] = NULL; new_argv[j] = NULL;
*in_argc = new_argc; *in_argc = new_argc;
*in_argv = new_argv; *in_argv = new_argv;
} }
/* Called before linking. Returns 0 on success and -1 on failure. */ /* Called before linking. Returns 0 on success and -1 on failure. */
int lang_specific_pre_link () int lang_specific_pre_link ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment