Commit 8376cf3d by Andreas Jaeger Committed by Andreas Jaeger

treetree.c: Convert remaining K&R prototypes to ISO C90.

treelang:
	* treetree.c: Convert remaining K&R prototypes to ISO C90.
	* tree1.c: Likewise.
	* parse.y: Likewise.
	* tree-convert.c: Likewise.

java:

	* jvspec.c: Convert to ISO C90 prototypes.

From-SVN: r69881
parent 30c3de1f
2003-07-28 Andreas Jaeger <aj@suse.de>
* jvspec.c: Convert to ISO C90 prototypes.
2003-07-25 Nathan Sidwell <nathan@codesourcery.com> 2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (force_poplevels): Fix warning call. * decl.c (force_poplevels): Fix warning call.
......
...@@ -84,8 +84,7 @@ static const char jvgenmain_spec[] = ...@@ -84,8 +84,7 @@ static const char jvgenmain_spec[] =
/* Return full path name of spec file if it is in DIR, or NULL if /* Return full path name of spec file if it is in DIR, or NULL if
not. */ not. */
static char * static char *
find_spec_file (dir) find_spec_file (const char *dir)
const char *dir;
{ {
char *spec; char *spec;
int x; int x;
...@@ -116,8 +115,7 @@ find_spec_file (dir) ...@@ -116,8 +115,7 @@ find_spec_file (dir)
/* Verify that NAME is a valid Java class name that might contain /* Verify that NAME is a valid Java class name that might contain
`main'. Return 0 on failure. */ `main'. Return 0 on failure. */
static int static int
verify_class_name (name) verify_class_name (const char *name)
const char *name;
{ {
/* FIXME: what encoding do we use for command-line arguments? For /* FIXME: what encoding do we use for command-line arguments? For
now we assume plain ASCII, which of course is wrong. */ now we assume plain ASCII, which of course is wrong. */
...@@ -144,10 +142,8 @@ verify_class_name (name) ...@@ -144,10 +142,8 @@ verify_class_name (name)
} }
void void
lang_specific_driver (in_argc, in_argv, in_added_libraries) lang_specific_driver (int *in_argc, const char *const **in_argv,
int *in_argc; int *in_added_libraries)
const char *const **in_argv;
int *in_added_libraries;
{ {
int i, j; int i, j;
...@@ -600,7 +596,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -600,7 +596,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
} }
int int
lang_specific_pre_link () lang_specific_pre_link (void)
{ {
int err; int err;
if (main_class_name == NULL) if (main_class_name == NULL)
......
2003-07-28 Andreas Jaeger <aj@suse.de>
* treetree.c: Convert remaining K&R prototypes to ISO C90.
* tree1.c: Likewise.
* parse.y: Likewise.
* tree-convert.c: Likewise.
2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* treetree.c: Remove unnecessary casts. * treetree.c: Remove unnecessary casts.
......
...@@ -59,9 +59,10 @@ ...@@ -59,9 +59,10 @@
/* My yylex routine used to intercept calls to flex generated code, to /* My yylex routine used to intercept calls to flex generated code, to
record lex time. */ record lex time. */
int yylex (void); int yylex (void);
static inline int my_yylex(void); static inline int my_yylex (void);
/* Call lex, but ensure time is charged to TV_LEX. */ /* Call lex, but ensure time is charged to TV_LEX. */
static inline int my_yylex () static inline int
my_yylex (void)
{ {
int res; int res;
timevar_push (TV_LEX); timevar_push (TV_LEX);
......
/* Language-level data type conversion for Treelang. /* Language-level data type conversion for Treelang.
This is a very slightly modified copy of c-convert.c. This is a very slightly modified copy of c-convert.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. This file is part of GCC.
...@@ -60,8 +60,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -60,8 +60,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
not permitted by the language being compiled. */ not permitted by the language being compiled. */
tree tree
convert (type, expr) convert (tree type, tree expr)
tree type, expr;
{ {
tree e = expr; tree e = expr;
enum tree_code code = TREE_CODE (type); enum tree_code code = TREE_CODE (type);
......
...@@ -138,7 +138,7 @@ treelang_handle_option (size_t scode, const char *arg ATTRIBUTE_UNUSED, ...@@ -138,7 +138,7 @@ treelang_handle_option (size_t scode, const char *arg ATTRIBUTE_UNUSED,
/* Language dependent parser setup. */ /* Language dependent parser setup. */
bool bool
treelang_init () treelang_init (void)
{ {
input_filename = main_input_filename; input_filename = main_input_filename;
input_line = 0; input_line = 0;
......
...@@ -122,29 +122,26 @@ struct language_function GTY(()) ...@@ -122,29 +122,26 @@ struct language_function GTY(())
char junk; /* dummy field to ensure struct is not empty */ char junk; /* dummy field to ensure struct is not empty */
}; };
static tree tree_lang_truthvalue_conversion PARAMS((tree expr)); static tree tree_lang_truthvalue_conversion (tree expr);
static bool tree_mark_addressable PARAMS((tree exp)); static bool tree_mark_addressable (tree exp);
static tree tree_lang_type_for_size PARAMS((unsigned precision, static tree tree_lang_type_for_size (unsigned precision, int unsignedp);
int unsignedp)); static tree tree_lang_type_for_mode (enum machine_mode mode, int unsignedp);
static tree tree_lang_type_for_mode PARAMS((enum machine_mode mode, static tree tree_lang_unsigned_type (tree type_node);
int unsignedp)); static tree tree_lang_signed_type (tree type_node);
static tree tree_lang_unsigned_type PARAMS((tree type_node)); static tree tree_lang_signed_or_unsigned_type (int unsignedp, tree type);
static tree tree_lang_signed_type PARAMS((tree type_node));
static tree tree_lang_signed_or_unsigned_type PARAMS((int unsignedp,
tree type));
/* XXX these should be static */ /* XXX these should be static */
void pushlevel PARAMS((int ignore)); void pushlevel (int ignore);
tree poplevel PARAMS((int keep, int reverse, int functionbody)); tree poplevel (int keep, int reverse, int functionbody);
int global_bindings_p PARAMS((void)); int global_bindings_p (void);
void insert_block PARAMS((tree block)); void insert_block (tree block);
void set_block PARAMS((tree block)); void set_block (tree block);
tree pushdecl PARAMS((tree decl)); tree pushdecl (tree decl);
tree getdecls PARAMS((void)); tree getdecls (void);
int kept_level_p PARAMS((void)); int kept_level_p (void);
static void tree_push_type_decl PARAMS((tree id, tree type_node)); static void tree_push_type_decl (tree id, tree type_node);
static void tree_push_atomic_type_decl PARAMS((tree id, tree type_node)); static void tree_push_atomic_type_decl (tree id, tree type_node);
/* The front end language hooks (addresses of code for this front /* The front end language hooks (addresses of code for this front
end). These are not really very language-dependent, i.e. end). These are not really very language-dependent, i.e.
...@@ -708,7 +705,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length) ...@@ -708,7 +705,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length)
with tree type TYPE and with operands1 OP1, OP2 (maybe), OP3 (maybe). */ with tree type TYPE and with operands1 OP1, OP2 (maybe), OP3 (maybe). */
tree tree
tree_code_get_expression (unsigned int exp_type, tree_code_get_expression (unsigned int exp_type,
tree type, tree op1, tree op2, tree op3 ATTRIBUTE_UNUSED) tree type, tree op1, tree op2,
tree op3 ATTRIBUTE_UNUSED)
{ {
tree ret1; tree ret1;
int operator; int operator;
...@@ -906,8 +904,7 @@ static GTY(()) tree signed_and_unsigned_types[MAX_BITS_PER_WORD + 1][2]; ...@@ -906,8 +904,7 @@ static GTY(()) tree signed_and_unsigned_types[MAX_BITS_PER_WORD + 1][2];
/* XXX is this definition OK? */ /* XXX is this definition OK? */
static tree static tree
tree_lang_truthvalue_conversion (expr) tree_lang_truthvalue_conversion (tree expr)
tree expr;
{ {
return expr; return expr;
} }
...@@ -919,8 +916,7 @@ tree_lang_truthvalue_conversion (expr) ...@@ -919,8 +916,7 @@ tree_lang_truthvalue_conversion (expr)
This implementation was copied from c-decl.c. */ This implementation was copied from c-decl.c. */
static bool static bool
tree_mark_addressable (exp) tree_mark_addressable (tree exp)
tree exp;
{ {
register tree x = exp; register tree x = exp;
while (1) while (1)
...@@ -982,9 +978,7 @@ tree_mark_addressable (exp) ...@@ -982,9 +978,7 @@ tree_mark_addressable (exp)
it is a signed type. */ it is a signed type. */
static tree static tree
tree_lang_type_for_size (precision, unsignedp) tree_lang_type_for_size (unsigned precision, int unsignedp)
unsigned precision;
int unsignedp;
{ {
tree t; tree t;
...@@ -1006,9 +1000,7 @@ tree_lang_type_for_size (precision, unsignedp) ...@@ -1006,9 +1000,7 @@ tree_lang_type_for_size (precision, unsignedp)
an unsigned type; otherwise a signed type is returned. */ an unsigned type; otherwise a signed type is returned. */
static tree static tree
tree_lang_type_for_mode (mode, unsignedp) tree_lang_type_for_mode (enum machine_mode mode, int unsignedp)
enum machine_mode mode;
int unsignedp;
{ {
return tree_lang_type_for_size (GET_MODE_BITSIZE (mode), unsignedp); return tree_lang_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
} }
...@@ -1016,8 +1008,7 @@ tree_lang_type_for_mode (mode, unsignedp) ...@@ -1016,8 +1008,7 @@ tree_lang_type_for_mode (mode, unsignedp)
/* Return the unsigned version of a TYPE_NODE, a scalar type. */ /* Return the unsigned version of a TYPE_NODE, a scalar type. */
static tree static tree
tree_lang_unsigned_type (type_node) tree_lang_unsigned_type (tree type_node)
tree type_node;
{ {
return tree_lang_type_for_size (TYPE_PRECISION (type_node), 1); return tree_lang_type_for_size (TYPE_PRECISION (type_node), 1);
} }
...@@ -1025,8 +1016,7 @@ tree_lang_unsigned_type (type_node) ...@@ -1025,8 +1016,7 @@ tree_lang_unsigned_type (type_node)
/* Return the signed version of a TYPE_NODE, a scalar type. */ /* Return the signed version of a TYPE_NODE, a scalar type. */
static tree static tree
tree_lang_signed_type (type_node) tree_lang_signed_type (tree type_node)
tree type_node;
{ {
return tree_lang_type_for_size (TYPE_PRECISION (type_node), 0); return tree_lang_type_for_size (TYPE_PRECISION (type_node), 0);
} }
...@@ -1035,9 +1025,7 @@ tree_lang_signed_type (type_node) ...@@ -1035,9 +1025,7 @@ tree_lang_signed_type (type_node)
UNSIGNEDP. */ UNSIGNEDP. */
static tree static tree
tree_lang_signed_or_unsigned_type (unsignedp, type) tree_lang_signed_or_unsigned_type (int unsignedp, tree type)
int unsignedp;
tree type;
{ {
if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp) if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp)
return type; return type;
...@@ -1095,7 +1083,7 @@ static struct binding_level clear_binding_level = {NULL, NULL, NULL, NULL}; ...@@ -1095,7 +1083,7 @@ static struct binding_level clear_binding_level = {NULL, NULL, NULL, NULL};
/* Return non-zero if we are currently in the global binding level. */ /* Return non-zero if we are currently in the global binding level. */
int int
global_bindings_p () global_bindings_p (void)
{ {
return current_binding_level == global_binding_level ? -1 : 0; return current_binding_level == global_binding_level ? -1 : 0;
} }
...@@ -1104,7 +1092,7 @@ global_bindings_p () ...@@ -1104,7 +1092,7 @@ global_bindings_p ()
is in reverse order (it has to be so for back-end compatibility). */ is in reverse order (it has to be so for back-end compatibility). */
tree tree
getdecls () getdecls (void)
{ {
return current_binding_level->names; return current_binding_level->names;
} }
...@@ -1112,7 +1100,7 @@ getdecls () ...@@ -1112,7 +1100,7 @@ getdecls ()
/* Nonzero if the current level needs to have a BLOCK made. */ /* Nonzero if the current level needs to have a BLOCK made. */
int int
kept_level_p () kept_level_p (void)
{ {
return (current_binding_level->names != 0); return (current_binding_level->names != 0);
} }
...@@ -1121,8 +1109,7 @@ kept_level_p () ...@@ -1121,8 +1109,7 @@ kept_level_p ()
specified for back-end compatibility. */ specified for back-end compatibility. */
void void
pushlevel (ignore) pushlevel (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
struct binding_level *newlevel = xmalloc (sizeof (struct binding_level)); struct binding_level *newlevel = xmalloc (sizeof (struct binding_level));
...@@ -1150,10 +1137,7 @@ pushlevel (ignore) ...@@ -1150,10 +1137,7 @@ pushlevel (ignore)
them into the BLOCK. */ them into the BLOCK. */
tree tree
poplevel (keep, reverse, functionbody) poplevel (int keep, int reverse, int functionbody)
int keep;
int reverse;
int functionbody;
{ {
/* Points to a BLOCK tree node. This is the BLOCK node construted for the /* Points to a BLOCK tree node. This is the BLOCK node construted for the
binding level that we are about to exit and which is returned by this binding level that we are about to exit and which is returned by this
...@@ -1247,8 +1231,7 @@ poplevel (keep, reverse, functionbody) ...@@ -1247,8 +1231,7 @@ poplevel (keep, reverse, functionbody)
to handle the BLOCK node inside the BIND_EXPR. */ to handle the BLOCK node inside the BIND_EXPR. */
void void
insert_block (block) insert_block (tree block)
tree block;
{ {
TREE_USED (block) = 1; TREE_USED (block) = 1;
current_binding_level->blocks current_binding_level->blocks
...@@ -1259,8 +1242,7 @@ insert_block (block) ...@@ -1259,8 +1242,7 @@ insert_block (block)
(the one we are currently in). */ (the one we are currently in). */
void void
set_block (block) set_block (tree block)
tree block;
{ {
current_binding_level->block_created_by_back_end = block; current_binding_level->block_created_by_back_end = block;
} }
...@@ -1269,8 +1251,7 @@ set_block (block) ...@@ -1269,8 +1251,7 @@ set_block (block)
Returns the ..._DECL node. */ Returns the ..._DECL node. */
tree tree
pushdecl (decl) pushdecl (tree decl)
tree decl;
{ {
/* External objects aren't nested, other objects may be. */ /* External objects aren't nested, other objects may be. */
...@@ -1297,9 +1278,7 @@ pushdecl (decl) ...@@ -1297,9 +1278,7 @@ pushdecl (decl)
static void static void
tree_push_type_decl(id, type_node) tree_push_type_decl(tree id, tree type_node)
tree id;
tree type_node;
{ {
tree decl = build_decl (TYPE_DECL, id, type_node); tree decl = build_decl (TYPE_DECL, id, type_node);
TYPE_NAME (type_node) = decl; TYPE_NAME (type_node) = decl;
...@@ -1312,9 +1291,7 @@ tree_push_type_decl(id, type_node) ...@@ -1312,9 +1291,7 @@ tree_push_type_decl(id, type_node)
not for e.g. pointer or array types. */ not for e.g. pointer or array types. */
static void static void
tree_push_atomic_type_decl(id, type_node) tree_push_atomic_type_decl(tree id, tree type_node)
tree id;
tree type_node;
{ {
TREE_TYPE (type_node) = type_node; TREE_TYPE (type_node) = type_node;
tree_push_type_decl (id, type_node); tree_push_type_decl (id, type_node);
...@@ -1328,7 +1305,7 @@ tree_push_atomic_type_decl(id, type_node) ...@@ -1328,7 +1305,7 @@ tree_push_atomic_type_decl(id, type_node)
Make definitions for built-in primitive functions. */ Make definitions for built-in primitive functions. */
void void
treelang_init_decl_processing () treelang_init_decl_processing (void)
{ {
current_function_decl = NULL; current_function_decl = NULL;
current_binding_level = NULL_BINDING_LEVEL; current_binding_level = NULL_BINDING_LEVEL;
...@@ -1406,13 +1383,9 @@ treelang_init_decl_processing () ...@@ -1406,13 +1383,9 @@ treelang_init_decl_processing ()
*/ */
tree tree
builtin_function (name, type, function_code, class, library_name, attrs) builtin_function (const char *name, tree type, int function_code,
const char *name; enum built_in_class class, const char *library_name,
tree type; tree attrs)
int function_code;
enum built_in_class class;
const char *library_name;
tree attrs;
{ {
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type); tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
DECL_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
......
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