Module Name:    src
Committed By:   apb
Date:           Fri Mar  2 16:19:15 UTC 2012

Modified Files:
        src/common/lib/libc/string: memset2.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/string/memset2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/string/memset2.c
diff -u src/common/lib/libc/string/memset2.c:1.3 src/common/lib/libc/string/memset2.c:1.4
--- src/common/lib/libc/string/memset2.c:1.3	Tue Nov  8 16:52:11 2011
+++ src/common/lib/libc/string/memset2.c	Fri Mar  2 16:19:15 2012
@@ -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)
 {

Reply via email to