fix -Wunreachable-code-loop-increment am: e51ddb3fb6 am: 8dacc4102d am: 6c25c6415e am: c9cb7d33fe
Change-Id: Ib599e99788f767cc08dfa6f8d9036795c8f64c5c
diff --git a/gpu_tonemapper/glengine.cpp b/gpu_tonemapper/glengine.cpp
index 35e1932..bf3b58a 100644
--- a/gpu_tonemapper/glengine.cpp
+++ b/gpu_tonemapper/glengine.cpp
@@ -315,36 +315,30 @@
//-----------------------------------------------------------------------------
{
for (GLint error = glGetError(); error; error = glGetError()) {
- char *pError;
+ const char *pError = "<unknown error>";
switch (error) {
case GL_NO_ERROR:
- pError = (char *)"GL_NO_ERROR";
+ pError = "GL_NO_ERROR";
break;
case GL_INVALID_ENUM:
- pError = (char *)"GL_INVALID_ENUM";
+ pError = "GL_INVALID_ENUM";
break;
case GL_INVALID_VALUE:
- pError = (char *)"GL_INVALID_VALUE";
+ pError = "GL_INVALID_VALUE";
break;
case GL_INVALID_OPERATION:
- pError = (char *)"GL_INVALID_OPERATION";
+ pError = "GL_INVALID_OPERATION";
break;
case GL_OUT_OF_MEMORY:
- pError = (char *)"GL_OUT_OF_MEMORY";
+ pError = "GL_OUT_OF_MEMORY";
break;
case GL_INVALID_FRAMEBUFFER_OPERATION:
- pError = (char *)"GL_INVALID_FRAMEBUFFER_OPERATION";
+ pError = "GL_INVALID_FRAMEBUFFER_OPERATION";
break;
-
- default:
- ALOGE("glError (0x%x) %s:%d\n", error, file, line);
- return;
}
ALOGE("glError (%s) %s:%d\n", pError, file, line);
- return;
}
- return;
}
//-----------------------------------------------------------------------------
@@ -357,59 +351,54 @@
break;
}
- char *pError;
+ const char *pError = "<unknown error>";
switch (error) {
case EGL_SUCCESS:
- pError = (char *)"EGL_SUCCESS";
+ pError = "EGL_SUCCESS";
break;
case EGL_NOT_INITIALIZED:
- pError = (char *)"EGL_NOT_INITIALIZED";
+ pError = "EGL_NOT_INITIALIZED";
break;
case EGL_BAD_ACCESS:
- pError = (char *)"EGL_BAD_ACCESS";
+ pError = "EGL_BAD_ACCESS";
break;
case EGL_BAD_ALLOC:
- pError = (char *)"EGL_BAD_ALLOC";
+ pError = "EGL_BAD_ALLOC";
break;
case EGL_BAD_ATTRIBUTE:
- pError = (char *)"EGL_BAD_ATTRIBUTE";
+ pError = "EGL_BAD_ATTRIBUTE";
break;
case EGL_BAD_CONTEXT:
- pError = (char *)"EGL_BAD_CONTEXT";
+ pError = "EGL_BAD_CONTEXT";
break;
case EGL_BAD_CONFIG:
- pError = (char *)"EGL_BAD_CONFIG";
+ pError = "EGL_BAD_CONFIG";
break;
case EGL_BAD_CURRENT_SURFACE:
- pError = (char *)"EGL_BAD_CURRENT_SURFACE";
+ pError = "EGL_BAD_CURRENT_SURFACE";
break;
case EGL_BAD_DISPLAY:
- pError = (char *)"EGL_BAD_DISPLAY";
+ pError = "EGL_BAD_DISPLAY";
break;
case EGL_BAD_SURFACE:
- pError = (char *)"EGL_BAD_SURFACE";
+ pError = "EGL_BAD_SURFACE";
break;
case EGL_BAD_MATCH:
- pError = (char *)"EGL_BAD_MATCH";
+ pError = "EGL_BAD_MATCH";
break;
case EGL_BAD_PARAMETER:
- pError = (char *)"EGL_BAD_PARAMETER";
+ pError = "EGL_BAD_PARAMETER";
break;
case EGL_BAD_NATIVE_PIXMAP:
- pError = (char *)"EGL_BAD_NATIVE_PIXMAP";
+ pError = "EGL_BAD_NATIVE_PIXMAP";
break;
case EGL_BAD_NATIVE_WINDOW:
- pError = (char *)"EGL_BAD_NATIVE_WINDOW";
+ pError = "EGL_BAD_NATIVE_WINDOW";
break;
case EGL_CONTEXT_LOST:
- pError = (char *)"EGL_CONTEXT_LOST";
+ pError = "EGL_CONTEXT_LOST";
break;
- default:
- ALOGE("eglError (0x%x) %s:%d\n", error, file, line);
- return;
}
ALOGE("eglError (%s) %s:%d\n", pError, file, line);
- return;
}
- return;
}