Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/common/lib/libc/string Change CTASSERT to __CTASSERT (the sp...
details: https://anonhg.NetBSD.org/src/rev/8f86d61c7268
branches: trunk
changeset: 777720:8f86d61c7268
user: apb <apb%NetBSD.org@localhost>
date: Fri Mar 02 16:19:15 2012 +0000
description:
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:
common/lib/libc/string/memset2.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diffs (44 lines):
diff -r 3b8e62656515 -r 8f86d61c7268 common/lib/libc/string/memset2.c
--- a/common/lib/libc/string/memset2.c Fri Mar 02 16:17:22 2012 +0000
+++ b/common/lib/libc/string/memset2.c Fri Mar 02 16:19:15 2012 +0000
@@ -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 @@
#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)
{
Home |
Main Index |
Thread Index |
Old Index