OSDN Git Service

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git] / libc / string / bzero.c
1 /*
2  * Copyright (C) 2002     Manuel Novoa III
3  * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
4  *
5  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6  */
7
8 #include "_string.h"
9
10 libc_hidden_proto(memset)
11
12 void bzero(void *s, size_t n)
13 {
14 #if 1
15         (void)memset(s, 0, n);
16 #else
17         register unsigned char *p = s;
18 #ifdef __BCC__
19         /* bcc can optimize the counter if it thinks it is a pointer... */
20         register const char *np = (const char *) n;
21 #else
22 #define np n
23 #endif
24
25         while (np) {
26                 *p++ = 0;
27                 --np;
28         }
29 #endif
30 }
31 #undef np