Commit d593dd8c by Kaveh R. Ghazi Committed by Kaveh Ghazi

class.c (finish_class): Remove unused parameter, all callers changed.

	* class.c (finish_class): Remove unused parameter, all callers
	changed.

	* expr.c (build_java_athrow): Change return type to void.
	(java_lang_expand_expr): Make sure each case in switch returns a
	value.

	* java-tree.h (finish_class): Fix prototype to take void args.

	* jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
	(main): Issue return from main, not exit.

	* jcf-parse.c (parse_class_file): Fix call to `finish_class'.

	* jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.

	* jv-scan.c (main): Issue return from main, not exit.

	* parse.y (check_abstract_method_definitions,
	java_check_abstract_method_definitions): Add static prototypes.
	(java_complete_expand_methods): Fix call to `finish_class'.

	* verify.c (verify_jvm_instructions): Initialize variables `oldpc'
	and `prevpc'.

From-SVN: r29065
parent 57bcb97a
1999-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* class.c (finish_class): Remove unused parameter, all callers
changed.
* expr.c (build_java_athrow): Change return type to void.
(java_lang_expand_expr): Make sure each case in switch returns a
value.
* java-tree.h (finish_class): Fix prototype to take void args.
* jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
(main): Issue return from main, not exit.
* jcf-parse.c (parse_class_file): Fix call to `finish_class'.
* jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
* jv-scan.c (main): Issue return from main, not exit.
* parse.y (check_abstract_method_definitions,
java_check_abstract_method_definitions): Add static prototypes.
(java_complete_expand_methods): Fix call to `finish_class'.
* verify.c (verify_jvm_instructions): Initialize variables `oldpc'
and `prevpc'.
1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* lang.c (language_string): Constify. * lang.c (language_string): Constify.
......
...@@ -1198,8 +1198,7 @@ make_class_data (type) ...@@ -1198,8 +1198,7 @@ make_class_data (type)
} }
void void
finish_class (cl) finish_class ()
tree cl;
{ {
tree method; tree method;
tree type_methods = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class)); tree type_methods = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class));
......
...@@ -46,7 +46,7 @@ static void push_value PROTO ((tree)); ...@@ -46,7 +46,7 @@ static void push_value PROTO ((tree));
static tree pop_value PROTO ((tree)); static tree pop_value PROTO ((tree));
static void java_stack_swap PROTO ((void)); static void java_stack_swap PROTO ((void));
static void java_stack_dup PROTO ((int, int)); static void java_stack_dup PROTO ((int, int));
static tree build_java_athrow PROTO ((tree)); static void build_java_athrow PROTO ((tree));
static void build_java_jsr PROTO ((tree, tree)); static void build_java_jsr PROTO ((tree, tree));
static void build_java_ret PROTO ((tree)); static void build_java_ret PROTO ((tree));
static void expand_java_multianewarray PROTO ((tree, int)); static void expand_java_multianewarray PROTO ((tree, int));
...@@ -525,7 +525,7 @@ java_stack_dup (size, offset) ...@@ -525,7 +525,7 @@ java_stack_dup (size, offset)
/* Calls _Jv_Throw. Discard the contents of the value stack. */ /* Calls _Jv_Throw. Discard the contents of the value stack. */
static tree static void
build_java_athrow (node) build_java_athrow (node)
tree node; tree node;
{ {
...@@ -1982,7 +1982,7 @@ java_lang_expand_expr (exp, target, tmode, modifier) ...@@ -1982,7 +1982,7 @@ java_lang_expand_expr (exp, target, tmode, modifier)
expand_end_bindings (getdecls (), 1, 0); expand_end_bindings (getdecls (), 1, 0);
return const0_rtx; return const0_rtx;
} }
break; return const0_rtx;
case CASE_EXPR: case CASE_EXPR:
{ {
...@@ -2033,7 +2033,7 @@ java_lang_expand_expr (exp, target, tmode, modifier) ...@@ -2033,7 +2033,7 @@ java_lang_expand_expr (exp, target, tmode, modifier)
end_catch_handler (); end_catch_handler ();
} }
expand_end_all_catch (); expand_end_all_catch ();
break; return const0_rtx;
default: default:
fatal ("Can't expand '%s' tree - java_lang_expand_expr", fatal ("Can't expand '%s' tree - java_lang_expand_expr",
......
...@@ -586,7 +586,7 @@ extern void parse_error_context PVPROTO ((tree cl, const char *, ...)) ...@@ -586,7 +586,7 @@ extern void parse_error_context PVPROTO ((tree cl, const char *, ...))
ATTRIBUTE_PRINTF_2; ATTRIBUTE_PRINTF_2;
extern tree build_primtype_type_ref PROTO ((const char *)); extern tree build_primtype_type_ref PROTO ((const char *));
extern tree java_get_real_method_name PROTO ((tree)); extern tree java_get_real_method_name PROTO ((tree));
extern void finish_class PROTO ((tree)); extern void finish_class PROTO ((void));
extern void java_layout_seen_class_methods PROTO ((void)); extern void java_layout_seen_class_methods PROTO ((void));
extern void check_for_initialization PROTO ((tree)); extern void check_for_initialization PROTO ((tree));
......
...@@ -86,7 +86,7 @@ static void disassemble_method PROTO ((JCF*, const unsigned char *, int)); ...@@ -86,7 +86,7 @@ static void disassemble_method PROTO ((JCF*, const unsigned char *, int));
static void print_name PROTO ((FILE*, JCF*, int)); static void print_name PROTO ((FILE*, JCF*, int));
static void print_signature PROTO ((FILE*, JCF*, int, int)); static void print_signature PROTO ((FILE*, JCF*, int, int));
static int utf8_equal_string PROTO ((struct JCF*, int, const char *)); static int utf8_equal_string PROTO ((struct JCF*, int, const char *));
static int usage PROTO ((void)); static int usage PROTO ((void)) ATTRIBUTE_NORETURN;
static void process_class PROTO ((struct JCF *)); static void process_class PROTO ((struct JCF *));
static void print_constant_pool PROTO ((struct JCF *)); static void print_constant_pool PROTO ((struct JCF *));
static void print_exception_table PROTO ((struct JCF *, static void print_exception_table PROTO ((struct JCF *,
...@@ -760,7 +760,7 @@ DEFUN(main, (argc, argv), ...@@ -760,7 +760,7 @@ DEFUN(main, (argc, argv),
else else
{ {
fprintf (stderr, "%s: illegal argument\n", argv[argi]); fprintf (stderr, "%s: illegal argument\n", argv[argi]);
exit (FATAL_EXIT_CODE); return FATAL_EXIT_CODE;
} }
} }
...@@ -784,7 +784,7 @@ DEFUN(main, (argc, argv), ...@@ -784,7 +784,7 @@ DEFUN(main, (argc, argv),
if (out) if (out)
{ {
fprintf (stderr, "Cannot open '%s' for output.\n", output_file); fprintf (stderr, "Cannot open '%s' for output.\n", output_file);
exit (FATAL_EXIT_CODE); return FATAL_EXIT_CODE;
} }
} }
else else
...@@ -811,7 +811,7 @@ DEFUN(main, (argc, argv), ...@@ -811,7 +811,7 @@ DEFUN(main, (argc, argv),
if (class_filename == NULL) if (class_filename == NULL)
{ {
perror ("Could not find class"); perror ("Could not find class");
exit (FATAL_EXIT_CODE); return FATAL_EXIT_CODE;
} }
JCF_FILL (jcf, 4); JCF_FILL (jcf, 4);
if (GET_u4 (jcf->read_ptr) == ZIPMAGIC) if (GET_u4 (jcf->read_ptr) == ZIPMAGIC)
...@@ -834,7 +834,7 @@ DEFUN(main, (argc, argv), ...@@ -834,7 +834,7 @@ DEFUN(main, (argc, argv),
if (magic != 0x04034b50) /* ZIPMAGIC (little-endian) */ if (magic != 0x04034b50) /* ZIPMAGIC (little-endian) */
{ {
fprintf (stderr, "bad format of .zip/.jar archive\n"); fprintf (stderr, "bad format of .zip/.jar archive\n");
exit (FATAL_EXIT_CODE); return FATAL_EXIT_CODE;
} }
JCF_FILL (jcf, 26); JCF_FILL (jcf, 26);
JCF_SKIP (jcf, 2); JCF_SKIP (jcf, 2);
...@@ -908,7 +908,7 @@ DEFUN(main, (argc, argv), ...@@ -908,7 +908,7 @@ DEFUN(main, (argc, argv),
} }
} }
exit (SUCCESS_EXIT_CODE); return SUCCESS_EXIT_CODE;
} }
static void static void
......
...@@ -733,7 +733,7 @@ parse_class_file () ...@@ -733,7 +733,7 @@ parse_class_file ()
if (flag_emit_class_files) if (flag_emit_class_files)
write_classfile (current_class); write_classfile (current_class);
finish_class (current_class); finish_class ();
debug_end_source_file (save_lineno); debug_end_source_file (save_lineno);
input_filename = save_input_filename; input_filename = save_input_filename;
......
...@@ -227,7 +227,7 @@ extern const char *find_class PROTO ((const char *, int, JCF*, int)); ...@@ -227,7 +227,7 @@ extern const char *find_class PROTO ((const char *, int, JCF*, int));
extern const char *find_classfile PROTO ((char *, JCF*, const char *)); extern const char *find_classfile PROTO ((char *, JCF*, const char *));
extern int jcf_filbuf_from_stdio PROTO ((JCF *jcf, int count)); extern int jcf_filbuf_from_stdio PROTO ((JCF *jcf, int count));
extern void jcf_out_of_synch PROTO((JCF *)); extern void jcf_out_of_synch PROTO((JCF *));
extern int jcf_unexpected_eof PROTO ((JCF*, int)); extern int jcf_unexpected_eof PROTO ((JCF*, int)) ATTRIBUTE_NORETURN;
/* Extract a character from a Java-style Utf8 string. /* Extract a character from a Java-style Utf8 string.
* PTR points to the current character. * PTR points to the current character.
......
...@@ -95,7 +95,7 @@ DEFUN (main, (argc, argv), ...@@ -95,7 +95,7 @@ DEFUN (main, (argc, argv),
/* No flags? Do nothing */ /* No flags? Do nothing */
if (!flag_find_main && !flag_dump_class) if (!flag_find_main && !flag_dump_class)
exit (0); return 0;
/* Check on bad usage */ /* Check on bad usage */
if (flag_find_main && flag_dump_class) if (flag_find_main && flag_dump_class)
...@@ -134,7 +134,7 @@ DEFUN (main, (argc, argv), ...@@ -134,7 +134,7 @@ DEFUN (main, (argc, argv),
if (!output_file) if (!output_file)
fclose (out); fclose (out);
exit (0); return 0;
} }
/* Error report, memory, obstack initialization and other utility /* Error report, memory, obstack initialization and other utility
......
...@@ -338,6 +338,8 @@ static int java_decl_equiv PROTO ((tree, tree)); ...@@ -338,6 +338,8 @@ static int java_decl_equiv PROTO ((tree, tree));
static int binop_compound_p PROTO ((enum tree_code)); static int binop_compound_p PROTO ((enum tree_code));
static tree search_loop PROTO ((tree)); static tree search_loop PROTO ((tree));
static int labeled_block_contains_loop_p PROTO ((tree, tree)); static int labeled_block_contains_loop_p PROTO ((tree, tree));
static void check_abstract_method_definitions PROTO ((int, tree, tree));
static void java_check_abstract_method_definitions PROTO ((tree));
/* Number of error found so far. */ /* Number of error found so far. */
int java_error_count; int java_error_count;
...@@ -8651,7 +8653,7 @@ java_complete_expand_methods () ...@@ -8651,7 +8653,7 @@ java_complete_expand_methods ()
if (flag_emit_xref) if (flag_emit_xref)
expand_xref (current_class); expand_xref (current_class);
else if (! flag_syntax_only) else if (! flag_syntax_only)
finish_class (current_class); finish_class ();
} }
} }
} }
......
...@@ -262,6 +262,8 @@ static int java_decl_equiv PROTO ((tree, tree)); ...@@ -262,6 +262,8 @@ static int java_decl_equiv PROTO ((tree, tree));
static int binop_compound_p PROTO ((enum tree_code)); static int binop_compound_p PROTO ((enum tree_code));
static tree search_loop PROTO ((tree)); static tree search_loop PROTO ((tree));
static int labeled_block_contains_loop_p PROTO ((tree, tree)); static int labeled_block_contains_loop_p PROTO ((tree, tree));
static void check_abstract_method_definitions PROTO ((int, tree, tree));
static void java_check_abstract_method_definitions PROTO ((tree));
/* Number of error found so far. */ /* Number of error found so far. */
int java_error_count; int java_error_count;
...@@ -6064,7 +6066,7 @@ java_complete_expand_methods () ...@@ -6064,7 +6066,7 @@ java_complete_expand_methods ()
if (flag_emit_xref) if (flag_emit_xref)
expand_xref (current_class); expand_xref (current_class);
else if (! flag_syntax_only) else if (! flag_syntax_only)
finish_class (current_class); finish_class ();
} }
} }
} }
......
...@@ -354,8 +354,8 @@ verify_jvm_instructions (jcf, byte_ops, length) ...@@ -354,8 +354,8 @@ verify_jvm_instructions (jcf, byte_ops, length)
int wide = 0; int wide = 0;
int op_code; int op_code;
int PC; int PC;
int oldpc; /* PC of start of instruction. */ int oldpc = 0; /* PC of start of instruction. */
int prevpc; /* If >= 0, PC of previous instruction. */ int prevpc = 0; /* If >= 0, PC of previous instruction. */
const char *message; const char *message;
int i; int i;
register unsigned char *p; register unsigned char *p;
......
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