summaryrefslogtreecommitdiff
path: root/common/lib/libc/string
diff options
context:
space:
mode:
authorapb <apb@NetBSD.org>2012-03-02 16:19:15 +0000
committerapb <apb@NetBSD.org>2012-03-02 16:19:15 +0000
commit4542d04b769d8860adbc52eeeb3cfd76b63478e7 (patch)
tree91e739ce16634e289a97be03e84d62fc4cf90313 /common/lib/libc/string
parentd3623adb3b59fb29b874401473c8b9e749245dbf (diff)
Change CTASSERT to __CTASSERT (the spelling used in <sys/cdefs.h>),
include <sys/cdefs.h> so that it will be defined, and move it to a better place. The previous CTASSERT would never have been used because of the ifdef. If it had been used, it would have had unwanted effects from being just after the "static inline" that appears when BZERO is defined. Also move the __RCSID to a more conventional location.
Diffstat (limited to 'common/lib/libc/string')
-rw-r--r--common/lib/libc/string/memset2.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/common/lib/libc/string/memset2.c b/common/lib/libc/string/memset2.c
index 641af1723e0..70c699df283 100644
--- a/common/lib/libc/string/memset2.c
+++ b/common/lib/libc/string/memset2.c
@@ -27,6 +27,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: memset2.c,v 1.4 2012/03/02 16:19:15 apb Exp $");
+#endif /* LIBC_SCCS and not lint */
+
#include <sys/types.h>
#if !defined(_KERNEL) && !defined(_STANDALONE)
@@ -52,15 +57,13 @@
#endif
#undef memset
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: memset2.c,v 1.3 2011/11/08 16:52:11 joerg Exp $");
-#endif /* LIBC_SCCS and not lint */
-
/*
* Assume uregister_t is the widest non-synthetic unsigned type.
*/
typedef uregister_t memword_t;
+__CTASSERT((~(memword_t)0U >> 1) != ~(memword_t)0U);
+
#ifdef BZERO
static inline
#define memset memset0
@@ -71,10 +74,6 @@ static
#define memset test_memset
#endif
-#ifdef CTASSERT
-CTASSERT((~(memword_t)0U >> 1) != ~(memword_t)0U);
-#endif
-
void *
memset(void *addr, int c, size_t len)
{