Commit 0a2f0c54 by Kaveh R. Ghazi Committed by Kaveh Ghazi

* All Files: Convert to ISO C style function definitions.

From-SVN: r61218
parent 8e37cba8
2003-01-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* All Files: Convert to ISO C style function definitions.
2003-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
* parse.y (check_pkg_class_access): ANSIfy definition.
......
......@@ -43,9 +43,8 @@ static void set_bit (unsigned HOST_WIDE_INT *, unsigned HOST_WIDE_INT *,
/* Treat two HOST_WIDE_INT's as a contiguous bitmap, with bit 0 being
the least significant. This function sets bit N in the bitmap. */
static void
set_bit (low, high, n)
unsigned HOST_WIDE_INT *low, *high;
unsigned int n;
set_bit (unsigned HOST_WIDE_INT *low, unsigned HOST_WIDE_INT *high,
unsigned int n)
{
HOST_WIDE_INT *which;
......@@ -62,15 +61,14 @@ set_bit (low, high, n)
/* Recursively mark reference fields. */
static void
mark_reference_fields (field, low, high, ubit,
pointer_after_end, all_bits_set,
last_set_index, last_view_index)
tree field;
unsigned HOST_WIDE_INT *low, *high;
unsigned int ubit;
int *pointer_after_end, *all_bits_set;
int *last_set_index;
HOST_WIDE_INT *last_view_index;
mark_reference_fields (tree field,
unsigned HOST_WIDE_INT *low,
unsigned HOST_WIDE_INT *high,
unsigned int ubit,
int *pointer_after_end,
int *all_bits_set,
int *last_set_index,
HOST_WIDE_INT *last_view_index)
{
/* See if we have fields from our superclass. */
if (DECL_NAME (field) == NULL_TREE)
......
......@@ -29,9 +29,7 @@ Boston, MA 02111-1307, USA. */
/* Grow BUFP so there is room for at least SIZE more bytes. */
void
buffer_grow (bufp, size)
struct buffer *bufp;
int size;
buffer_grow (struct buffer *bufp, int size)
{
if (bufp->limit - bufp->ptr >= size)
return;
......
......@@ -116,8 +116,7 @@ static tree builtin_types[(int) BT_LAST];
/* Internal functions which implement various builtin conversions. */
static tree
max_builtin (method_return_type, method_arguments)
tree method_return_type, method_arguments;
max_builtin (tree method_return_type, tree method_arguments)
{
return build (MAX_EXPR, method_return_type,
TREE_VALUE (method_arguments),
......@@ -125,8 +124,7 @@ max_builtin (method_return_type, method_arguments)
}
static tree
min_builtin (method_return_type, method_arguments)
tree method_return_type, method_arguments;
min_builtin (tree method_return_type, tree method_arguments)
{
return build (MIN_EXPR, method_return_type,
TREE_VALUE (method_arguments),
......@@ -134,8 +132,7 @@ min_builtin (method_return_type, method_arguments)
}
static tree
abs_builtin (method_return_type, method_arguments)
tree method_return_type, method_arguments;
abs_builtin (tree method_return_type, tree method_arguments)
{
return build1 (ABS_EXPR, method_return_type,
TREE_VALUE (method_arguments));
......@@ -155,8 +152,7 @@ build_function_call_expr (tree fn, tree arglist)
}
static tree
cos_builtin (method_return_type, method_arguments)
tree method_return_type ATTRIBUTE_UNUSED, method_arguments;
cos_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree method_arguments)
{
/* FIXME: this assumes that jdouble and double are the same. */
tree fn = built_in_decls[BUILT_IN_COS];
......@@ -166,8 +162,7 @@ cos_builtin (method_return_type, method_arguments)
}
static tree
sin_builtin (method_return_type, method_arguments)
tree method_return_type ATTRIBUTE_UNUSED, method_arguments;
sin_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree method_arguments)
{
/* FIXME: this assumes that jdouble and double are the same. */
tree fn = built_in_decls[BUILT_IN_SIN];
......@@ -177,8 +172,7 @@ sin_builtin (method_return_type, method_arguments)
}
static tree
sqrt_builtin (method_return_type, method_arguments)
tree method_return_type ATTRIBUTE_UNUSED, method_arguments;
sqrt_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree method_arguments)
{
/* FIXME: this assumes that jdouble and double are the same. */
tree fn = built_in_decls[BUILT_IN_SQRT];
......@@ -191,12 +185,11 @@ sqrt_builtin (method_return_type, method_arguments)
/* Define a single builtin. */
static void
define_builtin (val, name, class, type, fallback_p)
enum built_in_function val;
const char *name;
enum built_in_class class;
tree type;
int fallback_p;
define_builtin (enum built_in_function val,
const char *name,
enum built_in_class class,
tree type,
int fallback_p)
{
tree decl;
......@@ -220,8 +213,7 @@ define_builtin (val, name, class, type, fallback_p)
/* Compute the type for a builtin. */
static tree
define_builtin_type (ret, arg1, arg2, arg3, arg4)
int ret, arg1, arg2, arg3, arg4;
define_builtin_type (int ret, int arg1, int arg2, int arg3, int arg4)
{
tree args;
......@@ -262,7 +254,7 @@ define_builtin_type (ret, arg1, arg2, arg3, arg4)
/* Initialize the builtins. */
void
initialize_builtins ()
initialize_builtins (void)
{
int i;
......@@ -322,9 +314,7 @@ initialize_builtins ()
/* If the call matches a builtin, return the
appropriate builtin expression instead. */
tree
check_for_builtin (method, call)
tree method;
tree call;
check_for_builtin (tree method, tree call)
{
if (! flag_emit_class_files && optimize && TREE_CODE (call) == CALL_EXPR)
{
......
......@@ -162,8 +162,7 @@ static void check_final_reassigned (tree, words);
Return the declaration or NULL_TREE if no interesting declaration. */
static tree
get_variable_decl (exp)
tree exp;
get_variable_decl (tree exp)
{
if (TREE_CODE (exp) == VAR_DECL)
{
......@@ -196,8 +195,7 @@ get_variable_decl (exp)
}
static void
final_assign_error (name)
tree name;
final_assign_error (tree name)
{
static const char format[]
= "can't reassign a value to the final variable '%s'";
......@@ -205,9 +203,7 @@ final_assign_error (name)
}
static void
check_final_reassigned (decl, before)
tree decl;
words before;
check_final_reassigned (tree decl, words before)
{
int index = DECL_BIT_INDEX (decl);
/* A final local already assigned or a final parameter
......@@ -225,10 +221,8 @@ check_final_reassigned (decl, before)
BEFORE, WHEN_FALSE, and WHEN_TRUE are as in check_bool_init. */
static void
check_cond_init (test_exp, then_exp, else_exp,
before, when_false, when_true)
tree test_exp, then_exp, else_exp;
words before, when_false, when_true;
check_cond_init (tree test_exp, tree then_exp, tree else_exp,
words before, words when_false, words when_true)
{
int save_start_current_locals = start_current_locals;
DECLARE_BUFFERS(test_false, 6);
......@@ -253,9 +247,8 @@ check_cond_init (test_exp, then_exp, else_exp,
BEFORE, WHEN_FALSE, and WHEN_TRUE are as in check_bool_init. */
static void
check_bool2_init (code, exp0, exp1, before, when_false, when_true)
enum tree_code code; tree exp0, exp1;
words before, when_false, when_true;
check_bool2_init (enum tree_code code, tree exp0, tree exp1,
words before, words when_false, words when_true)
{
word buf[2*4];
words tmp = num_current_words <= 2 ? buf
......@@ -321,9 +314,7 @@ check_bool2_init (code, exp0, exp1, before, when_false, when_true)
be used as temporary working areas. */
static void
check_bool_init (exp, before, when_false, when_true)
tree exp;
words before, when_false, when_true;
check_bool_init (tree exp, words before, words when_false, words when_true)
{
switch (TREE_CODE (exp))
{
......@@ -455,9 +446,7 @@ struct alternatives * alternatives = NULL;
of previous alternative branches. */
static void
done_alternative (after, current)
words after;
struct alternatives *current;
done_alternative (words after, struct alternatives *current)
{
INTERSECTN (current->combined, current->combined, after,
WORDS_NEEDED (2 * current->num_locals));
......@@ -479,9 +468,7 @@ done_alternative (after, current)
/* Check for (un)initialized local variables in EXP. */
static void
check_init (exp, before)
tree exp;
words before;
check_init (tree exp, words before)
{
tree tmp;
again:
......@@ -924,8 +911,7 @@ check_init (exp, before)
}
void
check_for_initialization (body, mdecl)
tree body, mdecl;
check_for_initialization (tree body, tree mdecl)
{
tree decl;
word buf[2];
......
......@@ -41,11 +41,7 @@ static tree build_constant_data_ref (void);
/* Set the INDEX'th constant in CPOOL to have the given TAG and VALUE. */
static void
set_constant_entry (cpool, index, tag, value)
CPool *cpool;
int index;
int tag;
jword value;
set_constant_entry (CPool *cpool, int index, int tag, jword value)
{
if (cpool->data == NULL)
{
......@@ -73,10 +69,7 @@ set_constant_entry (cpool, index, tag, value)
/* Find (or create) a constant pool entry matching TAG and VALUE. */
int
find_constant1 (cpool, tag, value)
CPool *cpool;
int tag;
jword value;
find_constant1 (CPool *cpool, int tag, jword value)
{
int i;
for (i = cpool->count; --i > 0; )
......@@ -92,10 +85,7 @@ find_constant1 (cpool, tag, value)
/* Find a double-word constant pool entry matching TAG and WORD1/WORD2. */
int
find_constant2 (cpool, tag, word1, word2)
CPool *cpool;
int tag;
jword word1, word2;
find_constant2 (CPool *cpool, int tag, jword word1, jword word2)
{
int i;
for (i = cpool->count - 1; --i > 0; )
......@@ -112,10 +102,7 @@ find_constant2 (cpool, tag, word1, word2)
}
static int
find_tree_constant (cpool, tag, value)
CPool *cpool;
int tag;
tree value;
find_tree_constant (CPool *cpool, int tag, tree value)
{
int i;
for (i = cpool->count; --i > 0; )
......@@ -131,9 +118,7 @@ find_tree_constant (cpool, tag, value)
int
find_utf8_constant (cpool, name)
CPool *cpool;
tree name;
find_utf8_constant (CPool *cpool, tree name)
{
if (name == NULL_TREE)
return 0;
......@@ -141,10 +126,7 @@ find_utf8_constant (cpool, name)
}
static int
find_class_or_string_constant (cpool, tag, name)
CPool *cpool;
int tag;
tree name;
find_class_or_string_constant (CPool *cpool, int tag, tree name)
{
jword j = find_utf8_constant (cpool, name);
int i;
......@@ -159,9 +141,7 @@ find_class_or_string_constant (cpool, tag, name)
}
int
find_class_constant (cpool, type)
CPool *cpool;
tree type;
find_class_constant (CPool *cpool, tree type)
{
return find_class_or_string_constant (cpool, CONSTANT_Class,
build_internal_class_name (type));
......@@ -170,9 +150,7 @@ find_class_constant (cpool, type)
/* Allocate a CONSTANT_string entry given a STRING_CST. */
int
find_string_constant (cpool, string)
CPool *cpool;
tree string;
find_string_constant (CPool *cpool, tree string)
{
string = get_identifier (TREE_STRING_POINTER (string));
return find_class_or_string_constant (cpool, CONSTANT_String, string);
......@@ -183,10 +161,7 @@ find_string_constant (cpool, string)
Return its index in the constant pool CPOOL. */
static int
find_name_and_type_constant (cpool, name, type)
CPool *cpool;
tree name;
tree type;
find_name_and_type_constant (CPool *cpool, tree name, tree type)
{
int name_index = find_utf8_constant (cpool, name);
int type_index = find_utf8_constant (cpool, build_java_signature (type));
......@@ -198,9 +173,7 @@ find_name_and_type_constant (cpool, name, type)
Return its index in the constant pool CPOOL. */
int
find_fieldref_index (cpool, decl)
CPool *cpool;
tree decl;
find_fieldref_index (CPool *cpool, tree decl)
{
int class_index = find_class_constant (cpool, DECL_CONTEXT (decl));
int name_type_index
......@@ -213,18 +186,13 @@ find_fieldref_index (cpool, decl)
Return its index in the constant pool CPOOL. */
int
find_methodref_index (cpool, decl)
CPool *cpool;
tree decl;
find_methodref_index (CPool *cpool, tree decl)
{
return find_methodref_with_class_index (cpool, decl, DECL_CONTEXT (decl));
}
int
find_methodref_with_class_index (cpool, decl, mclass)
CPool *cpool;
tree decl;
tree mclass;
find_methodref_with_class_index (CPool *cpool, tree decl, tree mclass)
{
int class_index = find_class_constant (cpool, mclass);
tree name = DECL_CONSTRUCTOR_P (decl) ? init_identifier_node
......@@ -248,8 +216,7 @@ find_methodref_with_class_index (cpool, decl, mclass)
constant pool. Includes the 2-byte constant_pool_count. */
int
count_constant_pool_bytes (cpool)
CPool *cpool;
count_constant_pool_bytes (CPool *cpool)
{
int size = 2;
int i = 1;
......@@ -294,10 +261,7 @@ count_constant_pool_bytes (cpool)
The length of BUFFER is LENGTH, which must match the needed length. */
void
write_constant_pool (cpool, buffer, length)
CPool *cpool;
unsigned char *buffer;
int length;
write_constant_pool (CPool *cpool, unsigned char *buffer, int length)
{
unsigned char *ptr = buffer;
int i = 1;
......@@ -348,8 +312,7 @@ CPool *outgoing_cpool;
static GTY(()) tree tag_nodes[13];
static tree
get_tag_node (tag)
int tag;
get_tag_node (int tag)
{
/* A Cache for build_int_2 (CONSTANT_XXX, 0). */
......@@ -365,9 +328,7 @@ get_tag_node (tag)
Returns the index of the entry. */
int
alloc_name_constant (tag, name)
int tag;
tree name;
alloc_name_constant (int tag, tree name)
{
return find_tree_constant (outgoing_cpool, tag, name);
}
......@@ -375,8 +336,7 @@ alloc_name_constant (tag, name)
/* Build an identifier for the internal name of reference type TYPE. */
tree
build_internal_class_name (type)
tree type;
build_internal_class_name (tree type)
{
tree name;
if (TYPE_ARRAY_P (type))
......@@ -394,8 +354,7 @@ build_internal_class_name (type)
/* Look for a CONSTANT_Class entry for CLAS, creating a new one if needed. */
int
alloc_class_constant (clas)
tree clas;
alloc_class_constant (tree clas)
{
tree class_name = build_internal_class_name (clas);
......@@ -408,7 +367,7 @@ alloc_class_constant (clas)
/* Return a reference to the data array of the current constant pool. */
static tree
build_constant_data_ref ()
build_constant_data_ref (void)
{
tree cpool_data_ref = NULL_TREE;
......@@ -433,8 +392,7 @@ build_constant_data_ref ()
/* Get the pointer value at the INDEX'th element of the constant pool. */
tree
build_ref_from_constant_pool (index)
int index;
build_ref_from_constant_pool (int index)
{
tree t = build_constant_data_ref ();
index *= int_size_in_bytes (ptr_type_node);
......@@ -447,7 +405,7 @@ build_ref_from_constant_pool (index)
Should only be called at top-level, since it may emit declarations. */
tree
build_constants_constructor ()
build_constants_constructor (void)
{
tree tags_value, data_value;
tree cons;
......
......@@ -93,7 +93,7 @@ int is_class_level = 0;
int current_pc;
void
indent ()
indent (void)
{
register unsigned i;
......@@ -103,9 +103,7 @@ indent ()
#endif /* defined(DEBUG_JAVA_BINDING_LEVELS) */
static tree
push_jvm_slot (index, decl)
int index;
tree decl;
push_jvm_slot (int index, tree decl)
{
struct rtx_def *rtl = NULL;
tree type = TREE_TYPE (decl);
......@@ -152,11 +150,7 @@ push_jvm_slot (index, decl)
is returned, then updated is set to true. */
static tree
check_local_named_variable (best, decl, pc, updated)
tree best;
tree decl;
int pc;
int *updated;
check_local_named_variable (tree best, tree decl, int pc, int *updated)
{
if (pc >= DECL_LOCAL_START_PC (decl)
&& pc < DECL_LOCAL_END_PC (decl))
......@@ -177,10 +171,7 @@ check_local_named_variable (best, decl, pc, updated)
than 'best', return 'decl'. Otherwise return 'best'. */
static tree
check_local_unnamed_variable (best, decl, type)
tree best;
tree decl;
tree type;
check_local_unnamed_variable (tree best, tree decl, tree type)
{
if (TREE_TYPE (decl) == type
|| (TREE_CODE (TREE_TYPE (decl)) == TREE_CODE (type)
......@@ -204,10 +195,7 @@ check_local_unnamed_variable (best, decl, type)
If there is no existing matching decl, allocate one. */
tree
find_local_variable (index, type, pc)
int index;
tree type;
int pc;
find_local_variable (int index, tree type, int pc)
{
tree decl = TREE_VEC_ELT (decl_map, index);
tree best = NULL_TREE;
......@@ -253,9 +241,7 @@ find_local_variable (index, type, pc)
/* Same as find_local_index, except that INDEX is a stack index. */
tree
find_stack_slot (index, type)
int index;
tree type;
find_stack_slot (int index, tree type)
{
return find_local_variable (index + DECL_MAX_LOCALS (current_function_decl),
type, -1);
......@@ -341,9 +327,7 @@ tree java_global_trees[JTI_MAX];
types shorter than int. */
static tree
push_promoted_type (name, actual_type)
const char *name;
tree actual_type;
push_promoted_type (const char *name, tree actual_type)
{
tree type = make_node (TREE_CODE (actual_type));
#if 1
......@@ -373,13 +357,12 @@ push_promoted_type (name, actual_type)
ATTRS is nonzero, use that for the function's attribute list. */
tree
builtin_function (name, type, function_code, class, library_name, attrs)
const char *name;
tree type;
int function_code;
enum built_in_class class;
const char *library_name;
tree attrs ATTRIBUTE_UNUSED;
builtin_function (const char *name,
tree type,
int function_code,
enum built_in_class class,
const char *library_name,
tree attrs ATTRIBUTE_UNUSED)
{
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
DECL_EXTERNAL (decl) = 1;
......@@ -395,8 +378,7 @@ builtin_function (name, type, function_code, class, library_name, attrs)
/* Return tree that represents a vtable for a primitive array. */
static tree
create_primitive_vtable (name)
const char *name;
create_primitive_vtable (const char *name)
{
tree r;
char buf[50];
......@@ -408,7 +390,7 @@ create_primitive_vtable (name)
}
void
java_init_decl_processing ()
java_init_decl_processing (void)
{
register tree endlink;
tree field = NULL_TREE;
......@@ -952,8 +934,7 @@ java_init_decl_processing ()
or return 0 if it is undefined. */
tree
lookup_name (name)
tree name;
lookup_name (tree name)
{
register tree val;
if (current_binding_level != global_binding_level
......@@ -968,8 +949,7 @@ lookup_name (name)
the previous one if its the parameter level. */
static tree
lookup_name_current_level (name)
tree name;
lookup_name_current_level (tree name)
{
register tree t;
......@@ -989,8 +969,7 @@ lookup_name_current_level (name)
/* Use a binding level to record a labeled block declaration */
void
push_labeled_block (lb)
tree lb;
push_labeled_block (tree lb)
{
register tree name = DECL_NAME (LABELED_BLOCK_LABEL (lb));
register struct binding_level *b = current_binding_level;
......@@ -1006,7 +985,7 @@ push_labeled_block (lb)
labeled block */
void
pop_labeled_block ()
pop_labeled_block (void)
{
struct binding_level *b = current_binding_level;
tree label = b->names;
......@@ -1031,8 +1010,7 @@ pop_labeled_block ()
to agree with what X says. */
tree
pushdecl (x)
tree x;
pushdecl (tree x)
{
register tree t;
register tree name = DECL_NAME (x);
......@@ -1150,8 +1128,7 @@ pushdecl (x)
}
void
pushdecl_force_head (x)
tree x;
pushdecl_force_head (tree x)
{
current_binding_level->names = x;
}
......@@ -1159,8 +1136,7 @@ pushdecl_force_head (x)
/* Like pushdecl, only it places X in GLOBAL_BINDING_LEVEL, if appropriate. */
tree
pushdecl_top_level (x)
tree x;
pushdecl_top_level (tree x)
{
register tree t;
register struct binding_level *b = current_binding_level;
......@@ -1174,7 +1150,7 @@ pushdecl_top_level (x)
/* Nonzero if we are currently in the global binding level. */
int
global_bindings_p ()
global_bindings_p (void)
{
return current_binding_level == global_binding_level;
}
......@@ -1185,7 +1161,7 @@ global_bindings_p ()
store the result back using `storedecls' or you will lose. */
tree
getdecls ()
getdecls (void)
{
return current_binding_level->names;
}
......@@ -1193,15 +1169,14 @@ getdecls ()
/* Create a new `struct binding_level'. */
static struct binding_level *
make_binding_level ()
make_binding_level (void)
{
/* NOSTRICT */
return xmalloc (sizeof (struct binding_level));
}
void
pushlevel (unused)
int unused ATTRIBUTE_UNUSED;
pushlevel (int unused ATTRIBUTE_UNUSED)
{
register struct binding_level *newlevel = NULL_BINDING_LEVEL;
......@@ -1257,10 +1232,7 @@ pushlevel (unused)
them into the BLOCK. */
tree
poplevel (keep, reverse, functionbody)
int keep;
int reverse;
int functionbody;
poplevel (int keep, int reverse, int functionbody)
{
register tree link;
/* The chain of decls was accumulated in reverse order.
......@@ -1464,8 +1436,7 @@ poplevel (keep, reverse, functionbody)
}
void
maybe_pushlevels (pc)
int pc;
maybe_pushlevels (int pc)
{
#if defined(DEBUG_JAVA_BINDING_LEVELS)
current_pc = pc;
......@@ -1507,8 +1478,7 @@ maybe_pushlevels (pc)
}
void
maybe_poplevels (pc)
int pc;
maybe_poplevels (int pc)
{
#if defined(DEBUG_JAVA_BINDING_LEVELS)
current_pc = pc;
......@@ -1529,8 +1499,7 @@ maybe_poplevels (pc)
range is forcibly terminated when that exception ends. */
void
force_poplevels (start_pc)
int start_pc;
force_poplevels (int start_pc)
{
while (current_binding_level->start_pc > start_pc)
{
......@@ -1548,8 +1517,7 @@ force_poplevels (start_pc)
to handle the BLOCK node inside the BIND_EXPR. */
void
insert_block (block)
tree block;
insert_block (tree block)
{
TREE_USED (block) = 1;
current_binding_level->blocks
......@@ -1560,8 +1528,7 @@ insert_block (block)
(the one we are currently in). */
void
set_block (block)
register tree block;
set_block (tree block)
{
current_binding_level->this_block = block;
current_binding_level->names = chainon (current_binding_level->names,
......@@ -1573,8 +1540,7 @@ set_block (block)
/* integrate_decl_tree calls this function. */
void
java_dup_lang_specific_decl (node)
tree node;
java_dup_lang_specific_decl (tree node)
{
int lang_decl_size;
struct lang_decl *x;
......@@ -1589,8 +1555,7 @@ java_dup_lang_specific_decl (node)
}
void
give_name_to_locals (jcf)
JCF *jcf;
give_name_to_locals (JCF *jcf)
{
int i, n = DECL_LOCALVARIABLES_OFFSET (current_function_decl);
int code_offset = DECL_CODE_OFFSET (current_function_decl);
......@@ -1688,8 +1653,7 @@ give_name_to_locals (jcf)
}
tree
build_result_decl (fndecl)
tree fndecl;
build_result_decl (tree fndecl)
{
tree restype = TREE_TYPE (TREE_TYPE (fndecl));
tree result = DECL_RESULT (fndecl);
......@@ -1707,8 +1671,7 @@ build_result_decl (fndecl)
}
void
complete_start_java_method (fndecl)
tree fndecl;
complete_start_java_method (tree fndecl)
{
if (! flag_emit_class_files)
{
......@@ -1780,8 +1743,7 @@ complete_start_java_method (fndecl)
}
void
start_java_method (fndecl)
tree fndecl;
start_java_method (tree fndecl)
{
tree tem, *ptr;
int i;
......@@ -1840,7 +1802,7 @@ start_java_method (fndecl)
}
void
end_java_method ()
end_java_method (void)
{
tree fndecl = current_function_decl;
......@@ -1865,9 +1827,7 @@ end_java_method ()
/* Dump FUNCTION_DECL FN as tree dump PHASE. */
static void
dump_function (phase, fn)
enum tree_dump_index phase;
tree fn;
dump_function (enum tree_dump_index phase, tree fn)
{
FILE *stream;
int flags;
......@@ -1880,8 +1840,7 @@ dump_function (phase, fn)
}
}
void java_optimize_inline (fndecl)
tree fndecl;
void java_optimize_inline (tree fndecl)
{
if (flag_inline_trees)
{
......
......@@ -77,10 +77,7 @@ extern void indent ();
previous children have end_pc values that are too low. */
static struct eh_range *
find_handler_in_range (pc, range, child)
int pc;
struct eh_range *range;
register struct eh_range *child;
find_handler_in_range (int pc, struct eh_range *range, struct eh_range *child)
{
for (; child != NULL; child = child->next_sibling)
{
......@@ -99,8 +96,7 @@ find_handler_in_range (pc, range, child)
/* Find the inner-most handler that contains PC. */
struct eh_range *
find_handler (pc)
int pc;
find_handler (int pc)
{
struct eh_range *h;
if (pc >= cache_range_start)
......@@ -125,8 +121,7 @@ find_handler (pc)
/* Recursive helper routine for check_nested_ranges. */
static void
link_handler (range, outer)
struct eh_range *range, *outer;
link_handler (struct eh_range *range, struct eh_range *outer)
{
struct eh_range **ptr;
......@@ -208,7 +203,7 @@ link_handler (range, outer)
ensure that exception ranges are properly nested. */
void
handle_nested_ranges ()
handle_nested_ranges (void)
{
struct eh_range *ptr, *next;
......@@ -225,8 +220,7 @@ handle_nested_ranges ()
/* Free RANGE as well as its children and siblings. */
static void
free_eh_ranges (range)
struct eh_range *range;
free_eh_ranges (struct eh_range *range)
{
while (range)
{
......@@ -241,7 +235,7 @@ free_eh_ranges (range)
/* Called to re-initialize the exception machinery for a new method. */
void
method_init_exceptions ()
method_init_exceptions (void)
{
free_eh_ranges (&whole_range);
whole_range.start_pc = 0;
......@@ -267,10 +261,7 @@ method_init_exceptions ()
what the sorting counteracts. */
void
add_handler (start_pc, end_pc, handler, type)
int start_pc, end_pc;
tree handler;
tree type;
add_handler (int start_pc, int end_pc, tree handler, tree type)
{
struct eh_range *ptr, *prev = NULL, *h;
......@@ -306,8 +297,7 @@ add_handler (start_pc, end_pc, handler, type)
/* if there are any handlers for this range, issue start of region */
static void
expand_start_java_handler (range)
struct eh_range *range;
expand_start_java_handler (struct eh_range *range)
{
#if defined(DEBUG_JAVA_BINDING_LEVELS)
indent ();
......@@ -319,8 +309,7 @@ expand_start_java_handler (range)
}
tree
prepare_eh_table_type (type)
tree type;
prepare_eh_table_type (tree type)
{
tree exp;
......@@ -347,8 +336,7 @@ prepare_eh_table_type (type)
exception header. */
tree
build_exception_object_ref (type)
tree type;
build_exception_object_ref (tree type)
{
tree obj;
......@@ -365,8 +353,7 @@ build_exception_object_ref (type)
/* If there are any handlers for this range, isssue end of range,
and then all handler blocks */
static void
expand_end_java_handler (range)
struct eh_range *range;
expand_end_java_handler (struct eh_range *range)
{
tree handler = range->handlers;
force_poplevels (range->start_pc);
......@@ -398,9 +385,7 @@ expand_end_java_handler (range)
/* Recursive helper routine for maybe_start_handlers. */
static void
check_start_handlers (range, pc)
struct eh_range *range;
int pc;
check_start_handlers (struct eh_range *range, int pc)
{
if (range != NULL_EH_RANGE && range->start_pc == pc)
{
......@@ -417,9 +402,7 @@ static struct eh_range *current_range;
end_pc. */
void
maybe_start_try (start_pc, end_pc)
int start_pc;
int end_pc;
maybe_start_try (int start_pc, int end_pc)
{
struct eh_range *range;
if (! doing_eh (1))
......@@ -438,9 +421,7 @@ maybe_start_try (start_pc, end_pc)
start_pc. */
void
maybe_end_try (start_pc, end_pc)
int start_pc;
int end_pc;
maybe_end_try (int start_pc, int end_pc)
{
if (! doing_eh (1))
return;
......
......@@ -254,8 +254,7 @@ static int decompiled = 0;
/* Return 1 if F is not Inf or NaN. */
static int
java_float_finite (f)
jfloat f;
java_float_finite (jfloat f)
{
union Word u;
u.f = f;
......@@ -268,8 +267,7 @@ java_float_finite (f)
/* Return 1 if D is not Inf or NaN. */
static int
java_double_finite (d)
jdouble d;
java_double_finite (jdouble d)
{
union DWord u;
u.d = d;
......@@ -281,9 +279,7 @@ java_double_finite (d)
/* Print a character, appropriately mangled for JNI. */
static void
jni_print_char (stream, ch)
FILE *stream;
int ch;
jni_print_char (FILE *stream, int ch)
{
if (! flag_jni)
jcf_print_char (stream, ch);
......@@ -345,10 +341,7 @@ print_name (FILE* stream, JCF* jcf, int name_index)
final separator. */
static void
print_base_classname (stream, jcf, index)
FILE *stream;
JCF *jcf;
int index;
print_base_classname (FILE *stream, JCF *jcf, int index)
{
int name_index = JPOOL_USHORT1 (jcf, index);
int len;
......@@ -379,10 +372,7 @@ print_base_classname (stream, jcf, index)
and 1 if STR is "greater" than NAME. */
static int
utf8_cmp (str, length, name)
const unsigned char *str;
int length;
const char *name;
utf8_cmp (const unsigned char *str, int length, const char *name)
{
const unsigned char *limit = str + length;
int i;
......@@ -513,9 +503,7 @@ static const char *const cxx_keywords[] =
Otherwise, return NULL. The return value is malloc()d. */
static char *
cxx_keyword_subst (str, length)
const unsigned char *str;
int length;
cxx_keyword_subst (const unsigned char *str, int length)
{
int last = ARRAY_SIZE (cxx_keywords);
int first = 0;
......@@ -562,9 +550,7 @@ cxx_keyword_subst (str, length)
/* Generate an access control keyword based on FLAGS. */
static void
generate_access (stream, flags)
FILE *stream;
JCF_u2 flags;
generate_access (FILE *stream, JCF_u2 flags)
{
if ((flags & ACC_VISIBILITY) == last_access)
return;
......@@ -594,9 +580,7 @@ generate_access (stream, flags)
/* See if NAME is already the name of a method. */
static int
name_is_method_p (name, length)
const unsigned char *name;
int length;
name_is_method_p (const unsigned char *name, int length)
{
struct method_name *p;
......@@ -611,11 +595,8 @@ name_is_method_p (name, length)
/* If there is already a method named NAME, whose signature is not
SIGNATURE, then return true. Otherwise return false. */
static int
overloaded_jni_method_exists_p (name, length, signature, sig_length)
const unsigned char *name;
int length;
const char *signature;
int sig_length;
overloaded_jni_method_exists_p (const unsigned char *name, int length,
const char *signature, int sig_length)
{
struct method_name *p;
......@@ -632,10 +613,7 @@ overloaded_jni_method_exists_p (name, length, signature, sig_length)
/* Get name of a field. This handles renamings due to C++ clash. */
static char *
get_field_name (jcf, name_index, flags)
JCF *jcf;
int name_index;
JCF_u2 flags;
get_field_name (JCF *jcf, int name_index, JCF_u2 flags)
{
unsigned char *name = JPOOL_UTF_DATA (jcf, name_index);
int length = JPOOL_UTF_LENGTH (jcf, name_index);
......@@ -667,11 +645,7 @@ get_field_name (jcf, name_index, flags)
/* Print a field name. Convenience function for use with
get_field_name. */
static void
print_field_name (stream, jcf, name_index, flags)
FILE *stream;
JCF *jcf;
int name_index;
JCF_u2 flags;
print_field_name (FILE *stream, JCF *jcf, int name_index, JCF_u2 flags)
{
char *override = get_field_name (jcf, name_index, flags);
......@@ -905,10 +879,8 @@ print_method_info (FILE *stream, JCF* jcf, int name_index, int sig_index,
signature. NAMEINDEX is the index of the field name; -1 for
`this'. OBJECTTYPE is the index of the object's type. */
static void
decompile_return_statement (out, jcf, methodtype, nameindex, objecttype)
FILE *out;
JCF *jcf;
int methodtype, nameindex, objecttype;
decompile_return_statement (FILE *out, JCF *jcf, int methodtype,
int nameindex, int objecttype)
{
int cast = 0;
int obj_name_len, method_name_len;
......@@ -1027,10 +999,7 @@ decompile_return_statement (out, jcf, methodtype, nameindex, objecttype)
/* Try to decompile a method body. Right now we just try to handle a
simple case that we can do. Expand as desired. */
static void
decompile_method (out, jcf, code_len)
FILE *out;
JCF *jcf;
int code_len;
decompile_method (FILE *out, JCF *jcf, int code_len)
{
const unsigned char *codes = jcf->read_ptr;
int index;
......@@ -1099,8 +1068,7 @@ decompile_method (out, jcf, code_len)
should probably be in hashtab.c to complement the existing string
hash function. */
static int
gcjh_streq (p1, p2)
const void *p1, *p2;
gcjh_streq (const void *p1, const void *p2)
{
return ! strcmp ((char *) p1, (char *) p2);
}
......@@ -1109,8 +1077,7 @@ gcjh_streq (p1, p2)
or 0 if not. CLNAME may be extracted from a signature, and can be
terminated with either `;' or NULL. */
static int
throwable_p (clname)
const unsigned char *clname;
throwable_p (const unsigned char *clname)
{
int length;
unsigned char *current;
......@@ -1209,10 +1176,8 @@ throwable_p (clname)
/* Print one piece of a signature. Returns pointer to next parseable
character on success, NULL on error. */
static const unsigned char *
decode_signature_piece (stream, signature, limit, need_space)
FILE *stream;
const unsigned char *signature, *limit;
int *need_space;
decode_signature_piece (FILE *stream, const unsigned char *signature,
const unsigned char *limit, int *need_space)
{
const char *ctype;
int array_depth = 0;
......@@ -1630,12 +1595,8 @@ print_mangled_classname (FILE *stream, JCF *jcf, const char *prefix, int index)
to an array, ignore it and don't print PREFIX. Returns 1 if
something was printed, 0 otherwise. */
static int
print_cxx_classname (stream, prefix, jcf, index, add_scope)
FILE *stream;
const char *prefix;
JCF *jcf;
int index;
int add_scope;
print_cxx_classname (FILE *stream, const char *prefix,
JCF *jcf, int index, int add_scope)
{
int name_index = JPOOL_USHORT1 (jcf, index);
int len, c;
......@@ -1674,9 +1635,7 @@ int written_class_count = 0;
/* Return name of superclass. If LEN is not NULL, fill it with length
of name. */
static const unsigned char *
super_class_name (derived_jcf, len)
JCF *derived_jcf;
int *len;
super_class_name (JCF *derived_jcf, int *len)
{
int supername_index = JPOOL_USHORT1 (derived_jcf, derived_jcf->super_class);
int supername_length = JPOOL_UTF_LENGTH (derived_jcf, supername_index);
......@@ -1704,10 +1663,7 @@ static struct include *all_includes = NULL;
/* Generate a #include. */
static void
print_include (out, utf8, len)
FILE *out;
const unsigned char *utf8;
int len;
print_include (FILE *out, const unsigned char *utf8, int len)
{
struct include *incl;
......@@ -1771,9 +1727,8 @@ static struct namelet root =
package or class name and links it into the tree. It does this
recursively. */
static void
add_namelet (name, name_limit, parent)
const unsigned char *name, *name_limit;
struct namelet *parent;
add_namelet (const unsigned char *name, const unsigned char *name_limit,
struct namelet *parent)
{
const unsigned char *p;
struct namelet *n = NULL, *np;
......@@ -1830,10 +1785,7 @@ add_namelet (name, name_limit, parent)
/* Print a single namelet. Destroys namelets while printing. */
static void
print_namelet (out, name, depth)
FILE *out;
struct namelet *name;
int depth;
print_namelet (FILE *out, struct namelet *name, int depth)
{
int i, term = 0;
struct namelet *c;
......@@ -1886,10 +1838,7 @@ print_namelet (out, name, depth)
we need decls. The signature argument can be a function
signature. */
static void
add_class_decl (out, jcf, signature)
FILE *out;
JCF *jcf;
JCF_u2 signature;
add_class_decl (FILE *out, JCF *jcf, JCF_u2 signature)
{
const unsigned char *s = JPOOL_UTF_DATA (jcf, signature);
int len = JPOOL_UTF_LENGTH (jcf, signature);
......@@ -1923,10 +1872,7 @@ add_class_decl (out, jcf, signature)
statically in libjava; we don't generate declarations for these.
This makes the generated headers a bit easier to read. */
static void
print_class_decls (out, jcf, self)
FILE *out;
JCF *jcf;
int self;
print_class_decls (FILE *out, JCF *jcf, int self)
{
/* Make sure to always add the current class to the list of things
that should be declared. */
......@@ -2244,14 +2190,14 @@ static const struct option options[] =
};
static void
usage ()
usage (void)
{
fprintf (stderr, "Try `gcjh --help' for more information.\n");
exit (1);
}
static void
help ()
help (void)
{
printf ("Usage: gcjh [OPTION]... CLASS...\n\n");
printf ("Generate C++ header files from .class files\n\n");
......@@ -2289,7 +2235,7 @@ help ()
}
static void
version ()
version (void)
{
printf ("gcjh (GCC) %s\n\n", version_string);
printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
......
......@@ -56,7 +56,7 @@ static int print_dummies;
invocation. FIXME: we should change our API or just completely use
the one in mkdeps.h. */
void
jcf_dependency_reset ()
jcf_dependency_reset (void)
{
if (dep_out != NULL)
{
......@@ -73,8 +73,7 @@ jcf_dependency_reset ()
}
void
jcf_dependency_set_target (name)
const char *name;
jcf_dependency_set_target (const char *name)
{
/* We just handle this the same as an `add_target'. */
if (dependencies != NULL && name != NULL)
......@@ -82,16 +81,14 @@ jcf_dependency_set_target (name)
}
void
jcf_dependency_add_target (name)
const char *name;
jcf_dependency_add_target (const char *name)
{
if (dependencies != NULL)
deps_add_target (dependencies, name, 1);
}
void
jcf_dependency_set_dep_file (name)
const char *name;
jcf_dependency_set_dep_file (const char *name)
{
assert (dep_out != stdout);
if (dep_out)
......@@ -103,9 +100,7 @@ jcf_dependency_set_dep_file (name)
}
void
jcf_dependency_add_file (filename, system_p)
const char *filename;
int system_p;
jcf_dependency_add_file (const char *filename, int system_p)
{
if (! dependencies)
return;
......@@ -118,8 +113,7 @@ jcf_dependency_add_file (filename, system_p)
}
void
jcf_dependency_init (system_p)
int system_p;
jcf_dependency_init (int system_p)
{
assert (! dependencies);
system_files = system_p;
......@@ -127,13 +121,13 @@ jcf_dependency_init (system_p)
}
void
jcf_dependency_print_dummies ()
jcf_dependency_print_dummies (void)
{
print_dummies = 1;
}
void
jcf_dependency_write ()
jcf_dependency_write (void)
{
if (! dep_out)
return;
......
......@@ -800,14 +800,14 @@ static const struct option options[] =
};
static void
usage ()
usage (void)
{
fprintf (stderr, "Try `jcf-dump --help' for more information.\n");
exit (1);
}
static void
help ()
help (void)
{
printf ("Usage: jcf-dump [OPTION]... CLASS...\n\n");
printf ("Display contents of a class file in readable form.\n\n");
......@@ -830,7 +830,7 @@ help ()
}
static void
version ()
version (void)
{
printf ("jcf-dump (GCC) %s\n\n", version_string);
printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
......
......@@ -106,9 +106,7 @@ static void load_inner_classes (tree);
/* Handle "SourceFile" attribute. */
static void
set_source_filename (jcf, index)
JCF *jcf;
int index;
set_source_filename (JCF *jcf, int index)
{
tree sfname_id = get_name_constant (jcf, index);
const char *sfname = IDENTIFIER_POINTER (sfname_id);
......@@ -223,9 +221,7 @@ set_source_filename (jcf, index)
#include "jcf-reader.c"
tree
parse_signature (jcf, sig_index)
JCF *jcf;
int sig_index;
parse_signature (JCF *jcf, int sig_index)
{
if (sig_index <= 0 || sig_index >= JPOOL_SIZE (jcf)
|| JPOOL_TAG (jcf, sig_index) != CONSTANT_Utf8)
......@@ -236,9 +232,7 @@ parse_signature (jcf, sig_index)
}
tree
get_constant (jcf, index)
JCF *jcf;
int index;
get_constant (JCF *jcf, int index)
{
tree value;
int tag;
......@@ -336,9 +330,7 @@ get_constant (jcf, index)
}
tree
get_name_constant (jcf, index)
JCF *jcf;
int index;
get_name_constant (JCF *jcf, int index)
{
tree name = get_constant (jcf, index);
......@@ -353,9 +345,7 @@ get_name_constant (jcf, index)
the outer context with the newly resolved innerclass. */
static void
handle_innerclass_attribute (count, jcf)
int count;
JCF *jcf;
handle_innerclass_attribute (int count, JCF *jcf)
{
int c = (count);
while (c--)
......@@ -391,9 +381,7 @@ handle_innerclass_attribute (count, jcf)
}
static tree
give_name_to_class (jcf, i)
JCF *jcf;
int i;
give_name_to_class (JCF *jcf, int i)
{
if (i <= 0 || i >= JPOOL_SIZE (jcf)
|| JPOOL_TAG (jcf, i) != CONSTANT_Class)
......@@ -420,7 +408,7 @@ give_name_to_class (jcf, i)
/* Get the class of the CONSTANT_Class whose constant pool index is I. */
tree
get_class_constant (JCF *jcf , int i)
get_class_constant (JCF *jcf, int i)
{
tree type;
if (i <= 0 || i >= JPOOL_SIZE (jcf)
......@@ -455,8 +443,7 @@ get_class_constant (JCF *jcf , int i)
define the class it is supposed to.) */
int
read_class (name)
tree name;
read_class (tree name)
{
JCF this_jcf, *jcf;
tree icv, class = NULL_TREE;
......@@ -548,9 +535,7 @@ read_class (name)
- and then perhaps rename read_class to load_class. FIXME */
void
load_class (class_or_name, verbose)
tree class_or_name;
int verbose;
load_class (tree class_or_name, int verbose)
{
tree name, saved;
int class_loaded;
......@@ -596,8 +581,7 @@ load_class (class_or_name, verbose)
/* Parse the .class file JCF. */
void
jcf_parse (jcf)
JCF* jcf;
jcf_parse (JCF* jcf)
{
int i, code;
......@@ -667,8 +651,7 @@ jcf_parse (jcf)
/* If we came across inner classes, load them now. */
static void
load_inner_classes (cur_class)
tree cur_class;
load_inner_classes (tree cur_class)
{
tree current;
for (current = DECL_INNER_CLASS_LIST (TYPE_NAME (cur_class)); current;
......@@ -683,13 +666,13 @@ load_inner_classes (cur_class)
}
void
init_outgoing_cpool ()
init_outgoing_cpool (void)
{
outgoing_cpool = ggc_alloc_cleared (sizeof (struct CPool));
}
static void
parse_class_file ()
parse_class_file (void)
{
tree method, field;
const char *save_input_filename = input_filename;
......@@ -799,9 +782,7 @@ parse_class_file ()
/* Parse a source file, as pointed by the current value of INPUT_FILENAME. */
static void
parse_source_file_1 (file, finput)
tree file;
FILE *finput;
parse_source_file_1 (tree file, FILE *finput)
{
int save_error_count = java_error_count;
/* Mark the file as parsed */
......@@ -833,7 +814,7 @@ parse_source_file_1 (file, finput)
/* Process a parsed source file, resolving names etc. */
static void
parse_source_file_2 ()
parse_source_file_2 (void)
{
int save_error_count = java_error_count;
java_complete_class (); /* Parse unsatisfied class decl. */
......@@ -841,7 +822,7 @@ parse_source_file_2 ()
}
static void
parse_source_file_3 ()
parse_source_file_3 (void)
{
int save_error_count = java_error_count;
java_check_circular_reference (); /* Check on circular references */
......@@ -852,15 +833,13 @@ parse_source_file_3 ()
}
void
add_predefined_file (name)
tree name;
add_predefined_file (tree name)
{
predef_filenames = tree_cons (NULL_TREE, name, predef_filenames);
}
int
predefined_filename_p (node)
tree node;
predefined_filename_p (tree node)
{
tree iter;
......@@ -873,8 +852,7 @@ predefined_filename_p (node)
}
void
java_parse_file (set_yydebug)
int set_yydebug ATTRIBUTE_UNUSED;
java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
{
int filename_count = 0;
char *list, *next;
......@@ -1229,7 +1207,7 @@ process_zip_dir (FILE *finput)
/* Initialization. */
void
init_jcf_parse ()
init_jcf_parse (void)
{
init_src_parse ();
}
......
......@@ -105,8 +105,7 @@ static int longest_path = 0;
static void
free_entry (entp)
struct entry **entp;
free_entry (struct entry **entp)
{
struct entry *e, *n;
......@@ -120,9 +119,7 @@ free_entry (entp)
}
static void
append_entry (entp, ent)
struct entry **entp;
struct entry *ent;
append_entry (struct entry **entp, struct entry *ent)
{
/* It doesn't matter if this is slow, since it is run only at
startup, and then infrequently. */
......@@ -139,10 +136,7 @@ append_entry (entp, ent)
}
static void
add_entry (entp, filename, is_system)
struct entry **entp;
const char *filename;
int is_system;
add_entry (struct entry **entp, const char *filename, int is_system)
{
int len;
struct entry *n;
......@@ -186,10 +180,7 @@ add_entry (entp, filename, is_system)
}
static void
add_path (entp, cp, is_system)
struct entry **entp;
const char *cp;
int is_system;
add_path (struct entry **entp, const char *cp, int is_system)
{
const char *startp, *endp;
......@@ -228,7 +219,7 @@ static int init_done = 0;
/* Initialize the path module. */
void
jcf_path_init ()
jcf_path_init (void)
{
char *cp;
char *try, sep[2];
......@@ -321,8 +312,7 @@ jcf_path_init ()
This overrides only the $CLASSPATH environment variable.
*/
void
jcf_path_classpath_arg (path)
const char *path;
jcf_path_classpath_arg (const char *path)
{
free_entry (&classpath_user);
add_path (&classpath_user, path, 0);
......@@ -331,8 +321,7 @@ jcf_path_classpath_arg (path)
/* Call this when -bootclasspath is seen on the command line.
*/
void
jcf_path_bootclasspath_arg (path)
const char *path;
jcf_path_bootclasspath_arg (const char *path)
{
free_entry (&sys_dirs);
add_path (&sys_dirs, path, 1);
......@@ -341,8 +330,7 @@ jcf_path_bootclasspath_arg (path)
/* Call this when -extdirs is seen on the command line.
*/
void
jcf_path_extdirs_arg (cp)
const char *cp;
jcf_path_extdirs_arg (const char *cp)
{
const char *startp, *endp;
......@@ -406,8 +394,7 @@ jcf_path_extdirs_arg (cp)
/* Call this when -I is seen on the command line. */
void
jcf_path_include_arg (path)
const char *path;
jcf_path_include_arg (const char *path)
{
add_entry (&include_dirs, path, 0);
}
......@@ -416,8 +403,7 @@ jcf_path_include_arg (path)
we provide a way to iterate through the sealed list. If PRINT is
true then we print the final class path to stderr. */
void
jcf_path_seal (print)
int print;
jcf_path_seal (int print)
{
struct entry *secondary;
......@@ -465,14 +451,13 @@ jcf_path_seal (print)
}
void *
jcf_path_start ()
jcf_path_start (void)
{
return (void *) sealed;
}
void *
jcf_path_next (x)
void *x;
jcf_path_next (void *x)
{
struct entry *ent = (struct entry *) x;
return (void *) ent->next;
......@@ -481,31 +466,28 @@ jcf_path_next (x)
/* We guarantee that the return path will either be a zip file, or it
will end with a directory separator. */
char *
jcf_path_name (x)
void *x;
jcf_path_name (void *x)
{
struct entry *ent = (struct entry *) x;
return ent->name;
}
int
jcf_path_is_zipfile (x)
void *x;
jcf_path_is_zipfile (void *x)
{
struct entry *ent = (struct entry *) x;
return (ent->flags & FLAG_ZIP);
}
int
jcf_path_is_system (x)
void *x;
jcf_path_is_system (void *x)
{
struct entry *ent = (struct entry *) x;
return (ent->flags & FLAG_SYSTEM);
}
int
jcf_path_max_len ()
jcf_path_max_len (void)
{
return longest_path;
}
......@@ -50,11 +50,8 @@ static void skip_attribute (JCF *, int);
#ifdef NEED_PEEK_ATTRIBUTE /* Not everyone uses this function */
static int
peek_attribute (jcf, attribute_number, peeked_name, peeked_name_length)
JCF *jcf;
int attribute_number;
const char *peeked_name;
int peeked_name_length;
peek_attribute (JCF *jcf, int attribute_number, const char *peeked_name,
int peeked_name_length)
{
int to_return = 0;
long absolute_offset = (long)JCF_TELL (jcf);
......@@ -92,9 +89,7 @@ peek_attribute (jcf, attribute_number, peeked_name, peeked_name_length)
#ifdef NEED_SKIP_ATTRIBUTE /* Not everyone uses this function */
static void
skip_attribute (jcf, number_of_attribute)
JCF *jcf;
int number_of_attribute;
skip_attribute (JCF *jcf, int number_of_attribute)
{
while (number_of_attribute--)
{
......
......@@ -95,14 +95,14 @@ static const struct option options[] =
};
static void
usage ()
usage (void)
{
fprintf (stderr, "Try `jv-scan --help' for more information.\n");
exit (1);
}
static void
help ()
help (void)
{
printf ("Usage: jv-scan [OPTION]... FILE...\n\n");
printf ("Print useful information read from Java source files.\n\n");
......@@ -123,7 +123,7 @@ help ()
}
static void
version ()
version (void)
{
printf ("jv-scan (GCC) %s\n\n", version_string);
printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
......@@ -264,8 +264,7 @@ warning (const char *s, ...)
}
void
gcc_obstack_init (obstack)
struct obstack *obstack;
gcc_obstack_init (struct obstack *obstack)
{
/* Let particular systems override the size of a chunk. */
#ifndef OBSTACK_CHUNK_SIZE
......
......@@ -40,8 +40,7 @@ struct obstack name_obstack;
struct obstack *mangle_obstack = &name_obstack;
void
gcc_obstack_init (obstack)
struct obstack *obstack;
gcc_obstack_init (struct obstack *obstack)
{
/* Let particular systems override the size of a chunk. */
#ifndef OBSTACK_CHUNK_SIZE
......@@ -157,8 +156,7 @@ main (int argc, char **argv)
static char *
do_mangle_classname (string)
const char *string;
do_mangle_classname (const char *string)
{
const char *ptr;
int count = 0;
......
......@@ -292,10 +292,8 @@ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
/* Process an option that can accept a `no-' form.
Return 1 if option found, 0 otherwise. */
static int
process_option_with_no (p, table, table_size)
const char *p;
const struct string_option *table;
int table_size;
process_option_with_no (const char *p, const struct string_option *table,
int table_size)
{
int j;
......@@ -322,9 +320,7 @@ process_option_with_no (p, table, table_size)
* return 0, but do not complain if the option is not recognized.
*/
static int
java_decode_option (argc, argv)
int argc __attribute__ ((__unused__));
char **argv;
java_decode_option (int argc __attribute__ ((__unused__)), char **argv)
{
char *p = argv[0];
......@@ -509,8 +505,7 @@ java_decode_option (argc, argv)
FILE *finput;
static const char *
java_init (filename)
const char *filename;
java_init (const char *filename)
{
#if 0
extern int flag_minimal_debug;
......@@ -599,7 +594,7 @@ java_init (filename)
}
static void
java_finish ()
java_finish (void)
{
jcf_dependency_write ();
}
......@@ -617,9 +612,7 @@ static int decl_bufpos = 0;
It length is given by LEN; -1 means the string is nul-terminated. */
static void
put_decl_string (str, len)
const char *str;
int len;
put_decl_string (const char *str, int len)
{
if (len < 0)
len = strlen (str);
......@@ -643,8 +636,7 @@ put_decl_string (str, len)
/* Append to decl_buf a printable name for NODE. */
static void
put_decl_node (node)
tree node;
put_decl_node (tree node)
{
int was_pointer = 0;
if (TREE_CODE (node) == POINTER_TYPE)
......@@ -719,9 +711,7 @@ put_decl_node (node)
which is also called directly by java_print_error_function. */
const char *
lang_printable_name (decl, v)
tree decl;
int v __attribute__ ((__unused__));
lang_printable_name (tree decl, int v __attribute__ ((__unused__)))
{
decl_bufpos = 0;
put_decl_node (decl);
......@@ -733,9 +723,7 @@ lang_printable_name (decl, v)
space to the DECL name string -- With Leading Space. */
const char *
lang_printable_name_wls (decl, v)
tree decl;
int v __attribute__ ((__unused__));
lang_printable_name_wls (tree decl, int v __attribute__ ((__unused__)))
{
decl_bufpos = 1;
put_decl_node (decl);
......@@ -750,9 +738,8 @@ lang_printable_name_wls (decl, v)
static GTY(()) tree last_error_function_context;
static GTY(()) tree last_error_function;
static void
java_print_error_function (context, file)
diagnostic_context *context __attribute__((__unused__));
const char *file;
java_print_error_function (diagnostic_context *context ATTRIBUTE_UNUSED,
const char *file)
{
/* Don't print error messages with bogus function prototypes. */
if (inhibit_error_function_printing)
......@@ -796,14 +783,13 @@ java_print_error_function (context, file)
2, function prototypes are fully resolved and can be printed when
reporting errors. */
void lang_init_source (level)
int level;
void lang_init_source (int level)
{
inhibit_error_function_printing = (level == 1);
}
static void
java_init_options ()
java_init_options (void)
{
flag_bounds_check = 1;
flag_exceptions = 1;
......@@ -814,7 +800,7 @@ java_init_options ()
}
static bool
java_can_use_bit_fields_p ()
java_can_use_bit_fields_p (void)
{
/* The bit-field optimizations cause problems when generating class
files. */
......@@ -823,7 +809,7 @@ java_can_use_bit_fields_p ()
/* Post-switch processing. */
static bool
java_post_options ()
java_post_options (void)
{
/* Use tree inlining if possible. Function instrumentation is only
done in the RTL level, so we disable tree inlining. */
......@@ -845,8 +831,7 @@ java_post_options ()
/* Return either DECL or its known constant value (if it has one). */
tree
decl_constant_value (decl)
tree decl;
decl_constant_value (tree decl)
{
if (/* Don't change a variable array bound or initial value to a constant
in a place where a variable is invalid. */
......@@ -868,12 +853,11 @@ decl_constant_value (decl)
/* Walk the language specific tree nodes during inlining. */
static tree
java_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab)
tree *tp ATTRIBUTE_UNUSED;
int *subtrees ATTRIBUTE_UNUSED;
walk_tree_fn func ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
void *htab ATTRIBUTE_UNUSED;
java_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED,
int *subtrees ATTRIBUTE_UNUSED,
walk_tree_fn func ATTRIBUTE_UNUSED,
void *data ATTRIBUTE_UNUSED,
void *htab ATTRIBUTE_UNUSED)
{
enum tree_code code;
tree result;
......@@ -914,8 +898,7 @@ java_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab)
/* Called from unsafe_for_reeval. */
static int
java_unsafe_for_reeval (t)
tree t;
java_unsafe_for_reeval (tree t)
{
switch (TREE_CODE (t))
{
......@@ -961,9 +944,7 @@ java_unsafe_for_reeval (t)
to one in the scope of the method being inlined into. */
static int
merge_init_test_initialization (entry, x)
void * * entry;
void * x;
merge_init_test_initialization (void **entry, void *x)
{
struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry;
splay_tree decl_map = (splay_tree)x;
......@@ -991,9 +972,7 @@ merge_init_test_initialization (entry, x)
inlining. */
void
java_inlining_merge_static_initializers (fn, decl_map)
tree fn;
void *decl_map;
java_inlining_merge_static_initializers (tree fn, void *decl_map)
{
htab_traverse
(DECL_FUNCTION_INIT_TEST_TABLE (fn),
......@@ -1007,9 +986,7 @@ java_inlining_merge_static_initializers (fn, decl_map)
pre-existing one. */
static int
inline_init_test_initialization (entry, x)
void * * entry;
void * x;
inline_init_test_initialization (void **entry, void *x)
{
struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry;
splay_tree decl_map = (splay_tree)x;
......@@ -1032,9 +1009,7 @@ inline_init_test_initialization (entry, x)
into, create a new mapping for it. */
void
java_inlining_map_static_initializers (fn, decl_map)
tree fn;
void *decl_map;
java_inlining_map_static_initializers (tree fn, void *decl_map)
{
htab_traverse
(DECL_FUNCTION_INIT_TEST_TABLE (fn),
......@@ -1044,9 +1019,7 @@ java_inlining_map_static_initializers (fn, decl_map)
/* Avoid voluminous output for deep recursion of compound exprs. */
static void
dump_compound_expr (di, t)
dump_info_p di;
tree t;
dump_compound_expr (dump_info_p di, tree t)
{
int i;
......@@ -1072,9 +1045,7 @@ dump_compound_expr (di, t)
}
static int
java_dump_tree (dump_info, t)
void *dump_info;
tree t;
java_dump_tree (void *dump_info, tree t)
{
enum tree_code code;
dump_info_p di = (dump_info_p) dump_info;
......
......@@ -82,9 +82,7 @@ static int need_byteswap = 0;
#endif
void
java_init_lex (finput, encoding)
FILE *finput;
const char *encoding;
java_init_lex (FILE *finput, const char *encoding)
{
#ifndef JC1_LITE
int java_lang_imported = 0;
......@@ -139,9 +137,7 @@ java_init_lex (finput, encoding)
}
static char *
java_sprint_unicode (line, i)
struct java_line *line;
int i;
java_sprint_unicode (struct java_line *line, int i)
{
static char buffer [10];
if (line->unicode_escape_p [i] || line->line [i] > 128)
......@@ -155,13 +151,13 @@ java_sprint_unicode (line, i)
}
static unicode_t
java_sneak_unicode ()
java_sneak_unicode (void)
{
return (ctxp->c_line->line [ctxp->c_line->current]);
}
static void
java_unget_unicode ()
java_unget_unicode (void)
{
if (!ctxp->c_line->current)
/* Can't unget unicode. */
......@@ -172,7 +168,7 @@ java_unget_unicode ()
}
static void
java_allocate_new_line ()
java_allocate_new_line (void)
{
unicode_t ahead = (ctxp->c_line ? ctxp->c_line->ahead[0] : '\0');
char ahead_escape_p = (ctxp->c_line ?
......@@ -217,9 +213,7 @@ java_allocate_new_line ()
/* Create a new lexer object. */
java_lexer *
java_new_lexer (finput, encoding)
FILE *finput;
const char *encoding;
java_new_lexer (FILE *finput, const char *encoding)
{
java_lexer *lex = xmalloc (sizeof (java_lexer));
int enc_error = 0;
......@@ -306,8 +300,7 @@ java_new_lexer (finput, encoding)
}
void
java_destroy_lexer (lex)
java_lexer *lex;
java_destroy_lexer (java_lexer *lex)
{
#ifdef HAVE_ICONV
if (! lex->use_fallback)
......@@ -317,8 +310,7 @@ java_destroy_lexer (lex)
}
static int
java_read_char (lex)
java_lexer *lex;
java_read_char (java_lexer *lex)
{
if (lex->unget_value)
{
......@@ -509,10 +501,7 @@ java_read_char (lex)
}
static void
java_store_unicode (l, c, unicode_escape_p)
struct java_line *l;
unicode_t c;
int unicode_escape_p;
java_store_unicode (struct java_line *l, unicode_t c, int unicode_escape_p)
{
if (l->size == l->max)
{
......@@ -526,9 +515,7 @@ java_store_unicode (l, c, unicode_escape_p)
}
static int
java_read_unicode (lex, unicode_escape_p)
java_lexer *lex;
int *unicode_escape_p;
java_read_unicode (java_lexer *lex, int *unicode_escape_p)
{
int c;
......@@ -582,9 +569,8 @@ java_read_unicode (lex, unicode_escape_p)
}
static int
java_read_unicode_collapsing_terminators (lex, unicode_escape_p)
java_lexer *lex;
int *unicode_escape_p;
java_read_unicode_collapsing_terminators (java_lexer *lex,
int *unicode_escape_p)
{
int c = java_read_unicode (lex, unicode_escape_p);
......@@ -604,7 +590,7 @@ java_read_unicode_collapsing_terminators (lex, unicode_escape_p)
}
static int
java_get_unicode ()
java_get_unicode (void)
{
/* It's time to read a line when... */
if (!ctxp->c_line || ctxp->c_line->current == ctxp->c_line->size)
......@@ -651,8 +637,7 @@ java_get_unicode ()
/* Parse the end of a C style comment.
* C is the first character following the '/' and '*'. */
static void
java_parse_end_comment (c)
int c;
java_parse_end_comment (int c)
{
for ( ;; c = java_get_unicode ())
{
......@@ -681,8 +666,7 @@ java_parse_end_comment (c)
character). Parsed keyword(s): @DEPRECATED. */
static int
java_parse_doc_section (c)
int c;
java_parse_doc_section (int c)
{
int valid_tag = 0, seen_star = 0;
......@@ -734,8 +718,7 @@ java_parse_doc_section (c)
This is only called if C >= 128 -- smaller values are handled
inline. However, this function handles all values anyway. */
static int
java_start_char_p (c)
unicode_t c;
java_start_char_p (unicode_t c)
{
unsigned int hi = c / 256;
const char *const page = type_table[hi];
......@@ -754,8 +737,7 @@ java_start_char_p (c)
This is only called if C >= 128 -- smaller values are handled
inline. However, this function handles all values anyway. */
static int
java_part_char_p (c)
unicode_t c;
java_part_char_p (unicode_t c)
{
unsigned int hi = c / 256;
const char *const page = type_table[hi];
......@@ -771,7 +753,7 @@ java_part_char_p (c)
}
static int
java_parse_escape_sequence ()
java_parse_escape_sequence (void)
{
unicode_t char_lit;
int c;
......@@ -840,11 +822,8 @@ java_parse_escape_sequence ()
static void java_perform_atof (YYSTYPE *, char *, int, int);
static void
java_perform_atof (java_lval, literal_token, fflag, number_beginning)
YYSTYPE *java_lval;
char *literal_token;
int fflag;
int number_beginning;
java_perform_atof (YYSTYPE *java_lval, char *literal_token, int fflag,
int number_beginning)
{
REAL_VALUE_TYPE value;
tree type = (fflag ? FLOAT_TYPE_NODE : DOUBLE_TYPE_NODE);
......@@ -891,11 +870,10 @@ static int yylex (YYSTYPE *);
static int
#ifdef JC1_LITE
yylex (java_lval)
yylex (YYSTYPE *java_lval)
#else
java_lex (java_lval)
java_lex (YYSTYPE *java_lval)
#endif
YYSTYPE *java_lval;
{
int c;
unicode_t first_unicode;
......@@ -1654,8 +1632,7 @@ java_lex (java_lval)
case of the largest negative value, and is only called in the case
where this value is not preceded by `-'. */
static void
error_if_numeric_overflow (value)
tree value;
error_if_numeric_overflow (tree value)
{
if (TREE_CODE (value) == INTEGER_CST
&& JAVA_RADIX10_FLAG (value)
......@@ -1670,8 +1647,7 @@ error_if_numeric_overflow (value)
#endif /* JC1_LITE */
static void
java_unicode_2_utf8 (unicode)
unicode_t unicode;
java_unicode_2_utf8 (unicode_t unicode)
{
if (RANGE (unicode, 0x01, 0x7f))
obstack_1grow (&temporary_obstack, (char)unicode);
......@@ -1695,8 +1671,7 @@ java_unicode_2_utf8 (unicode)
#ifndef JC1_LITE
static tree
build_wfl_node (node)
tree node;
build_wfl_node (tree node)
{
node = build_expr_wfl (node, ctxp->filename, ctxp->elc.line, ctxp->elc.col);
/* Prevent java_complete_lhs from short-circuiting node (if constant). */
......@@ -1706,9 +1681,7 @@ build_wfl_node (node)
#endif
static void
java_lex_error (msg, forward)
const char *msg ATTRIBUTE_UNUSED;
int forward ATTRIBUTE_UNUSED;
java_lex_error (const char *msg ATTRIBUTE_UNUSED, int forward ATTRIBUTE_UNUSED)
{
#ifndef JC1_LITE
ctxp->elc.line = ctxp->c_line->lineno;
......@@ -1723,9 +1696,7 @@ java_lex_error (msg, forward)
#ifndef JC1_LITE
static int
java_is_eol (fp, c)
FILE *fp;
int c;
java_is_eol (FILE *fp, int c)
{
int next;
switch (c)
......@@ -1744,9 +1715,8 @@ java_is_eol (fp, c)
#endif
char *
java_get_line_col (filename, line, col)
const char *filename ATTRIBUTE_UNUSED;
int line ATTRIBUTE_UNUSED, col ATTRIBUTE_UNUSED;
java_get_line_col (const char *filename ATTRIBUTE_UNUSED,
int line ATTRIBUTE_UNUSED, int col ATTRIBUTE_UNUSED)
{
#ifdef JC1_LITE
return 0;
......@@ -1822,10 +1792,7 @@ java_get_line_col (filename, line, col)
#ifndef JC1_LITE
static int
utf8_cmp (str, length, name)
const unsigned char *str;
int length;
const char *name;
utf8_cmp (const unsigned char *str, int length, const char *name)
{
const unsigned char *limit = str + length;
int i;
......@@ -1953,9 +1920,7 @@ static const char *const cxx_keywords[] =
/* Return true if NAME is a C++ keyword. */
int
cxx_keyword_p (name, length)
const char *name;
int length;
cxx_keyword_p (const char *name, int length)
{
int last = ARRAY_SIZE (cxx_keywords);
int first = 0;
......
......@@ -71,9 +71,7 @@ struct obstack *mangle_obstack;
the vtable. */
tree
java_mangle_decl (obstack, decl)
struct obstack *obstack;
tree decl;
java_mangle_decl (struct obstack *obstack, tree decl)
{
init_mangling (obstack);
switch (TREE_CODE (decl))
......@@ -91,9 +89,7 @@ java_mangle_decl (obstack, decl)
}
tree
java_mangle_class_field (obstack, type)
struct obstack *obstack;
tree type;
java_mangle_class_field (struct obstack *obstack, tree type)
{
init_mangling (obstack);
mangle_record_type (type, /* for_pointer = */ 0);
......@@ -103,9 +99,7 @@ java_mangle_class_field (obstack, type)
}
tree
java_mangle_vtable (obstack, type)
struct obstack *obstack;
tree type;
java_mangle_vtable (struct obstack *obstack, tree type)
{
init_mangling (obstack);
MANGLE_RAW_STRING ("TV");
......@@ -119,8 +113,7 @@ java_mangle_vtable (obstack, type)
/* This mangles a field decl */
static void
mangle_field_decl (decl)
tree decl;
mangle_field_decl (tree decl)
{
/* Mangle the name of the this the field belongs to */
mangle_record_type (DECL_CONTEXT (decl), /* for_pointer = */ 0);
......@@ -136,8 +129,7 @@ mangle_field_decl (decl)
its arguments. */
static void
mangle_method_decl (mdecl)
tree mdecl;
mangle_method_decl (tree mdecl)
{
tree method_name = DECL_NAME (mdecl);
tree arglist;
......@@ -177,8 +169,7 @@ mangle_method_decl (mdecl)
value if unicode encoding was required. */
static void
mangle_member_name (name)
tree name;
mangle_member_name (tree name)
{
append_gpp_mangled_name (IDENTIFIER_POINTER (name),
IDENTIFIER_LENGTH (name));
......@@ -191,8 +182,7 @@ mangle_member_name (name)
/* Append the mangled name of TYPE onto OBSTACK. */
static void
mangle_type (type)
tree type;
mangle_type (tree type)
{
switch (TREE_CODE (type))
{
......@@ -255,8 +245,7 @@ static int compression_next;
function to match pointer entries and start from the end */
static int
find_compression_pointer_match (type)
tree type;
find_compression_pointer_match (tree type)
{
int i;
......@@ -270,8 +259,7 @@ find_compression_pointer_match (type)
associated with it. */
static int
find_compression_array_match (type)
tree type;
find_compression_array_match (tree type)
{
return find_compression_pointer_match (type);
}
......@@ -279,8 +267,7 @@ find_compression_array_match (type)
/* Match the table of type against STRING. */
static int
find_compression_array_template_match (string)
tree string;
find_compression_array_template_match (tree string)
{
int i;
for (i = 0; i < compression_next; i++)
......@@ -295,9 +282,7 @@ find_compression_array_template_match (string)
to the rest of TYPE to be mangled. */
static int
find_compression_record_match (type, next_current)
tree type;
tree *next_current;
find_compression_record_match (tree type, tree *next_current)
{
int i, match;
tree current, saved_current = NULL_TREE;
......@@ -349,9 +334,7 @@ find_compression_record_match (type, next_current)
symbol, meaning it was preceded by a 'P'. */
static int
mangle_record_type (type, for_pointer)
tree type;
int for_pointer;
mangle_record_type (tree type, int for_pointer)
{
tree current;
int match;
......@@ -402,8 +385,7 @@ mangle_record_type (type, for_pointer)
a partial compression or/plus the rest of the mangling. */
static void
mangle_pointer_type (type)
tree type;
mangle_pointer_type (tree type)
{
int match;
tree pointer_type;
......@@ -437,8 +419,7 @@ mangle_pointer_type (type)
/* atms: array template mangled string. */
static GTY(()) tree atms;
static void
mangle_array_type (p_type)
tree p_type;
mangle_array_type (tree p_type)
{
tree type, elt_type;
int match;
......@@ -526,9 +507,7 @@ emit_compression_string (int i)
might all be unique, we find the same RECORD_TYPE.) */
static int
entry_match_pointer_p (type, i)
tree type;
int i;
entry_match_pointer_p (tree type, int i)
{
tree t = TREE_VEC_ELT (compression_table, i);
......@@ -549,8 +528,7 @@ entry_match_pointer_p (type, i)
part. The result is stored in TYPE_PACKAGE_LIST to be reused. */
static void
set_type_package_list (type)
tree type;
set_type_package_list (tree type)
{
int i;
const char *type_string = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
......@@ -593,8 +571,7 @@ set_type_package_list (type)
compression table if necessary. */
static void
compression_table_add (type)
tree type;
compression_table_add (tree type)
{
if (compression_next == TREE_VEC_LENGTH (compression_table))
{
......@@ -612,8 +589,7 @@ compression_table_add (type)
/* Mangling initialization routine. */
static void
init_mangling (obstack)
struct obstack *obstack;
init_mangling (struct obstack *obstack)
{
mangle_obstack = obstack;
if (!compression_table)
......@@ -630,7 +606,7 @@ init_mangling (obstack)
IDENTIFIER_NODE. */
static tree
finish_mangling ()
finish_mangling (void)
{
tree result;
......
......@@ -53,9 +53,7 @@ extern struct obstack *mangle_obstack;
frequently that they could be cached. */
void
append_gpp_mangled_name (name, len)
const char *name;
int len;
append_gpp_mangled_name (const char *name, int len)
{
int encoded_len = unicode_mangling_length (name, len);
int needs_escapes = encoded_len > 0;
......@@ -76,9 +74,7 @@ append_gpp_mangled_name (name, len)
which case `__U' will be mangled `__U_'. */
static void
append_unicode_mangled_name (name, len)
const char *name;
int len;
append_unicode_mangled_name (const char *name, int len)
{
const unsigned char *ptr;
const unsigned char *limit = (const unsigned char *)name + len;
......@@ -129,9 +125,7 @@ append_unicode_mangled_name (name, len)
escapes. If no escapes are needed, return 0. */
static int
unicode_mangling_length (name, len)
const char *name;
int len;
unicode_mangling_length (const char *name, int len)
{
const unsigned char *ptr;
const unsigned char *limit = (const unsigned char *)name + len;
......@@ -199,9 +193,7 @@ unicode_mangling_length (name, len)
so frequently that they could be cached. */
void
append_gpp_mangled_name (name, len)
const char *name;
int len;
append_gpp_mangled_name (const char *name, int len)
{
const unsigned char *ptr;
const unsigned char *limit = (const unsigned char *)name + len;
......
......@@ -1176,7 +1176,7 @@ constant_expression:
/* Create a new parser context */
void
java_push_parser_context ()
java_push_parser_context (void)
{
struct parser_ctxt *new = xcalloc (1, sizeof (struct parser_ctxt));
......@@ -1185,8 +1185,7 @@ java_push_parser_context ()
}
static void
push_class_context (name)
const char *name;
push_class_context (const char *name)
{
struct class_context *ctx;
......@@ -1197,7 +1196,7 @@ push_class_context (name)
}
static void
pop_class_context ()
pop_class_context (void)
{
struct class_context *ctx;
......@@ -1217,9 +1216,7 @@ pop_class_context ()
/* Recursively construct the class name. This is just a helper
function for get_class_name(). */
static int
make_class_name_recursive (stack, ctx)
struct obstack *stack;
struct class_context *ctx;
make_class_name_recursive (struct obstack *stack, struct class_context *ctx)
{
if (! ctx)
return 0;
......@@ -1243,7 +1240,7 @@ make_class_name_recursive (stack, ctx)
/* Return a newly allocated string holding the name of the class. */
static char *
get_class_name ()
get_class_name (void)
{
char *result;
int last_was_digit;
......@@ -1287,8 +1284,7 @@ get_class_name ()
/* Actions defined here */
static void
report_class_declaration (name)
const char * name;
report_class_declaration (const char * name)
{
extern int flag_dump_class, flag_list_filename;
......@@ -1314,8 +1310,7 @@ report_class_declaration (name)
}
static void
report_main_declaration (declarator)
struct method_declarator *declarator;
report_main_declaration (struct method_declarator *declarator)
{
extern int flag_find_main;
......@@ -1342,7 +1337,7 @@ report_main_declaration (declarator)
}
void
report ()
report (void)
{
extern int flag_complexity;
if (flag_complexity)
......@@ -1351,7 +1346,7 @@ report ()
/* Reset global status used by the report functions. */
void reset_report ()
void reset_report (void)
{
previous_output = 0;
package_name = NULL;
......@@ -1360,8 +1355,7 @@ void reset_report ()
}
void
yyerror (msg)
const char *msg ATTRIBUTE_UNUSED;
yyerror (const char *msg ATTRIBUTE_UNUSED)
{
fprintf (stderr, "%s: %d: %s\n", input_filename, lineno, msg);
exit (1);
......
......@@ -50,9 +50,7 @@ tree * type_map;
/* Set the type of the local variable with index SLOT to TYPE. */
void
set_local_type (slot, type)
int slot;
tree type;
set_local_type (int slot, tree type)
{
int max_locals = DECL_MAX_LOCALS(current_function_decl);
int nslots = TYPE_IS_WIDE (type) ? 2 : 1;
......@@ -80,8 +78,7 @@ set_local_type (slot, type)
: (int)expr))) */
static tree
convert_ieee_real_to_integer (type, expr)
tree type, expr;
convert_ieee_real_to_integer (tree type, tree expr)
{
tree result;
expr = save_expr (expr);
......@@ -113,8 +110,7 @@ convert_ieee_real_to_integer (type, expr)
not permitted by the language being compiled. */
tree
convert (type, expr)
tree type, expr;
convert (tree type, tree expr)
{
register enum tree_code code = TREE_CODE (type);
......@@ -155,15 +151,13 @@ convert (type, expr)
tree
convert_to_char (type, expr)
tree type, expr;
convert_to_char (tree type, tree expr)
{
return build1 (NOP_EXPR, type, expr);
}
tree
convert_to_boolean (type, expr)
tree type, expr;
convert_to_boolean (tree type, tree expr)
{
return build1 (NOP_EXPR, type, expr);
}
......@@ -173,9 +167,7 @@ convert_to_boolean (type, expr)
then UNSIGNEDP selects between signed and unsigned types. */
tree
java_type_for_mode (mode, unsignedp)
enum machine_mode mode;
int unsignedp;
java_type_for_mode (enum machine_mode mode, int unsignedp)
{
if (mode == TYPE_MODE (int_type_node))
return unsignedp ? unsigned_int_type_node : int_type_node;
......@@ -197,9 +189,7 @@ java_type_for_mode (mode, unsignedp)
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
tree
java_type_for_size (bits, unsignedp)
unsigned bits;
int unsignedp;
java_type_for_size (unsigned bits, int unsignedp)
{
if (bits <= TYPE_PRECISION (byte_type_node))
return unsignedp ? unsigned_byte_type_node : byte_type_node;
......@@ -216,9 +206,7 @@ java_type_for_size (bits, unsignedp)
signed according to UNSIGNEDP. */
tree
java_signed_or_unsigned_type (unsignedp, type)
int unsignedp;
tree type;
java_signed_or_unsigned_type (int unsignedp, tree type)
{
if (! INTEGRAL_TYPE_P (type))
return type;
......@@ -236,8 +224,7 @@ java_signed_or_unsigned_type (unsignedp, type)
/* Return a signed type the same as TYPE in other respects. */
tree
java_signed_type (type)
tree type;
java_signed_type (tree type)
{
return java_signed_or_unsigned_type (0, type);
}
......@@ -245,8 +232,7 @@ java_signed_type (type)
/* Return an unsigned type the same as TYPE in other respects. */
tree
java_unsigned_type (type)
tree type;
java_unsigned_type (tree type)
{
return java_signed_or_unsigned_type (1, type);
}
......@@ -256,8 +242,7 @@ java_unsigned_type (type)
Value is true if successful. */
bool
java_mark_addressable (exp)
tree exp;
java_mark_addressable (tree exp)
{
register tree x = exp;
while (1)
......@@ -320,8 +305,7 @@ java_mark_addressable (exp)
/* Thorough checking of the arrayness of TYPE. */
int
is_array_type_p (type)
tree type;
is_array_type_p (tree type)
{
return TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE
......@@ -332,8 +316,7 @@ is_array_type_p (type)
Return -1 if the length is unknown or non-constant. */
HOST_WIDE_INT
java_array_type_length (array_type)
tree array_type;
java_array_type_length (tree array_type)
{
tree arfld;
if (TREE_CODE (array_type) == POINTER_TYPE)
......@@ -358,9 +341,7 @@ java_array_type_length (array_type)
`length' from static arrays. We could restore it, FIXME. */
tree
build_prim_array_type (element_type, length)
tree element_type;
HOST_WIDE_INT length;
build_prim_array_type (tree element_type, HOST_WIDE_INT length)
{
tree index = NULL;
......@@ -378,9 +359,7 @@ build_prim_array_type (element_type, length)
The LENGTH is -1 if the length is unknown. */
tree
build_java_array_type (element_type, length)
tree element_type;
HOST_WIDE_INT length;
build_java_array_type (tree element_type, HOST_WIDE_INT length)
{
tree sig, t, fld, atype, arfld;
char buf[12];
......@@ -441,8 +420,7 @@ build_java_array_type (element_type, length)
/* Promote TYPE to the type actually used for fields and parameters. */
tree
promote_type (type)
tree type;
promote_type (tree type)
{
switch (TREE_CODE (type))
{
......@@ -476,8 +454,7 @@ promote_type (type)
Return the seen TREE_TYPE, updating *PTR. */
static tree
parse_signature_type (ptr, limit)
const unsigned char **ptr, *limit;
parse_signature_type (const unsigned char **ptr, const unsigned char *limit)
{
tree type;
......@@ -526,9 +503,7 @@ parse_signature_type (ptr, limit)
Return a gcc type node. */
tree
parse_signature_string (sig_string, sig_length)
const unsigned char *sig_string;
int sig_length;
parse_signature_string (const unsigned char *sig_string, int sig_length)
{
tree result_type;
const unsigned char *str = sig_string;
......@@ -581,8 +556,7 @@ get_type_from_signature (tree signature)
/* Ignore signature and always return null. Used by has_method. */
static tree
build_null_signature (type)
tree type ATTRIBUTE_UNUSED;
build_null_signature (tree type ATTRIBUTE_UNUSED)
{
return NULL_TREE;
}
......@@ -590,8 +564,7 @@ build_null_signature (type)
/* Return the signature string for the arguments of method type TYPE. */
tree
build_java_argument_signature (type)
tree type;
build_java_argument_signature (tree type)
{
extern struct obstack temporary_obstack;
tree sig = TYPE_ARGUMENT_SIGNATURE (type);
......@@ -618,8 +591,7 @@ build_java_argument_signature (type)
/* Return the signature of the given TYPE. */
tree
build_java_signature (type)
tree type;
build_java_signature (tree type)
{
tree sig, t;
while (TREE_CODE (type) == POINTER_TYPE)
......@@ -699,9 +671,7 @@ build_java_signature (type)
/* Save signature string SIG (an IDENTIFIER_NODE) in TYPE for future use. */
void
set_java_signature (type, sig)
tree type;
tree sig;
set_java_signature (tree type, tree sig)
{
tree old_sig;
while (TREE_CODE (type) == POINTER_TYPE)
......@@ -725,8 +695,7 @@ set_java_signature (type, sig)
signature. */
tree
lookup_argument_method (searched_class, method_name, method_signature)
tree searched_class, method_name, method_signature;
lookup_argument_method (tree searched_class, tree method_name, tree method_signature)
{
return lookup_do (searched_class, NULL_TREE, method_name, method_signature,
build_java_argument_signature);
......@@ -739,8 +708,7 @@ lookup_argument_method (searched_class, method_name, method_signature)
which takes into account return type.) */
tree
lookup_argument_method2 (searched_class, method_name, method_signature)
tree searched_class, method_name, method_signature;
lookup_argument_method2 (tree searched_class, tree method_name, tree method_signature)
{
return lookup_do (CLASSTYPE_SUPER (searched_class), searched_class,
method_name, method_signature,
......@@ -754,8 +722,7 @@ lookup_argument_method2 (searched_class, method_name, method_signature)
SEARCHED_CLASS is an interface, search it too. */
tree
lookup_java_method (searched_class, method_name, method_signature)
tree searched_class, method_name, method_signature;
lookup_java_method (tree searched_class, tree method_name, tree method_signature)
{
tree searched_interface;
......@@ -772,9 +739,7 @@ lookup_java_method (searched_class, method_name, method_signature)
/* Return true iff CLASS (or its ancestors) has a method METHOD_NAME. */
int
has_method (class, method_name)
tree class;
tree method_name;
has_method (tree class, tree method_name)
{
return lookup_do (class, class, method_name,
NULL_TREE, build_null_signature) != NULL_TREE;
......@@ -788,9 +753,8 @@ has_method (class, method_name)
signature. */
static tree
lookup_do (searched_class, searched_interface, method_name, signature, signature_builder)
tree searched_class, searched_interface, method_name, signature;
tree (*signature_builder) (tree);
lookup_do (tree searched_class, tree searched_interface, tree method_name,
tree signature, tree (*signature_builder) (tree))
{
tree method;
......@@ -851,8 +815,7 @@ lookup_do (searched_class, searched_interface, method_name, signature, signature
Return a FUNCTION_DECL on success, or NULL_TREE if none found. */
tree
lookup_java_constructor (clas, method_signature)
tree clas, method_signature;
lookup_java_constructor (tree clas, tree method_signature)
{
tree method = TYPE_METHODS (clas);
for ( ; method != NULL_TREE; method = TREE_CHAIN (method))
......@@ -869,11 +832,7 @@ lookup_java_constructor (clas, method_signature)
Promotion. It assumes that both T1 and T2 are eligible to BNP. */
tree
binary_numeric_promotion (t1, t2, exp1, exp2)
tree t1;
tree t2;
tree *exp1;
tree *exp2;
binary_numeric_promotion (tree t1, tree t2, tree *exp1, tree *exp2)
{
if (t1 == double_type_node || t2 == double_type_node)
{
......
......@@ -56,8 +56,7 @@ tree pending_blocks;
/* Append TARGET_LABEL to the pending_block stack unless already in it. */
static void
push_pending_label (target_label)
tree target_label;
push_pending_label (tree target_label)
{
if (! LABEL_CHANGED (target_label))
{
......@@ -72,8 +71,7 @@ push_pending_label (target_label)
Return NULL on success, or an error message on failure. */
static const char *
check_pending_block (target_label)
tree target_label;
check_pending_block (tree target_label)
{
int changed = merge_type_state (target_label);
......@@ -129,8 +127,7 @@ subroutine_nesting (tree label)
Return TYPE_UNKNOWN if the types cannot be merged. */
static tree
merge_types (type1, type2)
tree type1, type2;
merge_types (tree type1, tree type2)
{
if (type1 == type2)
return type1;
......@@ -245,8 +242,7 @@ merge_types (type1, type2)
0 if there was no change, and 1 if there was a change. */
int
merge_type_state (label)
tree label;
merge_type_state (tree label)
{
int nlocals = DECL_MAX_LOCALS (current_function_decl);
int cur_length = stack_pointer + nlocals;
......@@ -308,8 +304,7 @@ merge_type_state (label)
/* Handle dup-like operations. */
static void
type_stack_dup (size, offset)
int size, offset;
type_stack_dup (int size, int offset)
{
tree type[4];
int index;
......@@ -350,9 +345,7 @@ struct pc_index
/* A helper that is used when sorting exception ranges. */
static int
start_pc_cmp (xp, yp)
const void *xp;
const void *yp;
start_pc_cmp (const void *xp, const void *yp)
{
const struct pc_index *x = (const struct pc_index *) xp;
const struct pc_index *y = (const struct pc_index *) yp;
......@@ -375,8 +368,7 @@ start_pc_cmp (xp, yp)
Return NULL on success and a freshly malloc'd error message on failure. */
static char *
pop_argument_types (arg_types)
tree arg_types;
pop_argument_types (tree arg_types)
{
if (arg_types == end_params_node)
return NULL;
......@@ -419,10 +411,7 @@ pop_argument_types (arg_types)
/* Verify the bytecodes of the current method.
Return 1 on success, 0 on failure. */
int
verify_jvm_instructions (jcf, byte_ops, length)
JCF* jcf;
const unsigned char *byte_ops;
long length;
verify_jvm_instructions (JCF* jcf, const unsigned char *byte_ops, long length)
{
tree label;
int wide = 0;
......
......@@ -41,8 +41,7 @@ static xref_flag_table xref_table [] = {
/* Decode an xref flag value. Return 0 if the flag wasn't found. */
int
xref_flag_value (flag)
const char *flag;
xref_flag_value (const char *flag)
{
int i;
for (i = 0; xref_table [i].key; i++)
......@@ -52,23 +51,19 @@ xref_flag_value (flag)
}
void
xref_set_data (flag, data)
int flag;
void *data;
xref_set_data (int flag, void *data)
{
xref_table [flag-1].data = data;
}
void *
xref_get_data (flag)
int flag;
xref_get_data (int flag)
{
return xref_table [flag-1].data;
}
void
xref_set_current_fp (fp)
FILE *fp;
xref_set_current_fp (FILE *fp)
{
xref_table [flag_emit_xref-1].fp = fp;
}
......@@ -76,8 +71,7 @@ xref_set_current_fp (fp)
/* Branch to the right xref "back-end". */
void
expand_xref (node)
tree node;
expand_xref (tree node)
{
/* Maintain these two cached. */
static FILE *fp = NULL;
......
......@@ -222,8 +222,7 @@ static long find_zip_file_start (int fd, long offset);
/* Function makeword() */
/***********************/
static ush makeword(b)
const uch *b;
static ush makeword(const uch *b)
{
/*
* Convert Intel style 'short' integer to non-Intel non-16-bit
......@@ -237,8 +236,7 @@ static ush makeword(b)
/* Function makelong() */
/***********************/
static ulg makelong(sig)
const uch *sig;
static ulg makelong(const uch *sig)
{
/*
* Convert intel style 'long' variable to non-Intel non-16-bit
......@@ -254,9 +252,7 @@ static ulg makelong(sig)
start of the actual data. Return -1 on error. OFFSET is the
offset from the beginning of the zip file of the file's header. */
static long
find_zip_file_start (fd, offset)
int fd;
long offset;
find_zip_file_start (int fd, long offset)
{
int filename_length, extra_field_length;
unsigned char buffer[LREC_SIZE + 4];
......@@ -277,8 +273,7 @@ find_zip_file_start (fd, offset)
}
int
read_zip_archive (zipf)
register ZipFile *zipf;
read_zip_archive (ZipFile *zipf)
{
int i;
int dir_last_pad;
......@@ -356,7 +351,7 @@ read_zip_archive (zipf)
}
#ifdef TEST
main ()
main (void)
{
ZipFile zipf[1];
ZipDirectory *zipd;
......
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