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: real.c bcopy->memcpy


	This patch converts from bcopy to memcpy in a couple of places
in real.c.  The reason for this is that some platforms, (e.g. OSF4,)
prototype bcopy with char* in its first two arguments.  This causes
several hundred ptr conflict warnings.

The method used to fix this until recently has been to cast the
arguments to char* or PTR, but I'm beginning to find that ugly.  So I
instead switched it to use memcpy since that function prototypes with
void*.  (The regions don't overlap, so no need for memmove.)

	Tested by bootstrapping on Irix6 and OSF4.  Okay to install?

		--Kaveh



1999-08-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* real.c (GET_REAL, PUT_REAL): Use memcpy instead of bcopy.

--- egcs-CVS19990808/gcc/real.c~	Thu Aug  5 07:42:33 1999
+++ egcs-CVS19990808/gcc/real.c	Mon Aug  9 00:21:15 1999
@@ -281,10 +281,10 @@ do {									\
      else								\
        {								\
 	 unsigned EMUSHORT w[4];					\
-         bcopy (((EMUSHORT *) r), &w[3], sizeof (EMUSHORT));		\
-         bcopy (((EMUSHORT *) r) + 1, &w[2], sizeof (EMUSHORT));	\
-	 bcopy (((EMUSHORT *) r) + 2, &w[1], sizeof (EMUSHORT));	\
-	 bcopy (((EMUSHORT *) r) + 3, &w[0], sizeof (EMUSHORT));	\
+         memcpy (&w[3], ((EMUSHORT *) r), sizeof (EMUSHORT));		\
+         memcpy (&w[2], ((EMUSHORT *) r) + 1, sizeof (EMUSHORT));	\
+         memcpy (&w[1], ((EMUSHORT *) r) + 2, sizeof (EMUSHORT));	\
+         memcpy (&w[0], ((EMUSHORT *) r) + 3, sizeof (EMUSHORT));	\
 	 e53toe (w, (e));						\
        }								\
    } while (0)
@@ -297,10 +297,10 @@ do {									\
        {								\
 	 unsigned EMUSHORT w[4];					\
 	 etoe53 ((e), w);						\
-         bcopy (&w[3], ((EMUSHORT *) r), sizeof (EMUSHORT));		\
-         bcopy (&w[2], ((EMUSHORT *) r) + 1, sizeof (EMUSHORT));	\
-         bcopy (&w[1], ((EMUSHORT *) r) + 2, sizeof (EMUSHORT));	\
-         bcopy (&w[0], ((EMUSHORT *) r) + 3, sizeof (EMUSHORT));	\
+         memcpy (((EMUSHORT *) r), &w[3], sizeof (EMUSHORT));		\
+         memcpy (((EMUSHORT *) r) + 1, &w[2], sizeof (EMUSHORT));	\
+         memcpy (((EMUSHORT *) r) + 2, &w[1], sizeof (EMUSHORT));	\
+         memcpy (((EMUSHORT *) r) + 3, &w[0], sizeof (EMUSHORT));	\
        }								\
    } while (0)
 


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