From: Brian Paul Date: Tue, 10 Jan 2012 18:09:02 +0000 (-0700) Subject: mesa: use STATIC_ASSERT in a few more places X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6bf5daf331f13ec9503615a2578247e72b7d2cbb;p=mesa.git mesa: use STATIC_ASSERT in a few more places --- 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]