[Mesa-dev] [PATCH] mesa: Convert some asserts into STATIC_ASSERT.

Matt Turner mattst88 at gmail.com
Mon Jun 29 09:50:44 PDT 2015


---
 src/mesa/main/context.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index fdef412..faa1de7 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -377,13 +377,12 @@ one_time_init( struct gl_context *ctx )
    if (!api_init_mask) {
       GLuint i;
 
-      /* do some implementation tests */
-      assert( sizeof(GLbyte) == 1 );
-      assert( sizeof(GLubyte) == 1 );
-      assert( sizeof(GLshort) == 2 );
-      assert( sizeof(GLushort) == 2 );
-      assert( sizeof(GLint) == 4 );
-      assert( sizeof(GLuint) == 4 );
+      STATIC_ASSERT(sizeof(GLbyte) == 1);
+      STATIC_ASSERT(sizeof(GLubyte) == 1);
+      STATIC_ASSERT(sizeof(GLshort) == 2);
+      STATIC_ASSERT(sizeof(GLushort) == 2);
+      STATIC_ASSERT(sizeof(GLint) == 4);
+      STATIC_ASSERT(sizeof(GLuint) == 4);
 
       _mesa_locale_init();
 
-- 
2.3.6



More information about the mesa-dev mailing list