This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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/rfc] bzero -> memset


Hello,

This eliminates the last few remaining bzero functions. I've stared at it and can't see an error (but knowing my luck with memset, I've probably got the params wrong).

Baring comment, I'll commit this in a few days.

Andrew
2003-09-27  Andrew Cagney  <cagney@redhat.com>

	* remote-vxsparc.c (vx_read_register): Replace bzero with memset.
	* remote-vxmips.c (vx_read_register): Ditto.
	* remote-vx68.c (vx_read_register): Ditto.
	* gnu-nat.c (inf_validate_procs): Ditto.

Index: gnu-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-nat.c,v
retrieving revision 1.27
diff -u -r1.27 gnu-nat.c
--- gnu-nat.c	9 Sep 2003 03:14:02 -0000	1.27
+++ gnu-nat.c	27 Sep 2003 18:44:17 -0000
@@ -1024,7 +1024,7 @@
     /* The current thread we're considering. */
     struct proc *thread = inf->threads;
 
-    bzero (matched, sizeof (matched));
+    memset (matched, 0, sizeof (matched));
 
     while (thread)
       {
Index: remote-vx68.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-vx68.c,v
retrieving revision 1.10
diff -u -r1.10 remote-vx68.c
--- remote-vx68.c	17 Sep 2003 14:24:30 -0000	1.10
+++ remote-vx68.c	27 Sep 2003 18:44:18 -0000
@@ -111,10 +111,10 @@
     }
   else
     {
-      bzero (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	     MC68K_FPREG_SIZE * 8);
-      bzero (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
-	     MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
+      memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
+	      0, MC68K_FPREG_SIZE * 8);
+      memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
+	      0, MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
     }
 
   /* Mark the register cache valid.  */
Index: remote-vxmips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-vxmips.c,v
retrieving revision 1.10
diff -u -r1.10 remote-vxmips.c
--- remote-vxmips.c	17 Sep 2003 14:24:30 -0000	1.10
+++ remote-vxmips.c	27 Sep 2003 18:44:18 -0000
@@ -141,10 +141,10 @@
     }
   else
     {
-      bzero ((char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	     REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
-      bzero ((char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (FCRCS_REGNUM)],
-	     REGISTER_RAW_SIZE (FCRCS_REGNUM));
+      memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
+	      0, REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
+      memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FCRCS_REGNUM)],
+	      0, REGISTER_RAW_SIZE (FCRCS_REGNUM));
     }
 
   /* Mark the register cache valid.  */
Index: remote-vxsparc.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-vxsparc.c,v
retrieving revision 1.14
diff -u -r1.14 remote-vxsparc.c
--- remote-vxsparc.c	17 Sep 2003 15:42:21 -0000	1.14
+++ remote-vxsparc.c	27 Sep 2003 18:44:18 -0000
@@ -124,10 +124,10 @@
     }
   else
     {
-      bzero (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	     32 * SPARC_FPREG_SIZE);
-      bzero (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
-	     1 * SPARC_FPREG_SIZE);
+      memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
+	      0, 32 * SPARC_FPREG_SIZE);
+      memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
+	      0, 1 * SPARC_FPREG_SIZE);
     }
 
   /* Mark the register cache valid.  */

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