Use -Werror in frameworks/native/opengl/tests
* Remove or comment out unused local variables.
* Remove unused function.
* Cast print argument type to fix format mismatch warning.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I81e80849ac36288932df235cb0d63bd870357d86
diff --git a/opengl/tests/gl_basic/Android.bp b/opengl/tests/gl_basic/Android.bp
index 881d8ce..5eed17e 100644
--- a/opengl/tests/gl_basic/Android.bp
+++ b/opengl/tests/gl_basic/Android.bp
@@ -3,6 +3,11 @@
srcs: ["gl_basic.cpp"],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+
gtest: false,
shared_libs: [
diff --git a/opengl/tests/gl_basic/gl_basic.cpp b/opengl/tests/gl_basic/gl_basic.cpp
index 0b663f7..a675c7c 100644
--- a/opengl/tests/gl_basic/gl_basic.cpp
+++ b/opengl/tests/gl_basic/gl_basic.cpp
@@ -191,8 +191,6 @@
int main(int /*argc*/, char **/*argv*/)
{
- int q;
- int start, end;
printf("Initializing EGL...\n");
WindowSurface windowSurface;
if(!init_gl_surface(windowSurface))
@@ -212,7 +210,6 @@
int init_gl_surface(const WindowSurface& windowSurface)
{
- EGLint numConfigs = 1;
EGLConfig myConfig = {0};
EGLint attrib[] =
{
@@ -265,7 +262,6 @@
checkEglError("eglQuerySurface");
eglQuerySurface(eglDisplay, eglSurface, EGL_HEIGHT, &h);
checkEglError("eglQuerySurface");
- GLint dim = w < h ? w : h;
fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
@@ -336,9 +332,6 @@
void render()
{
- int i, j;
- int quads = 1;
-
const GLfloat vertices[] = {
-1, -1, 0,
1, -1, 0,