This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: real.c bcopy->memcpy
- To: egcs-patches at egcs dot cygnus dot com
- Subject: Patch: real.c bcopy->memcpy
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 9 Aug 1999 11:06:55 -0400 (EDT)
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)