More java dir patches, part 5/5

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Tue Mar 9 12:51:00 GMT 1999


	This is part 5/5, okay to install?

		--Kaveh


Tue Mar  9 15:10:05 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* jcf-parse.c (parse_zip_file_entries, process_zip_dir,
	parse_class_file): Add static prototype.
	(find_in_current_zip): Match definition to existing static
	prototype.
	
	* jv-scan.c (reset_report): Remove prototype.

	* jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
	(error): Rewrite to allow varargs.

	* lang.c (lang_f_options): Const-ify.

	* lex.c (java_parse_escape_sequence): Add static prototype.
  	(java_allocate_new_line): Match definition to existing static
 	prototype.
	
	* parse.h (jdep_code): Remove trailing comma in enumeration.
	(java_get_line_col): Move prototype outside of !JC1_LITE test.
	(reset_report): Add prototype.

	* verify.c (push_pending_label, merge_types): Add static
	prototypes.

diff -rup orig/egcs-CVS19990307/gcc/java/jcf-parse.c egcs-CVS19990307/gcc/java/jcf-parse.c
--- orig/egcs-CVS19990307/gcc/java/jcf-parse.c	Sat Mar  6 10:59:03 1999
+++ egcs-CVS19990307/gcc/java/jcf-parse.c	Tue Mar  9 12:51:53 1999
@@ -79,12 +79,13 @@ static tree current_method = NULL_TREE;
 
 /* Declarations of some functions used here.  */
 static tree give_name_to_class PROTO ((JCF *jcf, int index));
-void parse_zip_file_entries PROTO (());
-void process_zip_dir PROTO (());
+static void parse_zip_file_entries PROTO ((void));
+static void process_zip_dir PROTO ((void));
 static void parse_source_file PROTO ((tree));
 static void jcf_parse_source PROTO ((void));
 static int jcf_figure_file_type PROTO ((JCF *));
 static int find_in_current_zip PROTO ((char *, struct JCF **));
+static void parse_class_file PROTO ((void));
 
 /* Handle "SourceFile" attribute. */
 
@@ -662,7 +663,7 @@ init_outgoing_cpool ()
     }
 }
 
-void
+static void
 parse_class_file ()
 {
   tree method;
@@ -854,7 +855,7 @@ yyparse ()
 static struct ZipFileCache *localToFile;
 
 /* Process all class entries found in the zip file.  */
-void
+static void
 parse_zip_file_entries (void)
 {
   struct ZipDirectory *zdir;
@@ -895,7 +896,7 @@ parse_zip_file_entries (void)
 /* Read all the entries of the zip file, creates a class and a JCF. Sets the
    jcf up for further processing and link it to the created class.  */
 
-void process_zip_dir()
+static void process_zip_dir()
 {
   int i;
   ZipDirectory *zdir;
@@ -955,7 +956,7 @@ void process_zip_dir()
 
 /* Lookup class NAME and figure whether is a class already found in the current
    zip file.  */
-int
+static int
 DEFUN(find_in_current_zip, (name, length, jcf),
       char *name AND JCF **jcf)
 {
diff -rup orig/egcs-CVS19990307/gcc/java/jv-scan.c egcs-CVS19990307/gcc/java/jv-scan.c
--- orig/egcs-CVS19990307/gcc/java/jv-scan.c	Sat Jan 23 16:49:49 1999
+++ egcs-CVS19990307/gcc/java/jv-scan.c	Tue Mar  9 13:33:34 1999
@@ -27,7 +27,6 @@ Boston, MA 02111-1307, USA.  */
 void fatal VPROTO((const char *s, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 void warning VPROTO((const char *s, ...)) ATTRIBUTE_PRINTF_1;
 void gcc_obstack_init PROTO ((struct obstack *obstack));
-extern void reset_report PROTO ((void));
 
 #define JC1_LITE
 #include "parse.h"
diff -rup orig/egcs-CVS19990307/gcc/java/jvgenmain.c egcs-CVS19990307/gcc/java/jvgenmain.c
--- orig/egcs-CVS19990307/gcc/java/jvgenmain.c	Wed Dec 16 16:20:50 1998
+++ egcs-CVS19990307/gcc/java/jvgenmain.c	Tue Mar  9 13:18:41 1999
@@ -28,6 +28,9 @@ The Free Software Foundation is independ
 #include "system.h"
 #include "obstack.h"
 #include "gansidecl.h"
+#include "jcf.h"
+#include "tree.h"
+#include "java-tree.h"
 
 const char main_method_prefix[] = "main__";
 const char main_method_suffix[] = "Pt6JArray1ZPQ34java4lang6String";
@@ -35,11 +38,25 @@ const char class_mangling_prefix[] = "_C
 
 struct obstack name_obstack;
 
+extern void error			PVPROTO ((const char *, ...))
+  ATTRIBUTE_PRINTF_1;
+
 void
-error (const char *str)
+error VPROTO((const char *msgid, ...))
 {
-  fprintf (stderr, "%s\n", str);
-  exit (-1);
+#ifndef ANSI_PROTOTYPES
+  const char *msgid;
+#endif
+  va_list ap;
+ 
+  VA_START (ap, msgid);
+ 
+#ifndef ANSI_PROTOTYPES
+  msgid = va_arg (ap, const char *);
+#endif
+ 
+  vfprintf (stderr, msgid, ap);
+  va_end (ap);
 }
 
 void
diff -rup orig/egcs-CVS19990307/gcc/java/lang.c egcs-CVS19990307/gcc/java/lang.c
--- orig/egcs-CVS19990307/gcc/java/lang.c	Sat Jan 23 16:49:50 1999
+++ egcs-CVS19990307/gcc/java/lang.c	Tue Mar  9 13:27:08 1999
@@ -110,7 +110,8 @@ extern int flag_exceptions;
     if `-fSTRING' is seen as an option.
    (If `-fno-STRING' is seen as an option, the opposite value is stored.)  */
 
-static struct { char *string; int *variable; int on_value;} lang_f_options[] =
+static struct { const char *string; int *variable; int on_value;}
+lang_f_options[] =
 {
   {"bounds-check", &flag_bounds_check, 1},
   {"assume-compiled", &flag_assume_compiled, 1},
diff -rup orig/egcs-CVS19990307/gcc/java/lex.c egcs-CVS19990307/gcc/java/lex.c
--- orig/egcs-CVS19990307/gcc/java/lex.c	Sat Mar  6 11:15:22 1999
+++ egcs-CVS19990307/gcc/java/lex.c	Tue Mar  9 13:29:33 1999
@@ -61,7 +61,7 @@ static void java_lex_error PROTO ((char 
 static int java_is_eol PROTO ((FILE *, int));
 #endif
 static void java_store_unicode PROTO ((struct java_line *, unicode_t, int));
-static unicode_t java_parse_escape_sequence PROTO (());
+static unicode_t java_parse_escape_sequence PROTO ((void));
 static int java_letter_or_digit_p PROTO ((unicode_t));
 static int java_parse_doc_section PROTO ((unicode_t));
 static void java_parse_end_comment PROTO (());
@@ -155,7 +155,7 @@ java_unget_unicode ()
   ctxp->c_line->char_col -= JAVA_COLUMN_DELTA (0);
 }
 
-void
+static void
 java_allocate_new_line ()
 {
   unicode_t ahead = (ctxp->c_line ? ctxp->c_line->ahead[0] : '\0');
diff -rup orig/egcs-CVS19990307/gcc/java/parse.h egcs-CVS19990307/gcc/java/parse.h
--- orig/egcs-CVS19990307/gcc/java/parse.h	Tue Mar  9 11:40:43 1999
+++ egcs-CVS19990307/gcc/java/parse.h	Tue Mar  9 13:33:46 1999
@@ -302,7 +302,7 @@ enum {
   INVOKE_NONVIRTUAL,
   INVOKE_SUPER,
   INVOKE_INTERFACE,
-  INVOKE_VIRTUAL,
+  INVOKE_VIRTUAL
 };
 
 /* We need the resolution stuff only if we compile jc1 */
@@ -351,7 +351,7 @@ enum jdep_code {
   JDEP_TYPE,			/* Patch a random tree node type,
                                    without the need for any specific
                                    actions */
-  JDEP_EXCEPTION,		/* Patch exceptions specified by `throws' */
+  JDEP_EXCEPTION		/* Patch exceptions specified by `throws' */
 };
 
 typedef struct _jdep {
@@ -641,11 +641,12 @@ void java_check_circular_reference PROTO
 void java_check_final PROTO ((void));
 void java_layout_classes PROTO ((void));
 tree java_method_add_stmt PROTO ((tree, tree));
-char *java_get_line_col PROTO ((char *, int, int));
 void java_expand_switch PROTO ((tree));
 int java_report_errors PROTO (());
 extern tree do_resolve_class PROTO ((tree, tree, tree));
 #endif
+char *java_get_line_col PROTO ((char *, int, int));
+extern void reset_report PROTO ((void));
 
 /* Always in use, no matter what you compile */
 void java_push_parser_context PROTO ((void));
diff -rup orig/egcs-CVS19990307/gcc/java/verify.c egcs-CVS19990307/gcc/java/verify.c
--- orig/egcs-CVS19990307/gcc/java/verify.c	Tue Mar  9 11:40:43 1999
+++ egcs-CVS19990307/gcc/java/verify.c	Tue Mar  9 13:38:39 1999
@@ -33,6 +33,9 @@ The Free Software Foundation is independ
 #include "java-except.h"
 #include "toplev.h"
 
+static void push_pending_label PROTO ((tree));
+static tree merge_types PROTO ((tree, tree));
+
 extern int stack_pointer;
 
 /* During verification, start of the current subroutine (jsr target). */
@@ -45,7 +48,7 @@ tree pending_blocks;
 
 /* Append TARGET_LABEL to the pending_block stack unless already in it. */
 
-void
+static void
 push_pending_label (target_label) 
      tree target_label;
 {
@@ -102,7 +105,7 @@ check_pending_block (target_label)
    For reference types, return the common super-class.
    Return TYPE_UNKNOWN if the types cannot be merged. */   
 
-tree
+static tree
 merge_types (type1, type2)
      tree type1, type2;
 {


More information about the Gcc-patches mailing list