Commit 35b1a6fa by Andreas Jaeger

c-aux-info.c: Convert to ISO C99.


	* c-aux-info.c: Convert to ISO C99.
	* c-pragma.c: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-convert.c: Likewise.
	* c-cppbuiltin.c: Likewise.
	* c-dump.c: Likewise.
	* c-decl.c: Likewise
	* c-format.c: Likewise.
	* c-incpath.c: Likewise.
	* c-incpath.h: Likewise.

From-SVN: r68218
parent 6dab8d4c
2003-06-19 Andreas Jaeger <aj@suse.de>
* c-aux-info.c: Convert to ISO C99.
* c-pragma.c: Likewise.
* c-common.c: Likewise.
* c-common.h: Likewise.
* c-convert.c: Likewise.
* c-cppbuiltin.c: Likewise.
* c-dump.c: Likewise.
* c-decl.c: Likewise
* c-format.c: Likewise.
* c-incpath.c: Likewise.
* c-incpath.h: Likewise.
2003-06-19 Roger Sayle <roger@eyesopen.com>
* builtins.c (expand_errno_check): Assume that flag_errno_math
......@@ -11,7 +25,7 @@
the args after the main switch, and don't modify the orginal exp.
2003-06-19 Aldy Hernandez <aldyh@redhat.com>
* expr.c (const_vector_from_tree): Initialize remaining elements
to 0.
......@@ -143,7 +157,7 @@
Support configuring with --with-cpu=iwmmxt.
* doc/invoke.texi: Document new value for -mcpu= ARM switch.
* config/arm/aof.h (REGISTER_NAMES): Add iwmmxt register
names. Fix formatting.
names. Fix formatting.
* config/arm/aout.h (REGISTER_NAMES): Add iwmmxt register
names.
* config/arm/arm-protos.h (arm_emit_vector_const): New
......@@ -314,7 +328,7 @@
2003-06-17 Ranjit Mathew <rmathew@hotmail.com>
Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/sourcebuild.texi (libgcj Tests): Simplify instructions on how
to run Java runtime tests separately.
......
......@@ -2,7 +2,7 @@
on information stored in GCC's tree structure. This code implements the
-aux-info option.
Copyright (C) 1989, 1991, 1994, 1995, 1997, 1998,
1999, 2000 Free Software Foundation, Inc.
1999, 2000, 2003 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@segfault.us.com).
This file is part of GCC.
......@@ -41,12 +41,12 @@ typedef enum formals_style_enum formals_style;
static const char *data_type;
static char *affix_data_type PARAMS ((const char *)) ATTRIBUTE_MALLOC;
static const char *gen_formal_list_for_type PARAMS ((tree, formals_style));
static int deserves_ellipsis PARAMS ((tree));
static const char *gen_formal_list_for_func_def PARAMS ((tree, formals_style));
static const char *gen_type PARAMS ((const char *, tree, formals_style));
static const char *gen_decl PARAMS ((tree, int, formals_style));
static char *affix_data_type (const char *) ATTRIBUTE_MALLOC;
static const char *gen_formal_list_for_type (tree, formals_style);
static int deserves_ellipsis (tree);
static const char *gen_formal_list_for_func_def (tree, formals_style);
static const char *gen_type (const char *, tree, formals_style);
static const char *gen_decl (tree, int, formals_style);
/* Given a string representing an entire type or an entire declaration
which only lacks the actual "data-type" specifier (at its left end),
......@@ -63,8 +63,7 @@ static const char *gen_decl PARAMS ((tree, int, formals_style));
that look as expected. */
static char *
affix_data_type (param)
const char *param;
affix_data_type (const char *param)
{
char *const type_or_decl = ASTRDUP (param);
char *p = type_or_decl;
......@@ -110,9 +109,7 @@ affix_data_type (param)
of empty parens here. */
static const char *
gen_formal_list_for_type (fntype, style)
tree fntype;
formals_style style;
gen_formal_list_for_type (tree fntype, formals_style style)
{
const char *formal_list = "";
tree formal_type;
......@@ -194,8 +191,7 @@ gen_formal_list_for_type (fntype, style)
if the "function type" parameter list should end with an ellipsis. */
static int
deserves_ellipsis (fntype)
tree fntype;
deserves_ellipsis (tree fntype)
{
tree formal_type;
......@@ -230,9 +226,7 @@ deserves_ellipsis (fntype)
function formal parameter list. */
static const char *
gen_formal_list_for_func_def (fndecl, style)
tree fndecl;
formals_style style;
gen_formal_list_for_func_def (tree fndecl, formals_style style)
{
const char *formal_list = "";
tree formal_decl;
......@@ -305,10 +299,7 @@ gen_formal_list_for_func_def (fndecl, style)
string onto the returned "seed". */
static const char *
gen_type (ret_val, t, style)
const char *ret_val;
tree t;
formals_style style;
gen_type (const char *ret_val, tree t, formals_style style)
{
tree chain_p;
......@@ -434,13 +425,13 @@ gen_type (ret_val, t, style)
case TYPE_DECL:
data_type = IDENTIFIER_POINTER (DECL_NAME (t));
break;
case INTEGER_TYPE:
data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t)));
/* Normally, `unsigned' is part of the deal. Not so if it comes
with a type qualifier. */
with a type qualifier. */
if (TREE_UNSIGNED (t) && TYPE_QUALS (t))
data_type = concat ("unsigned ", data_type, NULL);
data_type = concat ("unsigned ", data_type, NULL);
break;
case REAL_TYPE:
......@@ -479,10 +470,7 @@ gen_type (ret_val, t, style)
an attached list of DECL nodes for function formal arguments is present. */
static const char *
gen_decl (decl, is_func_definition, style)
tree decl;
int is_func_definition;
formals_style style;
gen_decl (tree decl, int is_func_definition, formals_style style)
{
const char *ret_val;
......@@ -560,11 +548,8 @@ extern FILE *aux_info_file;
function definition (even the implicit ones). */
void
gen_aux_info_record (fndecl, is_definition, is_implicit, is_prototyped)
tree fndecl;
int is_definition;
int is_implicit;
int is_prototyped;
gen_aux_info_record (tree fndecl, int is_definition, int is_implicit,
int is_prototyped)
{
if (flag_gen_aux_info)
{
......
/* Language-level data type conversion for GNU C.
Copyright (C) 1987, 1988, 1991, 1998, 2002 Free Software Foundation, Inc.
Copyright (C) 1987, 1988, 1991, 1998, 2002, 2003
Free Software Foundation, Inc.
This file is part of GCC.
......@@ -62,8 +63,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
not permitted by the language being compiled. */
tree
convert (type, expr)
tree type, expr;
convert (tree type, tree expr)
{
tree e = expr;
enum tree_code code = TREE_CODE (type);
......
......@@ -45,35 +45,29 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif
/* Non-static as some targets don't use it. */
void builtin_define_std PARAMS ((const char *)) ATTRIBUTE_UNUSED;
static void builtin_define_with_value_n PARAMS ((const char *, const char *,
size_t));
static void builtin_define_with_int_value PARAMS ((const char *,
HOST_WIDE_INT));
static void builtin_define_with_hex_fp_value PARAMS ((const char *, tree,
int, const char *,
const char *));
static void builtin_define_type_max PARAMS ((const char *, tree, int));
static void builtin_define_type_precision PARAMS ((const char *, tree));
static void builtin_define_float_constants PARAMS ((const char *,
const char *, tree));
static void define__GNUC__ PARAMS ((void));
void builtin_define_std (const char *) ATTRIBUTE_UNUSED;
static void builtin_define_with_value_n (const char *, const char *,
size_t);
static void builtin_define_with_int_value (const char *, HOST_WIDE_INT);
static void builtin_define_with_hex_fp_value (const char *, tree,
int, const char *,
const char *);
static void builtin_define_type_max (const char *, tree, int);
static void builtin_define_type_precision (const char *, tree);
static void builtin_define_float_constants (const char *, const char *,
tree);
static void define__GNUC__ (void);
/* Define NAME with value TYPE precision. */
static void
builtin_define_type_precision (name, type)
const char *name;
tree type;
builtin_define_type_precision (const char *name, tree type)
{
builtin_define_with_int_value (name, TYPE_PRECISION (type));
}
/* Define the float.h constants for TYPE using NAME_PREFIX and FP_SUFFIX. */
static void
builtin_define_float_constants (name_prefix, fp_suffix, type)
const char *name_prefix;
const char *fp_suffix;
tree type;
builtin_define_float_constants (const char *name_prefix, const char *fp_suffix, tree type)
{
/* Used to convert radix-based values to base 10 values in several cases.
......@@ -107,7 +101,7 @@ builtin_define_float_constants (name_prefix, fp_suffix, type)
p radix b digits and back again without change to the q decimal digits,
p log10 b if b is a power of 10
floor((p - 1) log10 b) otherwise
floor((p - 1) log10 b) otherwise
*/
dig = (fmt->p - 1) * log10_b;
sprintf (name, "__%s_DIG__", name_prefix);
......@@ -166,7 +160,7 @@ builtin_define_float_constants (name_prefix, fp_suffix, type)
/* The number of decimal digits, n, such that any floating-point number
can be rounded to n decimal digits and back again without change to
the value.
the value.
p * log10(b) if b is a power of 10
ceil(1 + p * log10(b)) otherwise
......@@ -233,7 +227,7 @@ builtin_define_float_constants (name_prefix, fp_suffix, type)
/* For C++ std::numeric_limits<T>::has_infinity. */
sprintf (name, "__%s_HAS_INFINITY__", name_prefix);
builtin_define_with_int_value (name,
builtin_define_with_int_value (name,
MODE_HAS_INFINITIES (TYPE_MODE (type)));
/* For C++ std::numeric_limits<T>::has_quiet_NaN. We do not have a
predicate to distinguish a target that has both quiet and
......@@ -246,7 +240,7 @@ builtin_define_float_constants (name_prefix, fp_suffix, type)
/* Define __GNUC__, __GNUC_MINOR__ and __GNUC_PATCHLEVEL__. */
static void
define__GNUC__ ()
define__GNUC__ (void)
{
/* The format of the version string, enforced below, is
([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? */
......@@ -289,8 +283,7 @@ define__GNUC__ ()
/* Hook that registers front end and target-specific built-ins. */
void
c_cpp_builtins (pfile)
cpp_reader *pfile;
c_cpp_builtins (cpp_reader *pfile)
{
/* -undef turns off target-specific built-ins. */
if (flag_undef)
......@@ -357,7 +350,7 @@ c_cpp_builtins (pfile)
cpp_define (pfile, "_LP64");
cpp_define (pfile, "__LP64__");
}
/* Other target-independent built-ins determined by command-line
options. */
if (optimize_size)
......@@ -410,8 +403,7 @@ c_cpp_builtins (pfile)
"unix". Passing "_mips" defines "__mips", "__mips__" and possibly
"_mips". */
void
builtin_define_std (macro)
const char *macro;
builtin_define_std (const char *macro)
{
size_t len = strlen (macro);
char *buff = alloca (len + 5);
......@@ -450,10 +442,7 @@ builtin_define_std (macro)
parameter says whether or not to turn the value into a string
constant. */
void
builtin_define_with_value (macro, expansion, is_str)
const char *macro;
const char *expansion;
int is_str;
builtin_define_with_value (const char *macro, const char *expansion, int is_str)
{
char *buf;
size_t mlen = strlen (macro);
......@@ -475,14 +464,11 @@ builtin_define_with_value (macro, expansion, is_str)
/* Pass an object-like macro and a value to define it to. The third
parameter is the length of the expansion. */
static void
builtin_define_with_value_n (macro, expansion, elen)
const char *macro;
const char *expansion;
size_t elen;
builtin_define_with_value_n (const char *macro, const char *expansion, size_t elen)
{
char *buf;
size_t mlen = strlen (macro);
/* Space for an = and a NUL. */
buf = alloca (mlen + elen + 2);
memcpy (buf, macro, mlen);
......@@ -495,9 +481,7 @@ builtin_define_with_value_n (macro, expansion, elen)
/* Pass an object-like macro and an integer value to define it to. */
static void
builtin_define_with_int_value (macro, value)
const char *macro;
HOST_WIDE_INT value;
builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value)
{
char *buf;
size_t mlen = strlen (macro);
......@@ -514,12 +498,9 @@ builtin_define_with_int_value (macro, value)
/* Pass an object-like macro a hexadecimal floating-point value. */
static void
builtin_define_with_hex_fp_value (macro, type, digits, hex_str, fp_suffix)
const char *macro;
tree type ATTRIBUTE_UNUSED;
int digits;
const char *hex_str;
const char *fp_suffix;
builtin_define_with_hex_fp_value (const char *macro,
tree type ATTRIBUTE_UNUSED, int digits,
const char *hex_str, const char *fp_suffix)
{
REAL_VALUE_TYPE real;
char dec_str[64], buf[256];
......@@ -530,7 +511,7 @@ builtin_define_with_hex_fp_value (macro, type, digits, hex_str, fp_suffix)
pedwarn from the preprocessor, which has no context, so we can't
suppress the warning with __extension__.
So instead what we do is construct the number in hex (because
So instead what we do is construct the number in hex (because
it's easy to get the exact correct value), parse it as a real,
then print it back out as decimal. */
......@@ -546,10 +527,7 @@ builtin_define_with_hex_fp_value (macro, type, digits, hex_str, fp_suffix)
unsigned types, since wchar_t might be unsigned. */
static void
builtin_define_type_max (macro, type, is_long)
const char *macro;
tree type;
int is_long;
builtin_define_type_max (const char *macro, tree type, int is_long)
{
static const char *const values[]
= { "127", "255",
......
......@@ -30,9 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Dump information common to statements from STMT. */
void
dump_stmt (di, t)
dump_info_p di;
tree t;
dump_stmt (dump_info_p di, tree t)
{
dump_int (di, "line", STMT_LINENO (t));
}
......@@ -40,9 +38,7 @@ dump_stmt (di, t)
/* Dump the next statement after STMT. */
void
dump_next_stmt (di, t)
dump_info_p di;
tree t;
dump_next_stmt (dump_info_p di, tree t)
{
dump_child ("next", TREE_CHAIN (t));
}
......@@ -50,9 +46,7 @@ dump_next_stmt (di, t)
/* Dump any C-specific tree codes and attributes of common codes. */
bool
c_dump_tree (dump_info, t)
void *dump_info;
tree t;
c_dump_tree (void *dump_info, tree t)
{
enum tree_code code;
dump_info_p di = (dump_info_p) dump_info;
......
......@@ -34,8 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Set format warning options according to a -Wformat=n option. */
void
set_Wformat (setting)
int setting;
set_Wformat (int setting)
{
warn_format = setting;
warn_format_y2k = setting;
......@@ -67,9 +66,8 @@ typedef struct function_format_info
unsigned HOST_WIDE_INT first_arg_num; /* number of first arg (zero for varargs) */
} function_format_info;
static bool decode_format_attr PARAMS ((tree,
function_format_info *, int));
static enum format_type decode_format_type PARAMS ((const char *));
static bool decode_format_attr (tree, function_format_info *, int);
static enum format_type decode_format_type (const char *);
static bool check_format_string (tree argument,
unsigned HOST_WIDE_INT format_num,
......@@ -81,12 +79,8 @@ static bool get_constant (tree expr, unsigned HOST_WIDE_INT *value,
/* Handle a "format_arg" attribute; arguments as in
struct attribute_spec.handler. */
tree
handle_format_arg_attribute (node, name, args, flags, no_add_attrs)
tree *node;
tree name ATTRIBUTE_UNUSED;
tree args;
int flags;
bool *no_add_attrs;
handle_format_arg_attribute (tree *node, tree name ATTRIBUTE_UNUSED,
tree args, int flags, _Bool *no_add_attrs)
{
tree type = *node;
tree format_num_expr = TREE_VALUE (args);
......@@ -180,10 +174,7 @@ get_constant(tree expr, unsigned HOST_WIDE_INT *value, int validated_p)
successfully decoded, false otherwise. */
static bool
decode_format_attr (args, info, validated_p)
tree args;
function_format_info *info;
int validated_p;
decode_format_attr (tree args, function_format_info *info, int validated_p)
{
tree format_type_id = TREE_VALUE (args);
tree format_num_expr = TREE_VALUE (TREE_CHAIN (args));
......@@ -893,32 +884,30 @@ typedef struct
int *status;
} format_check_context;
static void check_format_info PARAMS ((int *, function_format_info *, tree));
static void check_format_arg PARAMS ((void *, tree, unsigned HOST_WIDE_INT));
static void check_format_info_main PARAMS ((int *, format_check_results *,
function_format_info *,
const char *, int, tree,
unsigned HOST_WIDE_INT));
static void status_warning PARAMS ((int *, const char *, ...))
static void check_format_info (int *, function_format_info *, tree);
static void check_format_arg (void *, tree, unsigned HOST_WIDE_INT);
static void check_format_info_main (int *, format_check_results *,
function_format_info *,
const char *, int, tree,
unsigned HOST_WIDE_INT);
static void status_warning (int *, const char *, ...)
ATTRIBUTE_PRINTF_2;
static void init_dollar_format_checking PARAMS ((int, tree));
static int maybe_read_dollar_number PARAMS ((int *, const char **, int,
tree, tree *,
const format_kind_info *));
static void finish_dollar_format_checking PARAMS ((int *, format_check_results *, int));
static void init_dollar_format_checking (int, tree);
static int maybe_read_dollar_number (int *, const char **, int,
tree, tree *, const format_kind_info *);
static void finish_dollar_format_checking (int *, format_check_results *, int);
static const format_flag_spec *get_flag_spec PARAMS ((const format_flag_spec *,
int, const char *));
static const format_flag_spec *get_flag_spec (const format_flag_spec *,
int, const char *);
static void check_format_types PARAMS ((int *, format_wanted_type *));
static void check_format_types (int *, format_wanted_type *);
/* Decode a format type from a string, returning the type, or
format_type_error if not valid, in which case the caller should print an
error message. */
static enum format_type
decode_format_type (s)
const char *s;
decode_format_type (const char *s)
{
int i;
int slen;
......@@ -945,10 +934,7 @@ decode_format_type (s)
attribute themselves. */
void
check_function_format (status, attrs, params)
int *status;
tree attrs;
tree params;
check_function_format (int *status, tree attrs, tree params)
{
tree a;
......@@ -1041,9 +1027,7 @@ static int dollar_format_warned;
function; PARAMS is the list of arguments starting at this argument. */
static void
init_dollar_format_checking (first_arg_num, params)
int first_arg_num;
tree params;
init_dollar_format_checking (int first_arg_num, tree params)
{
tree oparams = params;
......@@ -1098,14 +1082,9 @@ init_dollar_format_checking (first_arg_num, params)
a $ format is found, *FORMAT is updated to point just after it. */
static int
maybe_read_dollar_number (status, format, dollar_needed, params, param_ptr,
fki)
int *status;
const char **format;
int dollar_needed;
tree params;
tree *param_ptr;
const format_kind_info *fki;
maybe_read_dollar_number (int *status, const char **format,
int dollar_needed, tree params, tree *param_ptr,
const format_kind_info *fki)
{
int argnum;
int overflow_flag;
......@@ -1210,10 +1189,7 @@ maybe_read_dollar_number (status, format, dollar_needed, params, param_ptr,
pointers. */
static void
finish_dollar_format_checking (status, res, pointer_gap_ok)
int *status;
format_check_results *res;
int pointer_gap_ok;
finish_dollar_format_checking (int *status, format_check_results *res, int pointer_gap_ok)
{
int i;
bool found_pointer_gap = false;
......@@ -1248,10 +1224,7 @@ finish_dollar_format_checking (status, res, pointer_gap_ok)
of these is found, it is returned, otherwise NULL is returned. */
static const format_flag_spec *
get_flag_spec (spec, flag, predicates)
const format_flag_spec *spec;
int flag;
const char *predicates;
get_flag_spec (const format_flag_spec *spec, int flag, const char *predicates)
{
int i;
for (i = 0; spec[i].flag_char != 0; i++)
......@@ -1279,10 +1252,7 @@ get_flag_spec (spec, flag, predicates)
PARAMS is the list of argument values. */
static void
check_format_info (status, info, params)
int *status;
function_format_info *info;
tree params;
check_format_info (int *status, function_format_info *info, tree params)
{
format_check_context format_ctx;
unsigned HOST_WIDE_INT arg_num;
......@@ -1380,10 +1350,8 @@ check_format_info (status, info, params)
format_check_context. */
static void
check_format_arg (ctx, format_tree, arg_num)
void *ctx;
tree format_tree;
unsigned HOST_WIDE_INT arg_num;
check_format_arg (void *ctx, tree format_tree,
unsigned HOST_WIDE_INT arg_num)
{
format_check_context *format_ctx = ctx;
format_check_results *res = format_ctx->res;
......@@ -1539,15 +1507,10 @@ check_format_arg (ctx, format_tree, arg_num)
argument in the list of arguments. */
static void
check_format_info_main (status, res, info, format_chars, format_length,
params, arg_num)
int *status;
format_check_results *res;
function_format_info *info;
const char *format_chars;
int format_length;
tree params;
unsigned HOST_WIDE_INT arg_num;
check_format_info_main (int *status, format_check_results *res,
function_format_info *info, const char *format_chars,
int format_length, tree params,
unsigned HOST_WIDE_INT arg_num)
{
const char *orig_format_chars = format_chars;
tree first_fillin_param = params;
......@@ -2170,9 +2133,7 @@ check_format_info_main (status, res, info, format_chars, format_length,
/* Check the argument types from a single format conversion (possibly
including width and precision arguments). */
static void
check_format_types (status, types)
int *status;
format_wanted_type *types;
check_format_types (int *status, format_wanted_type *types)
{
for (; types != 0; types = types->next)
{
......@@ -2433,12 +2394,8 @@ init_dynamic_asm_fprintf_info (void)
/* Handle a "format" attribute; arguments as in
struct attribute_spec.handler. */
tree
handle_format_attribute (node, name, args, flags, no_add_attrs)
tree *node;
tree name ATTRIBUTE_UNUSED;
tree args;
int flags;
bool *no_add_attrs;
handle_format_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
int flags, _Bool *no_add_attrs)
{
tree type = *node;
function_format_info info;
......
......@@ -43,13 +43,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# define INO_T_COPY(DEST, SRC) (DEST) = (SRC)
#endif
static void add_env_var_paths PARAMS ((const char *, int));
static void add_standard_paths PARAMS ((const char *, const char *, int));
static void free_path PARAMS ((struct cpp_path *, int));
static void merge_include_chains PARAMS ((cpp_reader *, int));
static struct cpp_path *
remove_duplicates PARAMS ((cpp_reader *, struct cpp_path *,
struct cpp_path *, struct cpp_path *, int));
static void add_env_var_paths (const char *, int);
static void add_standard_paths (const char *, const char *, int);
static void free_path (struct cpp_path *, int);
static void merge_include_chains (cpp_reader *, int);
static struct cpp_path *remove_duplicates (cpp_reader *, struct cpp_path *,
struct cpp_path *,
struct cpp_path *, int);
/* Include chains heads and tails. */
static struct cpp_path *heads[4];
......@@ -59,9 +59,7 @@ enum { REASON_QUIET = 0, REASON_NOENT, REASON_DUP, REASON_DUP_SYS };
/* Free an element of the include chain, possibly giving a reason. */
static void
free_path (path, reason)
struct cpp_path *path;
int reason;
free_path (struct cpp_path *path, int reason)
{
switch (reason)
{
......@@ -90,9 +88,7 @@ free_path (path, reason)
/* Read ENV_VAR for a PATH_SEPARATOR-separated list of file names; and
append all the names to the search path CHAIN. */
static void
add_env_var_paths (env_var, chain)
const char *env_var;
int chain;
add_env_var_paths (const char *env_var, int chain)
{
char *p, *q, *path;
......@@ -122,9 +118,7 @@ add_env_var_paths (env_var, chain)
/* Append the standard include chain defined in cppdefault.c. */
static void
add_standard_paths (sysroot, iprefix, cxx_stdinc)
const char *sysroot, *iprefix;
int cxx_stdinc;
add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc)
{
const struct default_include *p;
size_t len;
......@@ -176,12 +170,9 @@ add_standard_paths (sysroot, iprefix, cxx_stdinc)
removed. Return the head of the resulting chain. Any of HEAD,
JOIN and SYSTEM can be NULL. */
static struct cpp_path *
remove_duplicates (pfile, head, system, join, verbose)
cpp_reader *pfile;
struct cpp_path *head;
struct cpp_path *system;
struct cpp_path *join;
int verbose;
remove_duplicates (cpp_reader *pfile, struct cpp_path *head,
struct cpp_path *system, struct cpp_path *join,
int verbose)
{
struct cpp_path **pcur, *tmp, *cur;
struct stat st;
......@@ -255,9 +246,7 @@ remove_duplicates (pfile, head, system, join, verbose)
to treat -Ibar -Ifoo -I- -Ifoo -Iquux as if written -Ibar -I- -Ifoo
-Iquux. */
static void
merge_include_chains (pfile, verbose)
cpp_reader *pfile;
int verbose;
merge_include_chains (cpp_reader *pfile, int verbose)
{
/* Join the SYSTEM and AFTER chains. Remove duplicates in the
resulting SYSTEM chain. */
......@@ -300,7 +289,7 @@ merge_include_chains (pfile, verbose)
(Note that -I. -I- is not the same as the default setup; -I. uses
the compiler's working dir.) */
void
split_quote_chain ()
split_quote_chain (void)
{
heads[QUOTE] = heads[BRACKET];
tails[QUOTE] = tails[BRACKET];
......@@ -313,10 +302,7 @@ split_quote_chain ()
/* Add PATH to the include chain CHAIN. PATH must be malloc-ed and
NUL-terminated. */
void
add_path (path, chain, cxx_aware)
char *path;
int chain;
int cxx_aware;
add_path (char *path, int chain, int cxx_aware)
{
struct cpp_path *p;
......@@ -338,11 +324,9 @@ add_path (path, chain, cxx_aware)
/* Exported function to handle include chain merging, duplicate
removal, and registration with cpplib. */
void
register_include_chains (pfile, sysroot, iprefix,
stdinc, cxx_stdinc, verbose)
cpp_reader *pfile;
const char *sysroot, *iprefix;
int stdinc, cxx_stdinc, verbose;
register_include_chains (cpp_reader *pfile, const char *sysroot,
const char *iprefix, int stdinc, int cxx_stdinc,
int verbose)
{
static const char *const lang_env_vars[] =
{ "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH",
......
......@@ -15,9 +15,9 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern void split_quote_chain PARAMS ((void));
extern void add_path PARAMS ((char *, int, int));
extern void register_include_chains PARAMS ((cpp_reader *, const char *,
const char *, int, int, int));
extern void split_quote_chain (void);
extern void add_path (char *, int, int);
extern void register_include_chains (cpp_reader *, const char *,
const char *, int, int, int);
enum { QUOTE = 0, BRACKET, SYSTEM, AFTER };
......@@ -49,7 +49,7 @@ typedef struct align_stack GTY(())
static GTY(()) struct align_stack * alignment_stack;
#ifdef HANDLE_PRAGMA_PACK
static void handle_pragma_pack PARAMS ((cpp_reader *));
static void handle_pragma_pack (cpp_reader *);
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
/* If we have a "global" #pragma pack(<n>) in effect when the first
......@@ -61,14 +61,12 @@ static int default_alignment;
#define SET_GLOBAL_ALIGNMENT(ALIGN) \
(default_alignment = maximum_field_alignment = (ALIGN))
static void push_alignment PARAMS ((int, tree));
static void pop_alignment PARAMS ((tree));
static void push_alignment (int, tree);
static void pop_alignment (tree);
/* Push an alignment value onto the stack. */
static void
push_alignment (alignment, id)
int alignment;
tree id;
push_alignment (int alignment, tree id)
{
if (alignment_stack == NULL
|| alignment_stack->alignment != alignment
......@@ -99,8 +97,7 @@ push_alignment (alignment, id)
/* Undo a push of an alignment onto the stack. */
static void
pop_alignment (id)
tree id;
pop_alignment (tree id)
{
align_stack * entry;
......@@ -157,8 +154,7 @@ pop_alignment (id)
#pragma pack (pop)
#pragma pack (pop, ID) */
static void
handle_pragma_pack (dummy)
cpp_reader *dummy ATTRIBUTE_UNUSED;
handle_pragma_pack (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
tree x, id = 0;
int align = -1;
......@@ -261,12 +257,11 @@ handle_pragma_pack (dummy)
static GTY(()) tree pending_weaks;
#ifdef HANDLE_PRAGMA_WEAK
static void apply_pragma_weak PARAMS ((tree, tree));
static void handle_pragma_weak PARAMS ((cpp_reader *));
static void apply_pragma_weak (tree, tree);
static void handle_pragma_weak (cpp_reader *);
static void
apply_pragma_weak (decl, value)
tree decl, value;
apply_pragma_weak (tree decl, tree value)
{
if (value)
{
......@@ -285,8 +280,7 @@ apply_pragma_weak (decl, value)
}
void
maybe_apply_pragma_weak (decl)
tree decl;
maybe_apply_pragma_weak (tree decl)
{
tree *p, t, id;
......@@ -311,8 +305,7 @@ maybe_apply_pragma_weak (decl)
/* #pragma weak name [= value] */
static void
handle_pragma_weak (dummy)
cpp_reader *dummy ATTRIBUTE_UNUSED;
handle_pragma_weak (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
tree name, value, x, decl;
enum cpp_ttype t;
......@@ -343,8 +336,7 @@ handle_pragma_weak (dummy)
}
#else
void
maybe_apply_pragma_weak (decl)
tree decl ATTRIBUTE_UNUSED;
maybe_apply_pragma_weak (tree decl ATTRIBUTE_UNUSED)
{
}
#endif /* HANDLE_PRAGMA_WEAK */
......@@ -352,12 +344,11 @@ maybe_apply_pragma_weak (decl)
static GTY(()) tree pending_redefine_extname;
#ifdef HANDLE_PRAGMA_REDEFINE_EXTNAME
static void handle_pragma_redefine_extname PARAMS ((cpp_reader *));
static void handle_pragma_redefine_extname (cpp_reader *);
/* #pragma redefined_extname oldname newname */
static void
handle_pragma_redefine_extname (dummy)
cpp_reader *dummy ATTRIBUTE_UNUSED;
handle_pragma_redefine_extname (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
tree oldname, newname, decl, x;
enum cpp_ttype t;
......@@ -390,8 +381,7 @@ handle_pragma_redefine_extname (dummy)
#endif
void
add_to_renaming_pragma_list (oldname, newname)
tree oldname, newname;
add_to_renaming_pragma_list (tree oldname, tree newname)
{
pending_redefine_extname
= tree_cons (oldname, newname, pending_redefine_extname);
......@@ -400,12 +390,11 @@ add_to_renaming_pragma_list (oldname, newname)
static GTY(()) tree pragma_extern_prefix;
#ifdef HANDLE_PRAGMA_EXTERN_PREFIX
static void handle_pragma_extern_prefix PARAMS ((cpp_reader *));
static void handle_pragma_extern_prefix (cpp_reader *);
/* #pragma extern_prefix "prefix" */
static void
handle_pragma_extern_prefix (dummy)
cpp_reader *dummy ATTRIBUTE_UNUSED;
handle_pragma_extern_prefix (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
tree prefix, x;
enum cpp_ttype t;
......@@ -428,8 +417,7 @@ handle_pragma_extern_prefix (dummy)
pragmas that rename variables. */
tree
maybe_apply_renaming_pragma (decl, asmname)
tree decl, asmname;
maybe_apply_renaming_pragma (tree decl, tree asmname)
{
tree oldname;
......@@ -486,17 +474,15 @@ maybe_apply_renaming_pragma (decl, asmname)
/* Front-end wrapper for pragma registration to avoid dragging
cpplib.h in almost everywhere. */
void
c_register_pragma (space, name, handler)
const char *space;
const char *name;
void (*handler) PARAMS ((struct cpp_reader *));
c_register_pragma (const char *space, const char *name,
void (*handler) (struct cpp_reader *))
{
cpp_register_pragma (parse_in, space, name, handler);
}
/* Set up front-end pragmas. */
void
init_pragma ()
init_pragma (void)
{
#ifdef HANDLE_PRAGMA_PACK
c_register_pragma (0, "pack", handle_pragma_pack);
......
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