egl: turn a couple asserts static (compile-time)
authorEric Engestrom <eric@engestrom.ch>
Mon, 22 Aug 2016 20:52:03 +0000 (21:52 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 24 Aug 2016 10:30:15 +0000 (11:30 +0100)
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/main/eglconfig.c

index 435d9245384408868a1b81b17a5becb049880529..6161d26e4de6380c4fa1908e0a6d7a00bfb88266 100644 (file)
@@ -38,6 +38,7 @@
 #include <assert.h>
 #include "c99_compat.h"
 
+#include "eglcompiler.h"
 #include "eglconfig.h"
 #include "egldisplay.h"
 #include "eglcurrent.h"
@@ -598,14 +599,14 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
       return 0;
 
    /* the enum values have the desired ordering */
-   assert(EGL_NONE < EGL_SLOW_CONFIG);
-   assert(EGL_SLOW_CONFIG < EGL_NON_CONFORMANT_CONFIG);
+   STATIC_ASSERT(EGL_NONE < EGL_SLOW_CONFIG);
+   STATIC_ASSERT(EGL_SLOW_CONFIG < EGL_NON_CONFORMANT_CONFIG);
    val1 = conf1->ConfigCaveat - conf2->ConfigCaveat;
    if (val1)
       return val1;
 
    /* the enum values have the desired ordering */
-   assert(EGL_RGB_BUFFER < EGL_LUMINANCE_BUFFER);
+   STATIC_ASSERT(EGL_RGB_BUFFER < EGL_LUMINANCE_BUFFER);
    val1 = conf1->ColorBufferType - conf2->ColorBufferType;
    if (val1)
       return val1;