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
This commit is contained in:
Kazu Hirata 2002-05-22 22:02:16 +00:00 committed by Kazu Hirata
parent 2dd36f90d8
commit df38348381
12 changed files with 129 additions and 115 deletions

View File

@ -1,3 +1,17 @@
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>
* combine.c (force_to_mode): Use gen_int_mode.

View File

@ -98,7 +98,7 @@ _cpp_begin_message (pfile, code, line, column)
else if (CPP_OPTION (pfile, inhibit_warnings))
return 0;
break;
case DL_ERROR:
if (CPP_OPTION (pfile, inhibit_errors))
return 0;

View File

@ -150,7 +150,7 @@ parse_number (pfile, tok)
|| (base == 16 && (c == 'P' || c == 'p')
&& p+1 < end && (p[1] == '+' || p[1] == '-')))
SYNTAX_ERROR ("floating point numbers are not valid in #if");
/* Determine the suffix. l means long, and u means unsigned.
See the suffix tables, above. */
switch (end - p)
@ -177,7 +177,7 @@ parse_number (pfile, tok)
cpp_error (pfile, DL_PEDWARN,
"too many 'l' suffixes in integer constant");
}
if (base <= largest_digit)
cpp_error (pfile, DL_PEDWARN,
"integer constant contains digits beyond the radix");
@ -491,7 +491,7 @@ static const struct operator
top->value = PSH (pfile, v1, unsigned1, v2);
/* 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
bottom-up parser, using a stack for not-yet-reduced tokens.
@ -631,7 +631,7 @@ _cpp_parse_expr (pfile)
/* Check for and handle stack overflow. */
if (++top == pfile->op_limit)
top = _cpp_expand_op_stack (pfile);
top->op = op.op;
}

View File

@ -250,7 +250,7 @@ open_file (pfile, filename)
/* Don't reopen an idempotent file. */
if (DO_NOT_REREAD (file))
return file;
/* Don't reopen one which is already loaded. */
if (file->buffer != NULL)
return file;
@ -276,7 +276,7 @@ open_file (pfile, filename)
/* For DJGPP redirected input is opened in text mode. Change it
to binary mode. */
if (! isatty (file->fd))
setmode (file->fd, O_BINARY);
setmode (file->fd, O_BINARY);
#endif
}
else
@ -520,7 +520,7 @@ cpp_included (pfile, fname)
nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname);
return (nd && nd->value);
}
/* Search directory path for the file. */
name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
for (path = CPP_OPTION (pfile, quote_include); path; path = path->next)
@ -712,7 +712,7 @@ _cpp_compare_file_date (pfile, header)
const cpp_token *header;
{
struct include_file *inc = find_include_file (pfile, header, 0);
if (inc == NULL || inc == NO_INCLUDE_PATH)
return -1;
@ -721,7 +721,7 @@ _cpp_compare_file_date (pfile, header)
close (inc->fd);
inc->fd = -1;
}
return inc->st.st_mtime > pfile->buffer->inc->st.st_mtime;
}
@ -936,7 +936,7 @@ read_name_map (pfile, dirname)
ptr->map_to[dirlen] = '/';
strcpy (ptr->map_to + dirlen + 1, to);
free (to);
}
}
ptr->map_next = map_list_ptr->map_list_map;
map_list_ptr->map_list_map = ptr;
@ -947,13 +947,13 @@ read_name_map (pfile, dirname)
}
fclose (f);
}
/* Add this information to the cache. */
map_list_ptr->map_list_next = CPP_OPTION (pfile, map_list);
CPP_OPTION (pfile, map_list) = map_list_ptr;
return map_list_ptr->map_list_map;
}
}
/* Remap an unsimplified path NAME based on the file_name_map (if any)
for LOC. */
@ -978,10 +978,10 @@ remap_filename (pfile, name, loc)
if (! loc->name_map)
return name;
}
/* This works since NAME has not been simplified yet. */
from = name + loc->len + 1;
for (map = loc->name_map; map; map = map->map_next)
if (!strcmp (map->map_from, from))
return map->map_to;
@ -1002,7 +1002,7 @@ remap_filename (pfile, name, loc)
memcpy (dir, name, p - name);
dir[p - name] = '\0';
from = p + 1;
for (map = read_name_map (pfile, dir); map; map = map->map_next)
if (! strcmp (map->map_from, from))
return map->map_to;
@ -1052,7 +1052,7 @@ remove_component_p (path)
nonzero if an error occurred when using stat () or lstat (). */
char *
_cpp_simplify_pathname (path)
char *path;
char *path;
{
#ifndef VMS
char *from, *to;
@ -1068,7 +1068,7 @@ _cpp_simplify_pathname (path)
/* Convert all backslashes to slashes. */
for (from = path; *from; from++)
if (*from == '\\') *from = '/';
/* Skip over leading drive letter if present. */
if (ISALPHA (path[0]) && path[1] == ':')
from = to = &path[2];
@ -1077,7 +1077,7 @@ _cpp_simplify_pathname (path)
#else
from = to = path;
#endif
/* Remove redundant leading /s. */
if (*from == '/')
{
@ -1152,7 +1152,7 @@ _cpp_simplify_pathname (path)
if (move_base)
base = to;
}
/* Change the empty string to "." so that it is not treated as stdin.
Null terminate. */
if (to == path)

View File

@ -37,7 +37,7 @@ alloc_node (table)
hash_table *table;
{
cpp_hashnode *node;
node = (cpp_hashnode *) obstack_alloc (&table->pfile->hash_ob,
sizeof (cpp_hashnode));
memset ((PTR) node, 0, sizeof (cpp_hashnode));

View File

@ -173,7 +173,7 @@ struct lexer_state
unsigned char poisoned_ok;
/* Nonzero to prevent macro expansion. */
unsigned char prevent_expansion;
unsigned char prevent_expansion;
/* Nonzero when parsing arguments to a function-like macro. */
unsigned char parsing_args;
@ -338,7 +338,7 @@ struct cpp_reader
/* Call backs. */
struct cpp_callbacks cb;
/* Identifier hash table. */
/* Identifier hash table. */
struct ht *hash_table;
/* Expression parser stack. */

View File

@ -303,7 +303,7 @@ remove_dup_dirs (pfile, head)
for (cur = head; cur; cur = cur->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)
{
@ -419,7 +419,7 @@ set_lang (pfile, lang)
enum c_lang lang;
{
const struct lang_flags *l = &lang_defaults[(int) lang];
CPP_OPTION (pfile, lang) = lang;
CPP_OPTION (pfile, c99) = l->c99;
@ -1013,7 +1013,7 @@ _cpp_maybe_push_include_file (pfile)
if (pfile->next_include_file)
{
struct pending_option *head = *pfile->next_include_file;
while (head && !push_include (pfile, head))
head = head->next;
@ -1373,10 +1373,10 @@ cpp_handle_option (pfile, argc, argv, ignore)
CPP_OPTION (pfile, help_only) = 1;
break;
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. */
CPP_OPTION (pfile, help_only) = 1;
break;
break;
/* --version inhibits compilation, -version doesn't. -v means
verbose and -version. Historical reasons, don't ask. */
@ -1415,11 +1415,11 @@ cpp_handle_option (pfile, argc, argv, ignore)
CPP_OPTION (pfile, pedantic_errors) = 1;
/* fall through */
case OPT_pedantic:
CPP_OPTION (pfile, pedantic) = 1;
CPP_OPTION (pfile, pedantic) = 1;
CPP_OPTION (pfile, warn_endif_labels) = 1;
break;
case OPT_trigraphs:
CPP_OPTION (pfile, trigraphs) = 1;
CPP_OPTION (pfile, trigraphs) = 1;
break;
case OPT_remap:
CPP_OPTION (pfile, remap) = 1;
@ -1489,13 +1489,13 @@ cpp_handle_option (pfile, argc, argv, ignore)
/* Args to -d specify what parts of macros to dump.
Silently ignore unrecognised options; they may
be aimed at the compiler proper. */
{
{
char c;
while ((c = *arg++) != '\0')
switch (c)
{
case 'M':
switch (c)
{
case 'M':
CPP_OPTION (pfile, dump_macros) = dump_only;
break;
case 'N':
@ -1529,7 +1529,7 @@ cpp_handle_option (pfile, argc, argv, ignore)
case OPT_MF:
CPP_OPTION (pfile, deps_file) = arg;
break;
case OPT_MP:
case OPT_MP:
CPP_OPTION (pfile, deps_phony_targets) = 1;
break;
case OPT_MQ:
@ -1575,7 +1575,7 @@ cpp_handle_option (pfile, argc, argv, ignore)
break;
case OPT_I: /* Add directory to path for includes. */
if (!strcmp (arg, "-"))
{
{
/* -I- means:
Use the preceding -I directories for #include "..."
but not #include <...>.
@ -1595,8 +1595,8 @@ cpp_handle_option (pfile, argc, argv, ignore)
cpp_error (pfile, DL_FATAL, "-I- specified twice");
return argc;
}
}
else
}
else
append_include_chain (pfile, xstrdup (arg), BRACKET, 0);
break;
case OPT_isystem:
@ -1701,7 +1701,7 @@ cpp_handle_option (pfile, argc, argv, ignore)
else if (! ignore)
return i;
break;
}
}
}
return i + 1;
}

View File

@ -71,7 +71,7 @@ static void adjust_column PARAMS ((cpp_reader *));
static int skip_whitespace PARAMS ((cpp_reader *, cppchar_t));
static cpp_hashnode *parse_identifier PARAMS ((cpp_reader *));
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 int unescaped_terminator_p PARAMS ((cpp_reader *, const uchar *));
static void parse_string PARAMS ((cpp_reader *, cpp_token *, cppchar_t));
@ -247,7 +247,7 @@ get_effective_char (pfile)
if (__builtin_expect (next == '?' || next == '\\', 0))
next = skip_escaped_newlines (pfile);
return next;
return next;
}
/* Skip a C-style block comment. We find the end of the comment by
@ -424,7 +424,7 @@ name_p (pfile, string)
if (!is_idchar (string->text[i]))
return 0;
return 1;
return 1;
}
/* Parse an identifier, skipping embedded backslash-newlines. This is
@ -533,15 +533,15 @@ parse_slow (pfile, cur, number_p, plen)
/* Handle normal identifier characters in this loop. */
do
{
{
prevc = c;
obstack_1grow (stack, c);
obstack_1grow (stack, c);
if (c == '$')
saw_dollar++;
if (c == '$')
saw_dollar++;
c = *buffer->cur++;
}
c = *buffer->cur++;
}
while (is_idchar (c));
}
@ -665,7 +665,7 @@ parse_string (pfile, token, terminator)
if (char_len == -1)
{
cpp_error (pfile, DL_WARNING,
"ignoring invalid multibyte character");
"ignoring invalid multibyte character");
char_len = 1;
c = *buffer->cur++;
}
@ -739,7 +739,7 @@ save_comment (pfile, token, from, type)
{
unsigned char *buffer;
unsigned int len, clen;
len = pfile->buffer->cur - from + 1; /* + 1 for the initial '/'. */
/* C++ comments probably (not definitely) have moved past a new
@ -756,7 +756,7 @@ save_comment (pfile, token, from, type)
clen = (pfile->state.in_directive && type == '/') ? len + 2 : len;
buffer = _cpp_unaligned_alloc (pfile, clen);
token->type = CPP_COMMENT;
token->val.str.len = clen;
token->val.str.text = buffer;
@ -888,7 +888,7 @@ continue_after_nul (pfile)
{
cpp_buffer *buffer = pfile->buffer;
bool more = false;
buffer->saved_flags = BOL;
if (CPP_OPTION (pfile, traditional))
more = _cpp_read_logical_line_trad (pfile);
@ -1029,19 +1029,19 @@ _cpp_lex_direct (pfile)
case 'L':
/* 'L' may introduce wide characters or strings. */
{
const unsigned char *pos = buffer->cur;
{
const unsigned char *pos = buffer->cur;
c = get_effective_char (pfile);
if (c == '\'' || c == '"')
{
result->type = (c == '"' ? CPP_WSTRING: CPP_WCHAR);
parse_string (pfile, result, c);
break;
}
buffer->cur = pos;
}
/* Fall through. */
c = get_effective_char (pfile);
if (c == '\'' || c == '"')
{
result->type = (c == '"' ? CPP_WSTRING: CPP_WCHAR);
parse_string (pfile, result, c);
break;
}
buffer->cur = pos;
}
/* Fall through. */
start_ident:
case '_':
@ -1091,7 +1091,7 @@ _cpp_lex_direct (pfile)
&& ! buffer->warned_cplusplus_comments)
{
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,
"(this will be reported only once per input file)");
buffer->warned_cplusplus_comments = 1;
@ -1274,7 +1274,7 @@ _cpp_lex_direct (pfile)
result->type = CPP_AND;
}
break;
case '|':
c = get_effective_char (pfile);
if (c == '|')
@ -1381,7 +1381,7 @@ cpp_spell_token (pfile, token, buffer)
goto spell_ident;
else
spelling = TOKEN_NAME (token);
while ((c = *spelling++) != '\0')
*buffer++ = c;
}
@ -1789,7 +1789,7 @@ cpp_parse_escape (pfile, pstr, limit, wide)
"non-ISO-standard escape sequence, '\\%c'", (int) c);
c = TARGET_ESC;
break;
case 'u': case 'U':
unknown = maybe_read_ucs (pfile, &str, limit, &c);
break;
@ -1799,33 +1799,33 @@ cpp_parse_escape (pfile, pstr, limit, wide)
cpp_error (pfile, DL_WARNING,
"the meaning of '\\x' is different in traditional C");
{
cppchar_t i = 0, overflow = 0;
int digits_found = 0;
{
cppchar_t i = 0, overflow = 0;
int digits_found = 0;
while (str < limit)
{
c = *str;
if (! ISXDIGIT (c))
break;
str++;
overflow |= i ^ (i << 4 >> 4);
i = (i << 4) + hex_digit_value (c);
digits_found = 1;
}
while (str < limit)
{
c = *str;
if (! ISXDIGIT (c))
break;
str++;
overflow |= i ^ (i << 4 >> 4);
i = (i << 4) + hex_digit_value (c);
digits_found = 1;
}
if (!digits_found)
cpp_error (pfile, DL_ERROR,
if (!digits_found)
cpp_error (pfile, DL_ERROR,
"\\x used with no following hex digits");
if (overflow | (i != (i & mask)))
{
cpp_error (pfile, DL_PEDWARN,
"hex escape sequence out of range");
i &= mask;
}
c = i;
}
if (overflow | (i != (i & mask)))
{
cpp_error (pfile, DL_PEDWARN,
"hex escape sequence out of range");
i &= mask;
}
c = i;
}
break;
case '0': case '1': case '2': case '3':
@ -1949,7 +1949,7 @@ cpp_interpret_charconst (pfile, token, pchars_seen, unsignedp)
if (ISPRINT (c))
c = MAP_CHARACTER (c);
#endif
chars_seen++;
/* Truncate the character, scale the result and merge the two. */

View File

@ -400,8 +400,8 @@ _cpp_handle_directive (pfile, indented)
requested to expand comments into macros, then re-enable
saving of comments. */
if (dir == &dtable[T_DEFINE])
pfile->state.save_comments =
! CPP_OPTION (pfile, discard_comments_in_macro_exp);
pfile->state.save_comments =
! CPP_OPTION (pfile, discard_comments_in_macro_exp);
pfile->directive = dir;
(*pfile->directive->handler) (pfile);
@ -514,7 +514,7 @@ static void
do_undef (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
is not currently defined as a macro name. */
@ -787,7 +787,7 @@ do_line (pfile)
"\"%s\" after #line is not a positive integer",
cpp_token_as_text (pfile, token));
return;
}
}
if (CPP_PEDANTIC (pfile) && (new_lineno == 0 || new_lineno > cap))
cpp_error (pfile, DL_PEDWARN, "line number out of range");
@ -839,7 +839,7 @@ do_linemarker (pfile)
cpp_error (pfile, DL_ERROR, "\"%s\" after # is not a positive integer",
cpp_token_as_text (pfile, token));
return;
}
}
token = cpp_get_token (pfile);
if (token->type == CPP_STRING)
@ -1112,7 +1112,7 @@ do_pragma_once (pfile)
cpp_reader *pfile;
{
cpp_error (pfile, DL_WARNING, "#pragma once is obsolete");
if (pfile->buffer->prev == NULL)
cpp_error (pfile, DL_WARNING, "#pragma once in main file");
else
@ -1187,7 +1187,7 @@ do_pragma_dependency (pfile)
{
const cpp_token *header;
int ordering;
header = parse_include (pfile);
if (!header)
return;
@ -1664,7 +1664,7 @@ do_assert (pfile)
{
struct answer *new_answer;
cpp_hashnode *node;
node = parse_assertion (pfile, &new_answer, T_ASSERT);
if (node)
{
@ -1698,7 +1698,7 @@ do_unassert (pfile)
{
cpp_hashnode *node;
struct answer *answer;
node = parse_assertion (pfile, &answer, T_UNASSERT);
/* It isn't an error to #unassert something that isn't asserted. */
if (node && node->type == NT_ASSERTION)
@ -1739,7 +1739,7 @@ cpp_define (pfile, str)
char *buf, *p;
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,
tack " 1" on the end. */
@ -1794,7 +1794,7 @@ cpp_unassert (pfile, str)
const char *str;
{
handle_assertion (pfile, str, T_UNASSERT);
}
}
/* Common code for cpp_assert (-A) and cpp_unassert (-A-). */
static void

View File

@ -569,7 +569,7 @@ collect_args (pfile, node)
the invocation at all.
e.g. #define debug(format, args...) something
debug("string");
This is exactly the same as if there had been an empty rest
argument - debug("string", ). */
@ -1035,7 +1035,7 @@ cpp_get_token (pfile)
if (node->type != NT_MACRO || (result->flags & NO_EXPAND))
break;
if (!(node->flags & NODE_DISABLED))
{
if (!pfile->state.prevent_expansion
@ -1480,7 +1480,7 @@ check_trad_stringification (pfile, macro, string)
{
unsigned int i, len;
const uchar *p, *q, *limit = string->text + string->len;
/* Loop over the string. */
for (p = string->text; p < limit; p = q)
{
@ -1584,9 +1584,9 @@ cpp_macro_definition (pfile, node)
}
if (i + 1 < macro->paramc)
/* Don't emit a space after the comma here; we're trying
to emit a Dwarf-friendly definition, and the Dwarf spec
forbids spaces in the argument list. */
/* Don't emit a space after the comma here; we're trying
to emit a Dwarf-friendly definition, and the Dwarf spec
forbids spaces in the argument list. */
*buffer++ = ',';
else if (macro->variadic)
*buffer++ = '.', *buffer++ = '.', *buffer++ = '.';

View File

@ -78,7 +78,7 @@ cpp_preprocess_file (pfile)
print.printed = 0;
print.prev = 0;
print.map = 0;
/* Open the output now. We must do so even if no_output is on,
because there may be other output than from the actual
preprocessing (e.g. from -dM). */
@ -264,7 +264,7 @@ print_line (map, line, special_flags)
size_t to_file_len = strlen (map->to_file);
unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1);
unsigned char *p;
/* cpp_quote_string does not nul-terminate, so we have to do it
ourselves. */
p = cpp_quote_string (to_file_quoted,

View File

@ -90,7 +90,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
/* Have we seen an input file? */
int seen_input = 0;
/* Positions to insert -xc, -xassembler-with-cpp, and -o, if necessary.
0 means unnecessary. */
int lang_c_here = 0;
@ -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? */
int need_fixups = 1;
int i, j, quote = 0;
const char **new_argv;
int new_argc;
@ -117,7 +117,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
quote = 0;
continue;
}
if (argv[i][0] == '-')
{
if (argv[i][1] == '\0')
@ -228,7 +228,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
new_argv[j] = NULL;
*in_argc = new_argc;
*in_argv = new_argv;
}
}
/* Called before linking. Returns 0 on success and -1 on failure. */
int lang_specific_pre_link ()