diff options
author | Eric Engestrom <[email protected]> | 2017-07-30 02:11:58 +0100 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2017-08-01 17:43:11 +0100 |
commit | c3b223f48f201c5472771fe96c002d29d9decfac (patch) | |
tree | 30ad8739e992887708293f95639763944e9bc318 /src | |
parent | 270a1c7110e97faf9bf14749adf55078565163fb (diff) |
egl: split enums to make use of -Wswitch
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/egl/main/eglconfig.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index f747c331843..f057b0bfe8c 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -118,15 +118,16 @@ _eglLookupConfig(EGLConfig config, _EGLDisplay *dpy) } -enum { - /* types */ +enum type { ATTRIB_TYPE_INTEGER, ATTRIB_TYPE_BOOLEAN, ATTRIB_TYPE_BITMASK, ATTRIB_TYPE_ENUM, ATTRIB_TYPE_PSEUDO, /* non-queryable */ ATTRIB_TYPE_PLATFORM, /* platform-dependent */ - /* criteria */ +}; + +enum criterion { ATTRIB_CRITERION_EXACT, ATTRIB_CRITERION_ATLEAST, ATTRIB_CRITERION_MASK, @@ -138,8 +139,8 @@ enum { /* EGL spec Table 3.1 and 3.4 */ static const struct { EGLint attr; - EGLint type; - EGLint criterion; + enum type type; + enum criterion criterion; EGLint default_value; } _eglValidationTable[] = { @@ -355,9 +356,6 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching) if (val != 0) valid = EGL_FALSE; break; - default: - assert(0); - break; } if (!valid && for_matching) { @@ -465,8 +463,8 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria) case ATTRIB_CRITERION_SPECIAL: /* ignored here */ break; - default: - assert(0); + case ATTRIB_CRITERION_IGNORE: + unreachable("already handled above"); break; } |