egl: add messages to a few assert() and turn a couple into unreachable()
authorEric Engestrom <eric.engestrom@intel.com>
Sun, 28 Oct 2018 18:20:20 +0000 (18:20 +0000)
committerEric Engestrom <eric.engestrom@intel.com>
Tue, 30 Oct 2018 18:10:59 +0000 (18:10 +0000)
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/egl_dri2.c
src/egl/main/eglconfig.c

index c5fa935657e8165be49c6177ec25b06577e76f1b..8b482c90be0e04668fd554e571be48f0fa366d04 100644 (file)
@@ -341,7 +341,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
       _eglLinkConfig(&conf->base);
    }
    else {
-      assert(0);
+      unreachable("duplicates should not be possible");
       return NULL;
    }
 
@@ -1108,7 +1108,7 @@ dri2_create_context_attribs_error(int dri_error)
       break;
 
    default:
-      assert(0);
+      assert(!"unknown dri_error code");
       egl_error = EGL_BAD_MATCH;
       break;
    }
@@ -1815,7 +1815,7 @@ dri2_release_tex_image(_EGLDriver *drv,
       target = GL_TEXTURE_2D;
       break;
    default:
-      assert(0);
+      assert(!"missing texture target");
    }
 
    if (dri2_dpy->tex_buffer->base.version >= 3 &&
@@ -1878,7 +1878,7 @@ egl_error_from_dri_image_error(int dri_error)
    case __DRI_IMAGE_ERROR_BAD_ACCESS:
       return EGL_BAD_ACCESS;
    default:
-      assert(0);
+      assert(!"unknown dri_error code");
       return EGL_BAD_ALLOC;
    }
 }
index 0456adf3caaa8df9d5fc5d8b8d4290d5d00b0c4c..a346f937bf3e8ba099444b8d8c6c6289b8397545 100644 (file)
@@ -327,7 +327,7 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
                valid = EGL_FALSE;
             break;
          default:
-            assert(0);
+            unreachable("check _eglValidationTable[]");
             break;
          }
          break;
@@ -353,7 +353,7 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
                    EGL_OPENGL_BIT;
             break;
          default:
-            assert(0);
+            unreachable("check _eglValidationTable[]");
             mask = 0;
             break;
          }