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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch installed to eliminate uses of PTR macro in java dir


Pre-approved in private email by Andrew Haley

Tested on sparc-sun-solaris2.7.


2003-01-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* class.c, gjavah.c, parse.y, verify.c: Don't use PTR.
	
diff -rup orig/egcc-CVS20030109/gcc/java/class.c egcc-CVS20030109/gcc/java/class.c
--- orig/egcc-CVS20030109/gcc/java/class.c	2003-01-09 18:13:19.000000000 -0500
+++ egcc-CVS20030109/gcc/java/class.c	2003-01-09 19:09:48.597204000 -0500
@@ -2314,7 +2314,7 @@ java_treetreehash_new (ht, t)
      htab_t ht;
      tree t;
 {
-  PTR *e;
+  void **e;
   struct treetreehash_entry *tthe;
   hashval_t hv = JAVA_TREEHASHHASH_H (t);
 
@@ -2323,7 +2323,7 @@ java_treetreehash_new (ht, t)
     {
       tthe = (*ht->alloc_f) (1, sizeof (*tthe));
       tthe->key = t;
-      *e = (PTR) tthe;
+      *e = tthe;
     }
   else
     tthe = (struct treetreehash_entry *) *e;
diff -rup orig/egcc-CVS20030109/gcc/java/gjavah.c egcc-CVS20030109/gcc/java/gjavah.c
--- orig/egcc-CVS20030109/gcc/java/gjavah.c	2003-01-09 18:13:19.000000000 -0500
+++ egcc-CVS20030109/gcc/java/gjavah.c	2003-01-09 20:32:41.642119000 -0500
@@ -1127,8 +1127,8 @@ throwable_p (clname)
 
   if (! init_done)
     {
-      PTR *slot;
-      const unsigned char *str;
+      void **slot;
+      unsigned char *str;
 
       /* Self-initializing.  The cost of this really doesn't matter.
 	 We also don't care about freeing these, either.  */
@@ -1140,11 +1140,11 @@ throwable_p (clname)
       /* Make sure the root classes show up in the tables.  */
       str = xstrdup ("java.lang.Throwable");
       slot = htab_find_slot (throw_hash, str, INSERT);
-      *slot = (PTR) str;
+      *slot = str;
 
       str = xstrdup ("java.lang.Object");
       slot = htab_find_slot (non_throw_hash, str, INSERT);
-      *slot = (PTR) str;
+      *slot = str;
 
       init_done = 1;
     }
@@ -1166,7 +1166,7 @@ throwable_p (clname)
   else
     {
       JCF jcf;
-      PTR *slot;
+      void **slot;
       unsigned char *super, *tmp;
       int super_length = -1;
       const char *classfile_name = find_class (current, strlen (current),
diff -rup orig/egcc-CVS20030109/gcc/java/parse.y egcc-CVS20030109/gcc/java/parse.y
--- orig/egcc-CVS20030109/gcc/java/parse.y	2003-01-09 18:13:20.000000000 -0500
+++ egcc-CVS20030109/gcc/java/parse.y	2003-01-09 20:34:44.251164000 -0500
@@ -324,8 +324,8 @@ static void create_new_parser_context (i
 static void mark_parser_ctxt (void *);
 static tree maybe_build_class_init_for_field (tree, tree);
 
-static int attach_init_test_initialization_flags (PTR *, PTR);
-static int emit_test_initialization (PTR *, PTR);
+static int attach_init_test_initialization_flags (void **, void *);
+static int emit_test_initialization (void **, void *);
 
 static char *string_convert_int_cst (tree);
 
@@ -2672,11 +2672,11 @@ create_new_parser_context (copy_from_pre
   new =  (struct parser_ctxt *)xmalloc(sizeof (struct parser_ctxt));
   if (copy_from_previous)
     {
-      memcpy ((PTR)new, (PTR)ctxp, sizeof (struct parser_ctxt));
+      memcpy (new, ctxp, sizeof (struct parser_ctxt));
       new->saved_data_ctx = 1;
     }
   else
-    memset ((PTR) new, 0, sizeof (struct parser_ctxt));
+    memset (new, 0, sizeof (struct parser_ctxt));
 
   new->next = ctxp;
   ctxp = new;
@@ -7051,7 +7051,7 @@ register_package (name)
      tree name;
 {
   static htab_t pht;
-  PTR *e;
+  void **e;
 
   if (pht == NULL)
     pht = htab_create (50, htab_hash_pointer, htab_eq_pointer, NULL);
@@ -16243,8 +16243,8 @@ init_src_parse ()
 
 static int
 attach_init_test_initialization_flags (entry, ptr)
-     PTR *entry;
-     PTR ptr;
+     void **entry;
+     void *ptr;
 {
   tree block = (tree)ptr;
   struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry;
@@ -16265,8 +16265,8 @@ attach_init_test_initialization_flags (e
 
 static int
 emit_test_initialization (entry_p, info)
-     PTR *entry_p;
-     PTR info;
+     void **entry_p;
+     void *info;
 {
   tree l = (tree) info;
   tree decl, init;
diff -rup orig/egcc-CVS20030109/gcc/java/verify.c egcc-CVS20030109/gcc/java/verify.c
--- orig/egcc-CVS20030109/gcc/java/verify.c	2003-01-09 18:13:20.000000000 -0500
+++ egcc-CVS20030109/gcc/java/verify.c	2003-01-09 19:09:48.717133000 -0500
@@ -40,7 +40,7 @@ static void push_pending_label (tree);
 static tree merge_types (tree, tree);
 static const char *check_pending_block (tree);
 static void type_stack_dup (int, int);
-static int start_pc_cmp (const PTR, const PTR);
+static int start_pc_cmp (const void *, const void *);
 static char *pop_argument_types (tree);
 
 extern int stack_pointer;
@@ -351,8 +351,8 @@ struct pc_index
 /* A helper that is used when sorting exception ranges.  */
 static int
 start_pc_cmp (xp, yp)
-     const PTR xp;
-     const PTR yp;
+     const void *xp;
+     const void *yp;
 {
   const struct pc_index *x = (const struct pc_index *) xp;
   const struct pc_index *y = (const struct pc_index *) yp;


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