mesa: Convert some runtime asserts to static asserts.
authorEric Anholt <eric@anholt.net>
Fri, 20 Sep 2013 03:06:35 +0000 (20:06 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 23 Sep 2013 19:45:22 +0000 (12:45 -0700)
Noticed while grepping through the code for something else.

v2: Don't convert really-runtime asserts to static asserts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
src/mesa/program/program.c

index 2529c13052428fa3a01a236ef4055c1c99098a3b..3a1eb73d780d9591e05aeac210f5bf47255c098c 100644 (file)
@@ -72,10 +72,10 @@ _mesa_init_program(struct gl_context *ctx)
    ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
 
    /* If this fails, increase prog_instruction::TexSrcUnit size */
-   ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
+   STATIC_ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
 
    /* If this fails, increase prog_instruction::TexSrcTarget size */
-   ASSERT(NUM_TEXTURE_TARGETS <= (1 << 4));
+   STATIC_ASSERT(NUM_TEXTURE_TARGETS <= (1 << 4));
 
    ctx->Program.ErrorPos = -1;
    ctx->Program.ErrorString = _mesa_strdup("");