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]

C++ Patch: remove bcopy from the cp dir


This patch removes the remaining bcopy calls from the cp directory.

Bootstrap currently running on solaris2.7.

Assuming no regressions, Ok to install on the mainline?

		--Kaveh


2001-03-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* class.c (add_method): Use memcpy/memmove, not bcopy.

	* decl.c (duplicate_decls): Likewise.

diff -rup ../egcs-3.0-CVS20010311/gcc/cp/class.c egcs-3.0-CVS20010311/gcc/cp/class.c
--- ../egcs-3.0-CVS20010311/gcc/cp/class.c	Sat Mar  3 07:48:08 2001
+++ egcs-3.0-CVS20010311/gcc/cp/class.c	Mon Mar 12 10:41:30 2001
@@ -1217,9 +1217,9 @@ add_method (type, method, error_p)
 	    new_len = len + 1;
 
 	  new_vec = make_tree_vec (new_len);
-	  bcopy ((PTR) &TREE_VEC_ELT (method_vec, 0),
-		 (PTR) &TREE_VEC_ELT (new_vec, 0),
-		 len * sizeof (tree));
+	  memcpy (&TREE_VEC_ELT (new_vec, 0),
+		  &TREE_VEC_ELT (method_vec, 0),
+		  len * sizeof (tree));
 	  len = new_len;
 	  method_vec = CLASSTYPE_METHOD_VEC (type) = new_vec;
 	}
@@ -1256,9 +1256,9 @@ add_method (type, method, error_p)
 	      /* We know the last slot in the vector is empty
 		 because we know that at this point there's room
 		 for a new function.  */
-	      bcopy ((PTR) &TREE_VEC_ELT (method_vec, slot),
-		     (PTR) &TREE_VEC_ELT (method_vec, slot + 1),
-		     (len - slot - 1) * sizeof (tree));
+	      memmove (&TREE_VEC_ELT (method_vec, slot + 1),
+		       &TREE_VEC_ELT (method_vec, slot),
+		       (len - slot - 1) * sizeof (tree));
 	      TREE_VEC_ELT (method_vec, slot) = NULL_TREE;
 	    }
 	}
diff -rup ../egcs-3.0-CVS20010311/gcc/cp/decl.c egcs-3.0-CVS20010311/gcc/cp/decl.c
--- ../egcs-3.0-CVS20010311/gcc/cp/decl.c	Thu Feb 22 07:50:02 2001
+++ egcs-3.0-CVS20010311/gcc/cp/decl.c	Mon Mar 12 10:41:30 2001
@@ -3690,9 +3690,9 @@ duplicate_decls (newdecl, olddecl)
 
       function_size = sizeof (struct tree_decl);
 
-      bcopy ((char *) newdecl + sizeof (struct tree_common),
-	     (char *) olddecl + sizeof (struct tree_common),
-	     function_size - sizeof (struct tree_common));
+      memcpy (olddecl + sizeof (struct tree_common),
+	      newdecl + sizeof (struct tree_common),
+	      function_size - sizeof (struct tree_common));
 
       if (DECL_TEMPLATE_INSTANTIATION (newdecl))
 	{
@@ -3728,10 +3728,10 @@ duplicate_decls (newdecl, olddecl)
     }
   else
     {
-      bcopy ((char *) newdecl + sizeof (struct tree_common),
-	     (char *) olddecl + sizeof (struct tree_common),
-	     sizeof (struct tree_decl) - sizeof (struct tree_common)
-	     + tree_code_length [(int)TREE_CODE (newdecl)] * sizeof (char *));
+      memcpy (olddecl + sizeof (struct tree_common),
+	      newdecl + sizeof (struct tree_common),
+	      sizeof (struct tree_decl) - sizeof (struct tree_common)
+	      + tree_code_length [(int)TREE_CODE (newdecl)] * sizeof (char *));
     }
 
   DECL_UID (olddecl) = olddecl_uid;


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