summaryrefslogtreecommitdiffstats
path: root/third_party/mesa/MesaLib/src
diff options
context:
space:
mode:
authorpetermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-04 17:37:21 +0000
committerpetermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-04 17:37:21 +0000
commitc71f66e93418080fe0cedf93175ae38dbbe05792 (patch)
tree5020587c41b21aa91586f604d2a345aae90226e7 /third_party/mesa/MesaLib/src
parent788b8a168ca0b227f9335745387b6838ac5cf53f (diff)
downloadchromium_src-c71f66e93418080fe0cedf93175ae38dbbe05792.zip
chromium_src-c71f66e93418080fe0cedf93175ae38dbbe05792.tar.gz
chromium_src-c71f66e93418080fe0cedf93175ae38dbbe05792.tar.bz2
Dodge a GCC warning/error by reorganizing the code in the egl config header a little. Will change the behavior of wrong
calls slightly. See http://codereview.chromium.org/5866007 for some history, and http://codereview.chromium.org/5848004 for an alternate approach. BUG=none TEST=tryservers, local Review URL: http://codereview.chromium.org/6053007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/mesa/MesaLib/src')
-rw-r--r--third_party/mesa/MesaLib/src/egl/main/eglconfig.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/third_party/mesa/MesaLib/src/egl/main/eglconfig.h b/third_party/mesa/MesaLib/src/egl/main/eglconfig.h
index 5eda345..2e1fa86 100644
--- a/third_party/mesa/MesaLib/src/egl/main/eglconfig.h
+++ b/third_party/mesa/MesaLib/src/egl/main/eglconfig.h
@@ -38,7 +38,7 @@ struct _egl_config
/**
* Given a key, return an index into the storage of the config.
- * Return -1 if the key is invalid.
+ * The key must be valid, or an assertion may be thrown.
*/
static INLINE EGLint
_eglIndexConfig(const _EGLConfig *conf, EGLint key)
@@ -54,7 +54,8 @@ _eglIndexConfig(const _EGLConfig *conf, EGLint key)
return _EGL_CONFIG_FIRST_EXTRA_ATTRIB;
#endif
default:
- return -1;
+ assert(0);
+ return 0;
}
}
@@ -82,7 +83,6 @@ static INLINE void
_eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
{
EGLint idx = _eglIndexConfig(conf, key);
- assert(idx >= 0);
conf->Storage[idx] = val;
}
@@ -94,7 +94,6 @@ static INLINE EGLint
_eglGetConfigKey(const _EGLConfig *conf, EGLint key)
{
EGLint idx = _eglIndexConfig(conf, key);
- assert(idx >= 0);
return conf->Storage[idx];
}