diff options
author | petermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-04 17:37:21 +0000 |
---|---|---|
committer | petermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-04 17:37:21 +0000 |
commit | c71f66e93418080fe0cedf93175ae38dbbe05792 (patch) | |
tree | 5020587c41b21aa91586f604d2a345aae90226e7 | |
parent | 788b8a168ca0b227f9335745387b6838ac5cf53f (diff) | |
download | chromium_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
-rw-r--r-- | third_party/mesa/MesaLib/src/egl/main/eglconfig.h | 7 | ||||
-rw-r--r-- | third_party/mesa/README.chromium | 4 |
2 files changed, 7 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]; } diff --git a/third_party/mesa/README.chromium b/third_party/mesa/README.chromium index c19eb9b..de5da73 100644 --- a/third_party/mesa/README.chromium +++ b/third_party/mesa/README.chromium @@ -78,3 +78,7 @@ Later modifications (see chromium.patch): - Fixed compiler warning about cast to pointer from integer of different size in eglapi.c line 276. Replaced void* with EGLNativeDisplayType. + +- Suppressed spurious compiler warning from gcc in eglCompareConfig by + reorganizing the .h a little + |