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]

Patch installed to rid java dir of bcopy


I installed the following patch in the java directory to eliminate the
remaining calls to bcopy.  Only one turned out to be a "move" instead
of a copy.  Bootstrapped on solaris2.7, no regressions.

		--Kaveh

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/ChangeLog,v
retrieving revision 1.694
diff -u -p -r1.694 ChangeLog
--- ChangeLog	2001/03/24 01:13:30	1.694
+++ ChangeLog	2001/03/26 02:24:09
@@ -1,3 +1,11 @@
+2001-03-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* constants.c (PUTN): Use memcpy, not bcopy.
+
+	* lex.c (java_read_char): Use memmove, not bcopy.
+
+	* parse.y (java_parser_context_resume): Use memcpy, not bcopy.
+
 2001-03-23  Per Bothner  <per@bothner.com>
 
 	* verify.c (verify_jvm_instructions):  Replace 3 pop_type by POP_TYPE
Index: constants.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/constants.c,v
retrieving revision 1.17
diff -u -p -r1.17 constants.c
--- constants.c	2001/02/04 22:44:02	1.17
+++ constants.c	2001/03/26 02:24:09
@@ -214,7 +214,7 @@ find_methodref_index (cpool, decl)
 #define PUT1(X)  (*ptr++ = (X))
 #define PUT2(X)  (PUT1((X) >> 8), PUT1(X))
 #define PUT4(X)  (PUT2((X) >> 16), PUT2(X))
-#define PUTN(P, N)  (bcopy(P, ptr, N), ptr += (N))
+#define PUTN(P, N)  (memcpy(ptr, (P), (N)), ptr += (N))
 
 /* Give the number of bytes needed in a .class file for the CPOOL
    constant pool.  Includes the 2-byte constant_pool_count. */
Index: lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lex.c,v
retrieving revision 1.63
diff -u -p -r1.63 lex.c
--- lex.c	2001/03/23 05:16:13	1.63
+++ lex.c	2001/03/26 02:24:09
@@ -417,10 +417,8 @@ java_read_char (lex)
 			 is in the middle of a character sequence.  We just
 			 move the valid part of the buffer to the beginning
 			 to force a read.  */
-		      /* We use bcopy() because it should work for
-			 overlapping strings.  Use memmove() instead... */
-		      bcopy (&lex->buffer[lex->first], &lex->buffer[0],
-			     lex->last - lex->first);
+		      memmove (&lex->buffer[0], &lex->buffer[lex->first],
+			       lex->last - lex->first);
 		      lex->last -= lex->first;
 		      lex->first = 0;
 		    }
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.266
diff -u -p -r1.266 parse.y
--- parse.y	2001/03/24 01:13:29	1.266
+++ parse.y	2001/03/26 02:24:14
@@ -2783,8 +2783,8 @@ java_parser_context_resume ()
   ctxp = restored;
 
   /* Re-installed the data for the parsing to carry on */
-  bcopy (&old->marker_begining, &ctxp->marker_begining,
-	 (size_t)(&ctxp->marker_end - &ctxp->marker_begining));
+  memcpy (&ctxp->marker_begining, &old->marker_begining, 
+	  (size_t)(&ctxp->marker_end - &ctxp->marker_begining));
 
   /* Buffer context can now be discarded */
   free (saver);


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