java dir patch [8/8]

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Tue Jan 19 23:44:00 GMT 1999


Tue Jan 19 12:05:08 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* Makefile.in (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
	(jcf-write.o): Likewise.
	(jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
	(mangle.o): Depend on $(srcdir)/../toplev.h.
	(parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
	(zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.

	* jcf-parse.c: Include toplev.h.

	* jcf-write.c: Likewise.  Don't include <string.h> or <sys/stat.h>.
	(localvar_free): Remove unused variable `i'.
	(generate_bytecode_conditional): Likewise for variable `kind'.

	* jv-scan.c: Include config.h and system.h.  Remove redundant
	OS header and gansidecl.h includes.
	(warning): Add the `const' keyword to a char*.  Also add
	ATTRIBUTE_PRINTF_1 to the prototype.  Check ANSI_PROTOTYPES, not
	__STDC__, when determining whether to use ANSI-isms.
	(fatal): Likewise.  Also add ATTRIBUTE_UNUSED.
	(xmalloc): Don't redundantly prototype here.
	(main): Remove unused parameter `envp'.  Also fix the arguments
	passed to function `fatal' to match the format specifier.

	* mangle.c: Include toplev.h.
	(emit_unicode_mangled_name): Declare parameter `len'.

	* zextract.c: Include config.h and system.h.  Remove redundant
	OS header includes.

diff -rup orig/egcs-CVS19990119/gcc/java/Makefile.in egcs-CVS19990119/gcc/java/Makefile.in
--- orig/egcs-CVS19990119/gcc/java/Makefile.in	Tue Jan 19 06:54:18 1999
+++ egcs-CVS19990119/gcc/java/Makefile.in	Tue Jan 19 13:33:34 1999
@@ -294,16 +295,20 @@ expr.o : expr.c $(CONFIG_H) $(JAVA_TREE_
 jcf-depend.o: jcf-depend.c $(CONFIG_H) $(srcdir)/../system.h jcf.h
 jcf-io.o: jcf-io.c $(CONFIG_H) $(srcdir)/../system.h
 jcf-parse.o : jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) $(srcdir)/../flags.h \
-  $(srcdir)/../input.h java-except.h $(srcdir)/../system.h
+  $(srcdir)/../input.h java-except.h $(srcdir)/../system.h \
+  $(srcdir)/../toplev.h
 jcf-write.o : jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(RTL_H) \
-  java-opcodes.h parse.h buffer.h $(srcdir)/../system.h
+  java-opcodes.h parse.h buffer.h $(srcdir)/../system.h $(srcdir)/../toplev.h
+jv-scan.o : $(CONFIG_H) $(srcdir)/../system.h
 jvgenmain.o : jvgenmain.c $(CONFIG_H) $(srcdir)/../system.h
 lang.o : lang.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(srcdir)/../input.h \
   $(srcdir)/../toplev.h $(srcdir)/../system.h
-mangle.o : mangle.c $(CONFIG_H) jcf.h $(srcdir)/../system.h
+mangle.o : mangle.c $(CONFIG_H) jcf.h $(srcdir)/../system.h \
+  $(srcdir)/../toplev.h
+parse-scan.o : $(CONFIG_H) $(srcdir)/../system.h
 typeck.o : typeck.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h convert.h \
   $(srcdir)/../toplev.h $(srcdir)/../system.h
 verify.o : verify.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h javaop.h java-opcodes.h \
   java-except.h $(srcdir)/../toplev.h $(srcdir)/../system.h
-zextract.o: zextract.c zipfile.h
+zextract.o: zextract.c $(CONFIG_H) $(srcdir)/../system.h zipfile.h
 
diff -rup orig/egcs-CVS19990119/gcc/java/jcf-parse.c egcs-CVS19990119/gcc/java/jcf-parse.c
--- orig/egcs-CVS19990119/gcc/java/jcf-parse.c	Tue Jan 19 06:54:20 1999
+++ egcs-CVS19990119/gcc/java/jcf-parse.c	Tue Jan 19 13:05:52 1999
@@ -32,6 +32,7 @@ The Free Software Foundation is independ
 #include "java-except.h"
 #include "input.h"
 #include "java-tree.h"
+#include "toplev.h"
 
 /* A CONSTANT_Utf8 element is converted to an IDENTIFIER_NODE at parse time. */
 #define JPOOL_UTF(JCF, INDEX) CPOOL_UTF(&(JCF)->cpool, INDEX)
diff -rup orig/egcs-CVS19990119/gcc/java/jcf-write.c egcs-CVS19990119/gcc/java/jcf-write.c
--- orig/egcs-CVS19990119/gcc/java/jcf-write.c	Tue Jan 19 06:54:21 1999
+++ egcs-CVS19990119/gcc/java/jcf-write.c	Tue Jan 19 13:12:45 1999
@@ -23,7 +23,6 @@ The Free Software Foundation is independ
 
 #include "config.h"
 #include "system.h"
-#include <string.h>
 #include "tree.h"
 #include "java-tree.h"
 #include "jcf.h"
@@ -33,8 +32,7 @@ The Free Software Foundation is independ
 #include "java-opcodes.h"
 #include "parse.h" /* for BLOCK_EXPR_BODY */
 #include "buffer.h"
-
-#include <sys/stat.h>
+#include "toplev.h"
 
 #ifndef DIR_SEPARATOR
 #define DIR_SEPARATOR '/'
@@ -550,7 +548,6 @@ localvar_free (decl, state)
   register struct localvar_info **ptr = &localvar_buffer [index];
   register struct localvar_info *info = *ptr;
   int wide = TYPE_IS_WIDE (TREE_TYPE (decl));
-  int i;
 
   info->end_label = end_label;
 
@@ -1054,7 +1051,6 @@ generate_bytecode_conditional (exp, true
      int true_branch_first;
      struct jcf_partial *state;
 {
-  int kind;
   tree exp0, exp1, type;
   int save_SP = state->code_SP;
   enum java_opcode op, negop;
diff -rup orig/egcs-CVS19990119/gcc/java/jv-scan.c egcs-CVS19990119/gcc/java/jv-scan.c
--- orig/egcs-CVS19990119/gcc/java/jv-scan.c	Tue Jan 19 06:54:21 1999
+++ egcs-CVS19990119/gcc/java/jv-scan.c	Tue Jan 19 13:19:52 1999
@@ -19,22 +19,15 @@ along with GNU CC; see the file COPYING.
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
+#include "config.h"
+#include "system.h"
 
-#include "gansidecl.h"		/* Definitions of PROTO and VPROTO */
 #include "obstack.h"		/* We use obstacks in lex.c */
 
-void fatal VPROTO((char *s, ...));
-void warning VPROTO((char *s, ...));
+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));
-extern PTR xmalloc PROTO((size_t));
 
 #define JC1_LITE
 #include "parse.h"
@@ -55,10 +48,9 @@ int flag_list_filename = 0;
 
 /* jc1-lite main entry point */
 int
-main (argc, argv, envp)
-     int argc;
-     char **argv;
-     char **envp;
+main (argc, argv)
+  int argc;
+  char **argv;
 {
   int i = 1;
   char *output_file = NULL;
@@ -109,10 +101,10 @@ main (argc, argv, envp)
   /* Check on bad usage */
   if (flag_find_main && flag_dump_class)
     fatal ("Options `--print-main' and `--list-class' can't be turned on "
-	   "at the same time", argv [0]);
+	   "at the same time");
 
   if (output_file && !(out = fopen (output_file, "w")))
-    fatal ("Can't open output file `%s'", argv [0], output_file);
+    fatal ("Can't open output file `%s'", output_file);
 
   ft = ftell (out);
 
@@ -134,7 +126,7 @@ main (argc, argv, envp)
 	    reset_report ();
 	  }
 	else
-	  fatal ("File not found `%s'", argv [0], argv [i]);
+	  fatal ("File not found `%s'", argv [i]);
       }
 
   /* Flush and close */
@@ -150,17 +142,17 @@ main (argc, argv, envp)
    functions */
 
 void
-fatal VPROTO((char *s, ...))
+fatal VPROTO((const char *s, ...))
 {
-#ifndef __STDC__
-  char *s;
+#ifndef ANSI_PROTOTYPES
+  const char *s;
 #endif
   va_list ap;
 
   VA_START (ap, s);
 
-#ifndef __STDC__
-  s = va_arg (ap, char *);
+#ifndef ANSI_PROTOTYPES
+  s = va_arg (ap, const char *);
 #endif
 
   fprintf (stderr, "%s: error: ", exec_name);
@@ -171,17 +163,17 @@ fatal VPROTO((char *s, ...))
 }
 
 void
-warning VPROTO((char *s, ...))
+warning VPROTO((const char *s, ...))
 {
-#ifndef __STDC__
-  char *s;
+#ifndef ANSI_PROTOTYPES
+  const char *s;
 #endif
   va_list ap;
 
   VA_START (ap, s);
 
-#ifndef __STDC__
-  s = va_arg (ap, char *);
+#ifndef ANSI_PROTOTYPES
+  s = va_arg (ap, const char *);
 #endif
 
   fprintf (stderr, "%s: warning: ", exec_name);
diff -rup orig/egcs-CVS19990119/gcc/java/mangle.c egcs-CVS19990119/gcc/java/mangle.c
--- orig/egcs-CVS19990119/gcc/java/mangle.c	Tue Jan 19 06:54:22 1999
+++ egcs-CVS19990119/gcc/java/mangle.c	Tue Jan 19 13:24:04 1999
@@ -29,6 +29,7 @@ The Free Software Foundation is independ
 #include "system.h"
 #include "jcf.h"
 #include "obstack.h"
+#include "toplev.h"
 
 /* Assuming (NAME, LEN) is a Utf8-encoding string, calculate
    the length of the string as mangled (a la g++) including Unicode escapes.
@@ -70,6 +71,7 @@ void
 emit_unicode_mangled_name (obstack, name, len)
      struct obstack *obstack;
      char *name;
+     int len;
 {
   unsigned char *ptr;
   unsigned char *limit = (unsigned char *)name + len;
diff -rup orig/egcs-CVS19990119/gcc/java/zextract.c egcs-CVS19990119/gcc/java/zextract.c
--- orig/egcs-CVS19990119/gcc/java/zextract.c	Tue Jan 19 06:54:25 1999
+++ egcs-CVS19990119/gcc/java/zextract.c	Tue Jan 19 13:32:25 1999
@@ -25,18 +25,13 @@ The Free Software Foundation is independ
 
 /* Written by Per Bothner <bothner@cygnus.com>, February 1996. */
 
+#include "config.h"
+#include "system.h"
 #include "zipfile.h"
 
-
 /* This stuff is partly based on the 28 August 1994 public release of the
 Info-ZIP group's portable UnZip zipfile-extraction program (and related
 utilities). */
-
-#include <stdio.h>
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include <errno.h>       /* used in mapname() */
 
 /*************/
 /*  Defines  */



More information about the Gcc-patches mailing list