mesa: use STATIC_ASSERT in a few more places
authorBrian Paul <brianp@vmware.com>
Tue, 10 Jan 2012 18:09:02 +0000 (11:09 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 10 Jan 2012 19:37:37 +0000 (12:37 -0700)
src/mesa/main/formats.c
src/mesa/main/shaderapi.c
src/mesa/main/shared.c
src/mesa/main/texstate.c

index cca0014b1788a24f7b54c7dd7eb8c67c5cb2cc51..96317dbf4d5cbbde1b60b94f0031165488c93e83 100644 (file)
@@ -1951,7 +1951,7 @@ _mesa_test_formats(void)
 {
    GLuint i;
 
-   assert(Elements(format_info) == MESA_FORMAT_COUNT);
+   STATIC_ASSERT(Elements(format_info) == MESA_FORMAT_COUNT);
 
    for (i = 0; i < MESA_FORMAT_COUNT; i++) {
       const struct gl_format_info *info = _mesa_get_format_info(i);
index 52a9bd45254dee8d403dc3fe0bdc3c8f1a47f765..9372d6decf6a8a8fe730804ec499ac2b76190a81 100644 (file)
@@ -923,7 +923,7 @@ validate_samplers(const struct gl_program *prog, char *errMsg)
    GLbitfield samplersUsed = prog->SamplersUsed;
    GLuint i;
 
-   assert(Elements(targetName) == NUM_TEXTURE_TARGETS);
+   STATIC_ASSERT(Elements(targetName) == NUM_TEXTURE_TARGETS);
 
    if (samplersUsed == 0x0)
       return GL_TRUE;
index 276fac149ed6cfe0d0a84885a2022d1bef230ea1..c3e93b5a583e9c8a73fc2b6244ceced9aecec5be 100644 (file)
@@ -113,7 +113,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
          GL_TEXTURE_2D,
          GL_TEXTURE_1D
       };
-      assert(Elements(targets) == NUM_TEXTURE_TARGETS);
+      STATIC_ASSERT(Elements(targets) == NUM_TEXTURE_TARGETS);
       shared->DefaultTex[i] = ctx->Driver.NewTextureObject(ctx, 0, targets[i]);
    }
 
index 7cd285803d5d99a7b57fb0f0cb2bbb3f9ca82c90..8e9537faefc59c9636a1282b4a949dcd8aa60fb6 100644 (file)
@@ -695,7 +695,7 @@ alloc_proxy_textures( struct gl_context *ctx )
    };
    GLint tgt;
 
-   ASSERT(Elements(targets) == NUM_TEXTURE_TARGETS);
+   STATIC_ASSERT(Elements(targets) == NUM_TEXTURE_TARGETS);
 
    for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
       if (!(ctx->Texture.ProxyTex[tgt]