From 6bf5daf331f13ec9503615a2578247e72b7d2cbb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Jan 2012 11:09:02 -0700 Subject: [PATCH] mesa: use STATIC_ASSERT in a few more places --- src/mesa/main/formats.c | 2 +- src/mesa/main/shaderapi.c | 2 +- src/mesa/main/shared.c | 2 +- src/mesa/main/texstate.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index cca0014b178..96317dbf4d5 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -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); diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 52a9bd45254..9372d6decf6 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -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; diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index 276fac149ed..c3e93b5a583 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -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]); } diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 7cd285803d5..8e9537faefc 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -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] -- 2.30.2