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, part 1/5


	Here are some more java directory warning patches.  They rely
on the following previous java dir patch being installed.

http://egcs.cygnus.com/ml/egcs-patches/1999-03/msg00149.html

	This is part 1/5, okay to install?

		--Kaveh


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

	* check-init.c (check_cond_init): Add static prototype.

	* class.c (build_java_method_type, hashUtf8String,
	make_field_value, get_dispatch_vector, get_dispatch_table,
	append_gpp_mangled_type, mangle_static_field): Likewise.
	(strLengthUtf8): Hide unused definition.
	(hashUtf8String): Const-ify.
	(make_field_value): Un-ANSI-fy.

	* constants.c: Move inclusion of jcf.h above java-tree.h.
	(set_constant_entry, find_class_or_string_constant,
	find_name_and_type_constant, get_tag_node,
	build_constant_data_ref): Add static prototype.

	* decl.c (push_jvm_slot, builtin_function,
	lookup_name_current_level): Likewise.
	(builtin_function): Const-ify.

	* except.c (expand_start_java_handler, expand_end_java_handler):
	Add static prototype.

diff -rup orig/egcs-CVS19990307/gcc/java/check-init.c egcs-CVS19990307/gcc/java/check-init.c
--- orig/egcs-CVS19990307/gcc/java/check-init.c	Sat Feb 27 07:49:34 1999
+++ egcs-CVS19990307/gcc/java/check-init.c	Tue Mar  9 11:30:53 1999
@@ -99,6 +99,7 @@ static tree wfl;
 
 static void check_bool_init PROTO ((tree, words, words, words));
 static void check_init PROTO ((tree, words));
+static void check_cond_init PROTO ((tree, tree, tree, words, words, words));
 
 #if 0
 #define ALLOC_WORDS(NUM) ((word*) xmalloc ((NUM) * sizeof (word)))
@@ -123,7 +124,7 @@ static void check_init PROTO ((tree, wor
    definite assignment.
    BEFORE, WHEN_FALSE, and WHEN_TRUE are as in check_bool_init. */
 
-void
+static void
 check_cond_init (test_exp, then_exp, else_exp,
 		 before, when_false, when_true)
      tree test_exp, then_exp, else_exp;
diff -rup orig/egcs-CVS19990307/gcc/java/class.c egcs-CVS19990307/gcc/java/class.c
--- orig/egcs-CVS19990307/gcc/java/class.c	Sat Mar  6 10:58:29 1999
+++ egcs-CVS19990307/gcc/java/class.c	Tue Mar  9 11:26:09 1999
@@ -38,6 +38,13 @@ The Free Software Foundation is independ
 
 static tree mangle_class_field PROTO ((tree class));
 static tree make_method_value PROTO ((tree));
+static tree build_java_method_type PROTO ((tree, tree, int));
+static int32 hashUtf8String PROTO ((const char *, int));
+static tree make_field_value PROTO ((tree));
+static tree get_dispatch_vector PROTO ((tree));
+static tree get_dispatch_table PROTO ((tree, tree));
+static void append_gpp_mangled_type PROTO ((struct obstack *, tree));
+static tree mangle_static_field PROTO ((tree));
 
 static rtx registerClass_libfunc;
 
@@ -372,7 +379,7 @@ find_named_method (list, name)
 }
 #endif
 
-tree
+static tree
 build_java_method_type (fntype, this_class, access_flags)
      tree fntype;
      tree this_class;
@@ -493,6 +500,7 @@ set_constant_value (field, constant)
 
 /* Count the number of Unicode chars encoded in a given Ut8 string. */
 
+#if 0
 int
 strLengthUtf8 (str, len)
      char *str;
@@ -507,19 +515,20 @@ strLengthUtf8 (str, len)
   }
   return str_length;
 }
+#endif
 
 
 /* Calculate a hash value for a string encoded in Utf8 format.
  * This returns the same hash value as specified for java.lang.String.hashCode.
  */
 
-int32
+static int32
 hashUtf8String (str, len)
-     char *str;
+     const char *str;
      int len;
 {
-  register unsigned char* ptr = (unsigned char*) str;
-  register unsigned char *limit = ptr + len;
+  register const unsigned char* ptr = (const unsigned char*) str;
+  register const unsigned char *limit = ptr + len;
   int32 hash = 0;
   for (; ptr < limit;)
     {
@@ -829,8 +838,9 @@ get_access_flags_from_decl (decl)
   abort ();
 }
 
-tree
-make_field_value (tree fdecl)
+static tree
+make_field_value (fdecl)
+  tree fdecl;
 {
   tree finit, info;
   int bsize, flags;
@@ -905,7 +915,7 @@ make_method_value (mdecl)
   return minit;
 }
 
-tree
+static tree
 get_dispatch_vector (type)
      tree type;
 {
@@ -938,7 +948,7 @@ get_dispatch_vector (type)
   return vtable;
 }
 
-tree
+static tree
 get_dispatch_table (type, this_class_addr)
      tree type, this_class_addr;
 {
@@ -1246,7 +1256,7 @@ is_compiled_class (class)
 
 /* Append the mangled name of TYPE onto OBSTACK. */
 
-void
+static void
 append_gpp_mangled_type (obstack, type)
      struct obstack *obstack;
      tree type;
@@ -1321,7 +1331,7 @@ mangle_class_field (class)
 
 /* Build the mangled (assembly-level) name of the static field FIELD. */
 
-tree
+static tree
 mangle_static_field (field)
      tree field;
 {
diff -rup orig/egcs-CVS19990307/gcc/java/constants.c egcs-CVS19990307/gcc/java/constants.c
--- orig/egcs-CVS19990307/gcc/java/constants.c	Tue Mar  9 11:40:43 1999
+++ egcs-CVS19990307/gcc/java/constants.c	Tue Mar  9 12:28:47 1999
@@ -23,16 +23,22 @@ The Free Software Foundation is independ
 
 #include "config.h"
 #include "system.h"
+#include "jcf.h"
 #include "tree.h"
 #include "java-tree.h"
-#include "jcf.h"
 #include "toplev.h"
 
 extern struct obstack permanent_obstack;
 
+static void set_constant_entry PROTO ((CPool *, int, int, jword));
+static int find_class_or_string_constant PROTO ((CPool *, int, tree));
+static int find_name_and_type_constant PROTO ((CPool *, tree, tree));
+static tree get_tag_node PROTO ((int));
+static tree build_constant_data_ref PROTO ((void));
+
 /* Set the INDEX'th constant in CPOOL to have the given TAG and VALUE. */
 
-void
+static void
 set_constant_entry (cpool, index, tag, value)
      CPool *cpool;
      int index;
@@ -113,7 +119,7 @@ find_utf8_constant (cpool, name)
   return find_constant1 (cpool, CONSTANT_Utf8, (jword) name);
 }
 
-int
+static int
 find_class_or_string_constant (cpool, tag, name)
      CPool *cpool;
      int tag;
@@ -155,7 +161,7 @@ find_string_constant (cpool, string)
 /* Find (or create) a CONSTANT_NameAndType matching NAME and TYPE.
    Return its index in the constant pool CPOOL. */
 
-int
+static int
 find_name_and_type_constant (cpool, name, type)
      CPool *cpool;
      tree name;
@@ -316,7 +322,7 @@ tree current_constant_pool_data_ref;
 /* A Cache for build_int_2 (CONSTANT_XXX, 0). */
 static tree tag_nodes[13];
 
-tree
+static tree
 get_tag_node (tag)
      int tag;
 {
@@ -378,7 +384,7 @@ alloc_class_constant (clas)
 
 /* Return a reference to the data array of the current constant pool. */
 
-tree
+static tree
 build_constant_data_ref ()
 {
   if (current_constant_pool_data_ref == NULL_TREE)
diff -rup orig/egcs-CVS19990307/gcc/java/decl.c egcs-CVS19990307/gcc/java/decl.c
--- orig/egcs-CVS19990307/gcc/java/decl.c	Sat Feb 27 07:49:38 1999
+++ egcs-CVS19990307/gcc/java/decl.c	Tue Mar  9 11:38:05 1999
@@ -33,6 +33,11 @@ The Free Software Foundation is independ
 #include "jcf.h"
 #include "toplev.h"
 
+static tree push_jvm_slot PROTO ((int, tree));
+static tree builtin_function PROTO ((const char *, tree,
+				     enum built_in_function, const char *));
+static tree lookup_name_current_level PROTO ((tree));
+
 #ifndef INT_TYPE_SIZE
 #define INT_TYPE_SIZE BITS_PER_WORD
 #endif
@@ -55,7 +60,7 @@ tree pending_local_decls = NULL_TREE;
 /* Push a local variable or stack slot into the decl_map,
    and assign it an rtl. */
 
-tree
+static tree
 push_jvm_slot (index, decl)
      int index;
      tree decl;
@@ -396,12 +401,12 @@ tree integer_negative_one_node;
    If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
    the name to be called if we can't opencode the function.  */
 
-tree
+static tree
 builtin_function (name, type, function_code, library_name)
-     char *name;
+     const char *name;
      tree type;
      enum built_in_function function_code;
-     char *library_name;
+     const char *library_name;
 {
   tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
   DECL_EXTERNAL (decl) = 1;
@@ -811,7 +816,7 @@ lookup_name (name)
 /* Similar to `lookup_name' but look only at current binding level and
    the previous one if its the parameter level.  */
 
-tree
+static tree
 lookup_name_current_level (name)
      tree name;
 {
diff -rup orig/egcs-CVS19990307/gcc/java/except.c egcs-CVS19990307/gcc/java/except.c
--- orig/egcs-CVS19990307/gcc/java/except.c	Mon Jan 25 05:32:16 1999
+++ egcs-CVS19990307/gcc/java/except.c	Tue Mar  9 11:40:00 1999
@@ -36,6 +36,9 @@ The Free Software Foundation is independ
 #include "eh-common.h"
 #include "toplev.h"
 
+static void expand_start_java_handler PROTO ((struct eh_range *));
+static void expand_end_java_handler PROTO ((struct eh_range *));
+
 extern struct obstack permanent_obstack;
 
 struct eh_range *current_method_handlers;
@@ -182,7 +185,7 @@ add_handler (start_pc, end_pc, handler, 
 
 
 /* if there are any handlers for this range, issue start of region */
-void
+static void
 expand_start_java_handler (range)
   struct eh_range *range ATTRIBUTE_UNUSED;
 {
@@ -217,7 +220,7 @@ prepare_eh_table_type (type)
 
 /* if there are any handlers for this range, isssue end of range,
    and then all handler blocks */
-void
+static void
 expand_end_java_handler (range)
      struct eh_range *range;
 {


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