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