OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / libiberty / bzero.c
index d01644b..44ad73d 100644 (file)
@@ -2,30 +2,22 @@
    This function is in the public domain.  */
 
 /*
-NAME
-       bzero -- zero the contents of a specified memory region
 
-SYNOPSIS
-       void bzero (char *to, int count)
+@deftypefn Supplemental void bzero (char *@var{mem}, int @var{count})
 
-DESCRIPTION
-       Zero COUNT bytes of memory pointed to by TO.
+Zeros @var{count} bytes starting at @var{mem}.  Use of this function
+is deprecated in favor of @code{memset}.
 
-BUGS
-       Significant speed enhancements may be made in some environments
-       by zeroing more than a single byte at a time, or by unrolling the
-       loop.
+@end deftypefn
 
 */
 
+#include <stddef.h>
+
+extern void *memset(void *, int, size_t);
 
 void
-bzero (to, count)
-  char *to;
-  int count;
+bzero (void *to, size_t count)
 {
-  while (count-- > 0)
-    {
-      *to++ = 0;
-    }
+  memset (to, 0, count);
 }