From 5671bf2771a1e85652ae0ef8b1bdc5586bd9a654 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 7 Jul 2003 21:11:59 +0200 Subject: [PATCH] genextract.c: Convert remaining prototypes to ISO C90. 2003-07-07 Andreas Jaeger * genextract.c: Convert remaining prototypes to ISO C90. * cpplex.c (_cpp_free_buff): Convert prototype to ISO C90. * fold-const.c (fold_single_bit_test): Likewise. * diagnostic.c (default_diagnostic_finalizer): Likewise. * cfgrtl.c (rtl_redirect_edge_and_branch): Likewise. * gengtype.c (write_array): Generate ISO C90 prototypes. * genflags.c (gen_proto): Generate ISO C90 prototypes. For cp: 2003-07-07 Andreas Jaeger * friend.c: Convert to ISO C90 prototypes. * Make-lang.in ($(srcdir)/cp/cfns.h): Use ANSI-C as output language. * cfns.h: Regenerate. * typeck.c: Convert remaining prototypes to ISO C90. * search.c: Likewise. * decl2.c (build_expr_from_tree): Convert prototype to ISO C90. * semantics.c (expand_or_defer_fn): Likewise * mangle.c (discriminator_for_string_literal): Likewise. * g++spec.c (lang_specific_driver): Likewise. * search.c (lookup_base_r): Remove unused variable. From-SVN: r69050 --- gcc/ChangeLog | 13 ++++++++ gcc/cfgrtl.c | 4 +-- gcc/cp/ChangeLog | 18 ++++++++++ gcc/cp/Make-lang.in | 2 +- gcc/cp/cfns.h | 12 +++---- gcc/cp/decl2.c | 3 +- gcc/cp/g++spec.c | 6 ++-- gcc/cp/mangle.c | 5 ++- gcc/cp/search.c | 9 ++--- gcc/cp/semantics.c | 3 +- gcc/cp/typeck.c | 81 ++++++++++++++------------------------------- gcc/cpplex.c | 3 +- gcc/diagnostic.c | 5 ++- gcc/fold-const.c | 7 ++-- gcc/genextract.c | 7 ++-- gcc/genflags.c | 8 ++--- gcc/gengtype.c | 12 +++---- gcc/regmove.c | 3 +- 18 files changed, 86 insertions(+), 115 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c5e3dfdb5f99..5543c98f8c47 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2003-07-07 Andreas Jaeger + + * genextract.c: Convert remaining prototypes to ISO C90. + + * cpplex.c (_cpp_free_buff): Convert prototype to ISO C90. + * fold-const.c (fold_single_bit_test): Likewise. + * diagnostic.c (default_diagnostic_finalizer): Likewise. + * cfgrtl.c (rtl_redirect_edge_and_branch): Likewise. + + * gengtype.c (write_array): Generate ISO C90 prototypes. + + * genflags.c (gen_proto): Generate ISO C90 prototypes. + 2003-07-07 Roger Sayle PR optimization/11059 diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 09e2e1c93951..d197b79380a1 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -936,9 +936,7 @@ redirect_branch_edge (edge e, basic_block target) stream. */ static bool -rtl_redirect_edge_and_branch (e, target) - edge e; - basic_block target; +rtl_redirect_edge_and_branch (edge e, basic_block target) { if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)) return false; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9ad4f9811657..8da2d01a4c36 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,21 @@ +2003-07-07 Andreas Jaeger + + * friend.c: Convert to ISO C90 prototypes. + + * Make-lang.in ($(srcdir)/cp/cfns.h): Use ANSI-C as output + language. + * cfns.h: Regenerate. + + * typeck.c: Convert remaining prototypes to ISO C90. + * search.c: Likewise. + + * decl2.c (build_expr_from_tree): Convert prototype to ISO C90. + * semantics.c (expand_or_defer_fn): Likewise + * mangle.c (discriminator_for_string_literal): Likewise. + * g++spec.c (lang_specific_driver): Likewise. + + * search.c (lookup_base_r): Remove unused variable. + 2003-07-07 Nathan Sidwell * semantics.c: (genrtl_try_block) Adjust emit_line_note diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index d6b871a981d0..df1d8a792165 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -99,7 +99,7 @@ cc1plus$(exeext): $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) \ # Special build rules. $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf - gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' \ + gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ $(srcdir)/cp/cfns.gperf > $(srcdir)/cp/cfns.h gtype-cp.h gt-cp-call.h gt-cp-decl.h gt-cp-decl2.h : s-gtype; @true diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h index 8f8f3eaa35a9..415518bf8547 100644 --- a/gcc/cp/cfns.h +++ b/gcc/cp/cfns.h @@ -1,5 +1,5 @@ -/* C code produced by gperf version 2.7.2 */ -/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p ../../../src-gcc/gcc/cp/cfns.gperf */ +/* ANSI-C code produced by gperf version 2.7.2 */ +/* Command-line: gperf -o -L ANSI-C -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cp/cfns.gperf */ #ifdef __GNUC__ __inline #endif @@ -18,9 +18,7 @@ inline #endif #endif static unsigned int -hash (str, len) - register const char *str; - register unsigned int len; +hash (register const char *str, register unsigned int len) { static const unsigned short asso_values[] = { @@ -77,9 +75,7 @@ hash (str, len) __inline #endif const char * -libc_name_p (str, len) - register const char *str; - register unsigned int len; +libc_name_p (register const char *str, register unsigned int len) { enum { diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 661786d036cc..39f6ca553691 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2942,8 +2942,7 @@ finish_file () performing semantic analysis. */ tree -build_expr_from_tree (t) - tree t; +build_expr_from_tree (tree t) { if (t == NULL_TREE || t == error_mark_node) return t; diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 1850db421d7e..26bc383799d1 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -47,10 +47,8 @@ Boston, MA 02111-1307, USA. */ #endif void -lang_specific_driver (in_argc, in_argv, in_added_libraries) - int *in_argc; - const char *const **in_argv; - int *in_added_libraries; +lang_specific_driver (int *in_argc, const char *const **in_argv, + int *in_added_libraries) { int i, j; diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 48ad68b47c92..49a956886a71 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1333,9 +1333,8 @@ discriminator_for_local_entity (tree entity) string literals used in FUNCTION. */ static int -discriminator_for_string_literal (function, string) - tree function ATTRIBUTE_UNUSED; - tree string ATTRIBUTE_UNUSED; +discriminator_for_string_literal (tree function ATTRIBUTE_UNUSED, + tree string ATTRIBUTE_UNUSED) { /* For now, we don't discriminate amongst string literals. */ return 0; diff --git a/gcc/cp/search.c b/gcc/cp/search.c index b53784de427d..cee35ff2d525 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -43,10 +43,8 @@ static struct obstack search_obstack; /* Methods for pushing and popping objects to and from obstacks. */ struct stack_level * -push_stack_level (obstack, tp, size) - struct obstack *obstack; - char *tp; /* Sony NewsOS 5.0 compiler doesn't like void * here. */ - int size; +push_stack_level (struct obstack *obstack, char *tp,/* Sony NewsOS 5.0 compiler doesn't like void * here. */ + int size) { struct stack_level *stack; obstack_grow (obstack, tp, size); @@ -59,8 +57,7 @@ push_stack_level (obstack, tp, size) } struct stack_level * -pop_stack_level (stack) - struct stack_level *stack; +pop_stack_level (struct stack_level *stack) { struct stack_level *tem = stack; struct obstack *obstack = tem->obstack; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 599aa1677601..9301e6595361 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2351,8 +2351,7 @@ expand_body (tree fn) /* Generate RTL for FN. */ void -expand_or_defer_fn (fn) - tree fn; +expand_or_defer_fn (tree fn) { /* When the parser calls us after finishing the body of a template function, we don't really want to expand the body. When we're diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index b2a674cd1cc0..5be6aa886029 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -166,8 +166,7 @@ complete_type_or_diagnostic (tree type, tree value, int diag_type) /* Return truthvalue of whether type of EXP is instantiated. */ int -type_unknown_p (exp) - tree exp; +type_unknown_p (tree exp) { return (TREE_CODE (exp) == OVERLOAD || TREE_CODE (exp) == TREE_LIST @@ -185,8 +184,7 @@ type_unknown_p (exp) signatures of T1 and T2: [expr.rel], [expr.eq]. */ static tree -qualify_type_recursive (t1, t2) - tree t1, t2; +qualify_type_recursive (tree t1, tree t2) { if ((TYPE_PTR_P (t1) && TYPE_PTR_P (t2)) || (TYPE_PTRMEM_P (t1) && TYPE_PTRMEM_P (t2))) @@ -231,8 +229,7 @@ qualify_type_recursive (t1, t2) lists are already common. */ tree -commonparms (p1, p2) - tree p1, p2; +commonparms (tree p1, tree p2) { tree oldargs = p1, newargs, n; int i, len; @@ -293,8 +290,7 @@ commonparms (p1, p2) /* Given a type, perhaps copied for a typedef, find the "original" version of it. */ tree -original_type (t) - tree t; +original_type (tree t) { while (TYPE_NAME (t) != NULL_TREE) { @@ -314,9 +310,7 @@ original_type (t) T2 as described in [expr]. */ tree -type_after_usual_arithmetic_conversions (t1, t2) - tree t1; - tree t2; +type_after_usual_arithmetic_conversions (tree t1, tree t2) { enum tree_code code1 = TREE_CODE (t1); enum tree_code code2 = TREE_CODE (t2); @@ -459,12 +453,8 @@ type_after_usual_arithmetic_conversions (t1, t2) string describing the current location, in case an error occurs. */ tree -composite_pointer_type (t1, t2, arg1, arg2, location) - tree t1; - tree t2; - tree arg1; - tree arg2; - const char* location; +composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2, + const char* location) { tree result_type; tree attributes; @@ -547,8 +537,7 @@ composite_pointer_type (t1, t2, arg1, arg2, location) differences would cause the two types to compare unalike. */ tree -merge_types (t1, t2) - tree t1, t2; +merge_types (tree t1, tree t2) { register enum tree_code code1; register enum tree_code code2; @@ -695,8 +684,7 @@ merge_types (t1, t2) if the operands have the given two types. */ tree -common_type (t1, t2) - tree t1, t2; +common_type (tree t1, tree t2) { enum tree_code code1; enum tree_code code2; @@ -2210,9 +2198,7 @@ build_ptrmemfunc_access_expr (tree ptrmem, tree member_name) Must also handle REFERENCE_TYPEs for C++. */ tree -build_x_indirect_ref (ptr, errorstring) - tree ptr; - const char *errorstring; +build_x_indirect_ref (tree ptr, const char *errorstring) { tree rval; @@ -2227,9 +2213,7 @@ build_x_indirect_ref (ptr, errorstring) } tree -build_indirect_ref (ptr, errorstring) - tree ptr; - const char *errorstring; +build_indirect_ref (tree ptr, const char *errorstring) { register tree pointer, type; @@ -2309,8 +2293,7 @@ build_indirect_ref (ptr, errorstring) will inherit the type of the array, which will be some pointer type. */ tree -build_array_ref (array, idx) - tree array, idx; +build_array_ref (tree array, tree idx) { if (idx == 0) { @@ -2466,9 +2449,7 @@ build_array_ref (array, idx) later has the right member. */ tree -get_member_function_from_ptrfunc (instance_ptrptr, function) - tree *instance_ptrptr; - tree function; +get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function) { if (TREE_CODE (function) == OFFSET_REF) function = TREE_OPERAND (function, 1); @@ -2570,8 +2551,7 @@ get_member_function_from_ptrfunc (instance_ptrptr, function) } tree -build_function_call (function, params) - tree function, params; +build_function_call (tree function, tree params) { register tree fntype, fndecl; register tree coerced_params; @@ -2689,9 +2669,7 @@ build_function_call (function, params) default arguments, if such were specified. Do so here. */ tree -convert_arguments (typelist, values, fndecl, flags) - tree typelist, values, fndecl; - int flags; +convert_arguments (tree typelist, tree values, tree fndecl, int flags) { register tree typetail, valtail; register tree result = NULL_TREE; @@ -2848,9 +2826,7 @@ convert_arguments (typelist, values, fndecl, flags) conversions on the operands. CODE is the kind of expression to build. */ tree -build_x_binary_op (code, arg1, arg2) - enum tree_code code; - tree arg1, arg2; +build_x_binary_op (enum tree_code code, tree arg1, tree arg2) { if (processing_template_decl) return build_min_nt (code, arg1, arg2); @@ -3057,10 +3033,8 @@ build_template_expr (enum tree_code code, tree op0, tree op1, tree op2) multiple inheritance, and deal with pointer to member functions. */ tree -build_binary_op (code, orig_op0, orig_op1, convert_p) - enum tree_code code; - tree orig_op0, orig_op1; - int convert_p ATTRIBUTE_UNUSED; +build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, + int convert_p ATTRIBUTE_UNUSED) { tree op0, op1; register enum tree_code code0, code1; @@ -3792,9 +3766,8 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) of pointer PTROP and integer INTOP. */ static tree -cp_pointer_int_sum (resultcode, ptrop, intop) - enum tree_code resultcode; - register tree ptrop, intop; +cp_pointer_int_sum (enum tree_code resultcode, register tree ptrop, + register tree intop) { tree res_type = TREE_TYPE (ptrop); @@ -3812,9 +3785,7 @@ cp_pointer_int_sum (resultcode, ptrop, intop) The resulting tree has type int. */ static tree -pointer_diff (op0, op1, ptrtype) - register tree op0, op1; - register tree ptrtype; +pointer_diff (register tree op0, register tree op1, register tree ptrtype) { register tree result, folded; tree restype = ptrdiff_type_node; @@ -3868,9 +3839,7 @@ pointer_diff (op0, op1, ptrtype) and XARG is the operand. */ tree -build_x_unary_op (code, xarg) - enum tree_code code; - tree xarg; +build_x_unary_op (enum tree_code code, tree xarg) { tree exp; int ptrmem = 0; @@ -3947,8 +3916,7 @@ build_x_unary_op (code, xarg) -1. */ tree -cp_truthvalue_conversion (expr) - tree expr; +cp_truthvalue_conversion (tree expr) { tree type = TREE_TYPE (expr); if (TYPE_PTRMEM_P (type)) @@ -3960,8 +3928,7 @@ cp_truthvalue_conversion (expr) /* Just like cp_truthvalue_conversion, but we want a CLEANUP_POINT_EXPR. */ tree -condition_conversion (expr) - tree expr; +condition_conversion (tree expr) { tree t; if (processing_template_decl) diff --git a/gcc/cpplex.c b/gcc/cpplex.c index edb765dc61b4..463064546fdd 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -1422,8 +1422,7 @@ _cpp_extend_buff (cpp_reader *pfile, _cpp_buff **pbuff, size_t min_extra) /* Free a chain of buffers starting at BUFF. */ void -_cpp_free_buff (buff) - _cpp_buff *buff; +_cpp_free_buff (_cpp_buff *buff) { _cpp_buff *next; diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 29cfaabe8783..c9bef1a7e4a8 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -1004,9 +1004,8 @@ default_diagnostic_starter (diagnostic_context *context, } static void -default_diagnostic_finalizer (context, diagnostic) - diagnostic_context *context; - diagnostic_info *diagnostic __attribute__((unused)); +default_diagnostic_finalizer (diagnostic_context *context, + diagnostic_info *diagnostic __attribute__((unused))) { output_destroy_prefix (&context->buffer); } diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 64a30f4b8252..e4f57b8cfa32 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -4784,11 +4784,8 @@ fold_inf_compare (enum tree_code code, tree type, tree arg0, tree arg1) NULL. TYPE is the desired result type. */ tree -fold_single_bit_test (code, arg0, arg1, result_type) - enum tree_code code; - tree arg0; - tree arg1; - tree result_type; +fold_single_bit_test (enum tree_code code, tree arg0, tree arg1, + tree result_type) { /* If this is a TRUTH_NOT_EXPR, it may have a single bit test inside operand 0. */ diff --git a/gcc/genextract.c b/gcc/genextract.c index cf2f2ab50fd0..ef53050fbca7 100644 --- a/gcc/genextract.c +++ b/gcc/genextract.c @@ -490,8 +490,7 @@ from the machine description file `md'. */\n\n"); /* Define this so we can link with print-rtl.o to get debug_rtx function. */ const char * -get_insn_name (code) - int code ATTRIBUTE_UNUSED; +get_insn_name (int code ATTRIBUTE_UNUSED) { if (code < insn_name_ptr_size) return insn_name_ptr[code]; @@ -500,9 +499,7 @@ get_insn_name (code) } static void -record_insn_name (code, name) - int code; - const char *name; +record_insn_name (int code, const char *name) { static const char *last_real_name = "insn"; static int last_real_code = 0; diff --git a/gcc/genflags.c b/gcc/genflags.c index 1eb3a730823b..268da76ee671 100644 --- a/gcc/genflags.c +++ b/gcc/genflags.c @@ -179,13 +179,11 @@ gen_proto (rtx insn) { putchar ('('); for (i = 0; i < num-1; i++) - printf ("%c, ", 'a' + i); - printf ("%c)\n", 'a' + i); - for (i = 0; i < num; i++) - printf (" rtx %c ATTRIBUTE_UNUSED;\n", 'a' + i); + printf ("rtx %c ATTRIBUTE_UNUSED, ", 'a' + i); + printf ("rtx %c ATTRIBUTE_UNUSED)\n", 'a' + i); } else - puts ("()"); + puts ("(void)"); puts ("{\n return 0;\n}"); } diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 101b37825114..79e763cc7e17 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -2623,12 +2623,11 @@ write_array (outf_p f, pair_p v, const struct write_types_data *wtd) oprintf (f, "static void gt_%sa_%s\n", wtd->param_prefix, v->name); oprintf (f, " (void *, void *, gt_pointer_operator, void *);\n"); - oprintf (f, "static void gt_%sa_%s (this_obj, x_p, op, cookie)\n", + oprintf (f, "static void gt_%sa_%s (void *this_obj ATTRIBUTE_UNUSED,\n", wtd->param_prefix, v->name); - oprintf (d.of, " void *this_obj ATTRIBUTE_UNUSED;\n"); - oprintf (d.of, " void *x_p ATTRIBUTE_UNUSED;\n"); - oprintf (d.of, " gt_pointer_operator op ATTRIBUTE_UNUSED;\n"); - oprintf (d.of, " void *cookie ATTRIBUTE_UNUSED;\n"); + oprintf (d.of, " void *x_p ATTRIBUTE_UNUSED,\n"); + oprintf (d.of, " gt_pointer_operator op ATTRIBUTE_UNUSED,\n"); + oprintf (d.of, " void *cookie ATTRIBUTE_UNUSED)\n"); oprintf (d.of, "{\n"); d.prev_val[0] = d.prev_val[1] = d.prev_val[2] = d.val = v->name; d.process_field = write_types_local_process_field; @@ -2639,9 +2638,8 @@ write_array (outf_p f, pair_p v, const struct write_types_data *wtd) d.opt = v->opt; oprintf (f, "static void gt_%sa_%s (void *);\n", wtd->prefix, v->name); - oprintf (f, "static void\ngt_%sa_%s (x_p)\n", + oprintf (f, "static void\ngt_%sa_%s (void *x_p ATTRIBUTE_UNUSED)\n", wtd->prefix, v->name); - oprintf (f, " void *x_p ATTRIBUTE_UNUSED;\n"); oprintf (f, "{\n"); d.prev_val[0] = d.prev_val[1] = d.prev_val[2] = d.val = v->name; d.process_field = write_types_process_field; diff --git a/gcc/regmove.c b/gcc/regmove.c index 7085ce8696b6..cfc45f4ee53b 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -360,8 +360,7 @@ replacement_quality (rtx reg) /* Return 1 if INSN might end a basic block. */ -static int perhaps_ends_bb_p (insn) - rtx insn; +static int perhaps_ends_bb_p (rtx insn) { switch (GET_CODE (insn)) { -- 2.43.5