This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

More java dir patches ...


	Here's another java dir warning patch.  Okay to install?

		Thanks,
		--Kaveh



Sun Mar 21 20:35:03 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* gjavah.c (print_c_decl): Remove unused argument `flags'.

	* jcf-dump.c (print_access_flags): Add braces around if-else.

	* jvspec.c (lang_specific_driver): Wrap variable `len' in macro
	COMBINE_INPUTS.

	* lex.c (build_wfl_node): Add static prototype.

	* lex.h (build_wfl_node): Remove static prototype.

	* parse.y: Include lex.c early enough to declare everything needed.
	Ensure calls to `build_wfl_node' pass the proper arguments.
	(create_class): Remove unused variable `super_decl'.
	(get_printable_method_name): Initialize variable `name'.
	

diff -rup orig/egcs-CVS19990321/gcc/java/gjavah.c egcs-CVS19990321/gcc/java/gjavah.c
--- orig/egcs-CVS19990321/gcc/java/gjavah.c	Fri Mar 12 19:34:12 1999
+++ egcs-CVS19990321/gcc/java/gjavah.c	Sun Mar 21 12:27:22 1999
@@ -100,7 +100,7 @@ static struct method_name *method_name_l
 
 static void print_field_info PROTO ((FILE *, JCF*, int, int, JCF_u2));
 static void print_method_info PROTO ((FILE *, JCF*, int, int, JCF_u2));
-static void print_c_decl PROTO ((FILE*, JCF*, int, int, JCF_u2, int, const char *));
+static void print_c_decl PROTO ((FILE*, JCF*, int, int, int, const char *));
 static void decompile_method PROTO ((FILE *, JCF *, int));
 static void add_class_decl PROTO ((FILE *, JCF *, JCF_u2));
 
@@ -426,7 +426,7 @@ DEFUN(print_field_info, (stream, jcf, na
 	}
     }
 
-  print_c_decl (out, jcf, name_index, sig_index, flags, 0, override);
+  print_c_decl (out, jcf, name_index, sig_index, 0, override);
   fputs (";\n", out);
 
   if (override)
@@ -509,7 +509,7 @@ DEFUN(print_method_info, (stream, jcf, n
       if (! is_init)
 	fputs ("virtual ", out);
     }
-  print_c_decl (out, jcf, name_index, sig_index, flags, is_init, override);
+  print_c_decl (out, jcf, name_index, sig_index, is_init, override);
 
   if ((flags & ACC_ABSTRACT))
     fputs (" = 0", out);
@@ -676,10 +676,10 @@ decode_signature_piece (stream, signatur
 }
 
 static void
-DEFUN(print_c_decl, (stream, jcf, name_index, signature_index, flags, is_init,
+DEFUN(print_c_decl, (stream, jcf, name_index, signature_index, is_init,
 		     name_override),
       FILE* stream AND JCF* jcf
-      AND int name_index AND int signature_index AND JCF_u2 flags
+      AND int name_index AND int signature_index
       AND int is_init AND const char *name_override)
 {
   if (JPOOL_TAG (jcf, signature_index) != CONSTANT_Utf8)
diff -rup orig/egcs-CVS19990321/gcc/java/jcf-dump.c egcs-CVS19990321/gcc/java/jcf-dump.c
--- orig/egcs-CVS19990321/gcc/java/jcf-dump.c	Sun Mar 21 08:28:39 1999
+++ egcs-CVS19990321/gcc/java/jcf-dump.c	Sun Mar 21 12:27:22 1999
@@ -321,10 +321,12 @@ DEFUN (print_access_flags, (stream, flag
   if (flags & ACC_STATIC) fprintf (stream, " static");
   if (flags & ACC_FINAL) fprintf (stream, " final");
   if (flags & ACC_SYNCHRONIZED)
-    if (context == 'c')
-      fprintf (stream, " super");
-    else
-      fprintf (stream, " synchronized");
+    {
+      if (context == 'c')
+	fprintf (stream, " super");
+      else
+	fprintf (stream, " synchronized");
+    }
   if (flags & ACC_VOLATILE) fprintf (stream, " volatile");
   if (flags & ACC_TRANSIENT) fprintf (stream, " transient");
   if (flags & ACC_NATIVE) fprintf (stream, " native");
diff -rup orig/egcs-CVS19990321/gcc/java/jvspec.c egcs-CVS19990321/gcc/java/jvspec.c
--- orig/egcs-CVS19990321/gcc/java/jvspec.c	Wed Feb 24 09:47:19 1999
+++ egcs-CVS19990321/gcc/java/jvspec.c	Sun Mar 21 20:27:03 1999
@@ -328,7 +328,9 @@ lang_specific_driver (fn, in_argc, in_ar
 	}
       else
 	{
+#if COMBINE_INPUTS
 	  int len; 
+#endif
 
 	  if (saw_speclang)
 	    {
diff -rup orig/egcs-CVS19990321/gcc/java/lex.c egcs-CVS19990321/gcc/java/lex.c
--- orig/egcs-CVS19990321/gcc/java/lex.c	Sun Mar 21 08:28:46 1999
+++ egcs-CVS19990321/gcc/java/lex.c	Sun Mar 21 12:27:22 1999
@@ -59,6 +59,7 @@ static void java_unicode_2_utf8 PROTO ((
 static void java_lex_error PROTO ((char *, int));
 #ifndef JC1_LITE
 static int java_is_eol PROTO ((FILE *, int));
+static tree build_wfl_node PROTO ((tree));
 #endif
 static void java_store_unicode PROTO ((struct java_line *, unicode_t, int));
 static unicode_t java_parse_escape_sequence PROTO ((void));
diff -rup orig/egcs-CVS19990321/gcc/java/lex.h egcs-CVS19990321/gcc/java/lex.h
--- orig/egcs-CVS19990321/gcc/java/lex.h	Sun Mar 14 07:43:34 1999
+++ egcs-CVS19990321/gcc/java/lex.h	Sun Mar 21 12:27:22 1999
@@ -136,7 +136,6 @@ typedef struct _java_lc {
 #else
 
 extern void set_float_handler PROTO((jmp_buf));
-static tree build_wfl_node ();
 #define SET_FLOAT_HANDLER(H) set_float_handler ((H))
 #define DCONST0 dconst0
 #define GET_IDENTIFIER(S) get_identifier ((S))
diff -rup orig/egcs-CVS19990321/gcc/java/parse.y egcs-CVS19990321/gcc/java/parse.y
--- orig/egcs-CVS19990321/gcc/java/parse.y	Sat Mar 20 11:50:04 1999
+++ egcs-CVS19990321/gcc/java/parse.y	Sun Mar 21 12:27:22 1999
@@ -303,6 +303,10 @@ static tree java_lang_cloneable = NULL_T
   int value;
 }
 
+%{
+#include "lex.c"
+%}
+
 %pure_parser
 
 /* Things defined here have to match the order of what's in the
@@ -1010,15 +1014,13 @@ explicit_constructor_invocation:
 this_or_super:			/* Added, simplifies error diagnostics */
 	THIS_TK
 		{
-		  tree wfl = build_wfl_node (this_identifier_node, 
-					     input_filename, 0, 0);
+		  tree wfl = build_wfl_node (this_identifier_node);
 		  EXPR_WFL_LINECOL (wfl) = $1.location;
 		  $$ = wfl;
 		}
 |	SUPER_TK
 		{
-		  tree wfl = build_wfl_node (super_identifier_node,
-					     input_filename, 0, 0);
+		  tree wfl = build_wfl_node (super_identifier_node);
 		  EXPR_WFL_LINECOL (wfl) = $1.location;
 		  $$ = wfl;
 		}
@@ -1861,8 +1863,7 @@ field_access:
 |	SUPER_TK DOT_TK identifier
 		{
 		  tree super_wfl = 
-		    build_wfl_node (super_identifier_node, 
-				    input_filename, 0, 0);
+		    build_wfl_node (super_identifier_node);
 		  EXPR_WFL_LINECOL (super_wfl) = $1.location;
 		  $$ = make_qualified_name (super_wfl, $3, $2.location);
 		}
@@ -2278,8 +2279,6 @@ constant_expression:
 %%
 
 
-#include "lex.c"
-
 /* Flag for the error report routine to issue the error the first time
    it's called (overriding the default behavior which is to drop the
    first invocation and honor the second one, taking advantage of a
@@ -2961,7 +2960,7 @@ create_class (flags, id, super, interfac
 {
   tree raw_name = EXPR_WFL_NODE (id);
   tree class_id, decl;
-  tree super_decl = NULL, super_decl_type;
+  tree super_decl_type;
 
   class_id = parser_qualified_classname (id);
   decl = IDENTIFIER_CLASS_VALUE (class_id);
@@ -4375,7 +4374,7 @@ get_printable_method_name (decl)
      tree decl;
 {
   char *to_return;
-  tree name;
+  tree name = NULL_TREE;
 
   if (DECL_CONSTRUCTOR_P (decl))
     {
@@ -5919,7 +5918,7 @@ make_qualified_primary (primary, right, 
      different form than a SUPER. Turn THIS into something symbolic */
   if (TREE_CODE (primary) == THIS_EXPR)
     {
-      wfl = build_wfl_node (this_identifier_node, input_filename, 0, 0);
+      wfl = build_wfl_node (this_identifier_node);
       EXPR_WFL_LINECOL (wfl) = EXPR_WFL_LINECOL (primary);
       wfl = make_qualified_name (wfl, right, location);
       PRIMARY_P (wfl) = 1;
@@ -8329,8 +8328,7 @@ build_super_invocation ()
     return empty_stmt_node;
   else
     {
-      tree super_wfl = build_wfl_node (super_identifier_node, 
-				       input_filename, 0, 0);
+      tree super_wfl = build_wfl_node (super_identifier_node);
       return build_method_invocation (super_wfl, NULL_TREE);
     }
 }
@@ -8346,8 +8344,7 @@ build_this_super_qualified_invocation (u
 {
   tree invok;
   tree wfl = 
-    build_wfl_node ((use_this ? this_identifier_node : super_identifier_node),
-		    input_filename, 0, 0);
+    build_wfl_node (use_this ? this_identifier_node : super_identifier_node);
   EXPR_WFL_LINECOL (wfl) = lloc;
   invok = build_method_invocation (name, args);
   return make_qualified_primary (wfl, invok, rloc);
@@ -10215,7 +10212,7 @@ static tree
 build_this (location)
      int location;
 {
-  tree node = build_wfl_node (this_identifier_node, input_filename, 0, 0);
+  tree node = build_wfl_node (this_identifier_node);
   TREE_SET_CODE (node, THIS_EXPR);
   EXPR_WFL_LINECOL (node) = location;
   return node;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]