PERFORCE change 163925 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Tue Jun 9 20:01:19 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=163925

Change 163925 by trasz at trasz_victim on 2009/06/09 20:00:24

	Turn assertion into CTASSERT.

Affected files ...

.. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#8 edit

Differences ...

==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#8 (text+ko) ====

@@ -42,6 +42,14 @@
 
 #include "acl_support.h"
 
+#ifndef CTASSERT
+#define CTASSERT(x)		_CTASSERT(x, __LINE__)
+#define _CTASSERT(x, y)		__CTASSERT(x, y)
+#define __CTASSERT(x, y)	typedef char __assert_ ## y [(x) ? 1 : -1]
+#endif
+
+CTASSERT(1 << _ACL_T_ALIGNMENT_BITS > sizeof(struct acl_t_struct));
+
 acl_t
 acl_init(int count)
 {
@@ -57,7 +65,6 @@
 		return (NULL);
 	}
 
-	assert(1 << _ACL_T_ALIGNMENT_BITS > sizeof(struct acl_t_struct));
 	error = posix_memalign((void *)&acl, 1 << _ACL_T_ALIGNMENT_BITS,
 	    sizeof(struct acl_t_struct));
 	if (error)


More information about the p4-projects mailing list