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
This commit is contained in:
parent
d3a7a4c6eb
commit
7e9cd8e8f8
29 changed files with 73 additions and 41 deletions
|
@ -8,6 +8,11 @@ cc_test {
|
|||
"EGL_test.cpp",
|
||||
],
|
||||
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
shared_libs: [
|
||||
"android.hardware.configstore@1.0",
|
||||
"android.hardware.configstore-utils",
|
||||
|
|
|
@ -8,6 +8,11 @@ cc_test {
|
|||
"demo.c",
|
||||
],
|
||||
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
gtest: false,
|
||||
|
||||
shared_libs: [
|
||||
|
|
|
@ -62,9 +62,6 @@ using namespace android;
|
|||
|
||||
int gAppAlive = 1;
|
||||
|
||||
static const char sAppName[] =
|
||||
"San Angeles Observation OpenGL ES version example (Linux)";
|
||||
|
||||
static int sWindowWidth = WINDOW_DEFAULT_WIDTH;
|
||||
static int sWindowHeight = WINDOW_DEFAULT_HEIGHT;
|
||||
static EGLDisplay sEglDisplay = EGL_NO_DISPLAY;
|
||||
|
@ -132,7 +129,6 @@ static int initGraphics(EGLint samples, const WindowSurface& windowSurface)
|
|||
EGLContext context;
|
||||
EGLConfig config;
|
||||
EGLSurface surface;
|
||||
EGLint w, h;
|
||||
EGLDisplay dpy;
|
||||
|
||||
EGLNativeWindowType window = windowSurface.getSurface();
|
||||
|
|
|
@ -5,6 +5,11 @@ cc_test {
|
|||
|
||||
srcs: ["configdump.cpp"],
|
||||
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
shared_libs: [
|
||||
"libcutils",
|
||||
"libEGL",
|
||||
|
|
|
@ -3,6 +3,11 @@ cc_test {
|
|||
|
||||
srcs: ["fillrate.cpp"],
|
||||
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
gtest: false,
|
||||
|
||||
shared_libs: [
|
||||
|
|
|
@ -153,7 +153,7 @@ int main(int /*argc*/, char** /*argv*/)
|
|||
|
||||
for (int c=1, j=0 ; c<32 ; c++, j++) {
|
||||
nsecs_t t = times[j];
|
||||
printf("%ld\t%d\t%f\n", t, c, (double(t)/c)/1000000.0);
|
||||
printf("%lld\t%d\t%f\n", (long long)t, c, (double(t)/c)/1000000.0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,5 +16,10 @@ cc_test {
|
|||
|
||||
static_libs: ["libglTest"],
|
||||
|
||||
cflags: ["-DGL_GLEXT_PROTOTYPES"],
|
||||
cflags: [
|
||||
"-DGL_GLEXT_PROTOTYPES",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
}
|
||||
|
|
|
@ -140,6 +140,7 @@ int main(int argc, char** argv)
|
|||
|
||||
//glDrawTexiOES(0, 0, 0, dim, dim);
|
||||
|
||||
#if !USE_DRAW_TEXTURE || !GL_OES_draw_texture
|
||||
const GLfloat fdim = dim;
|
||||
const GLfloat vertices[4][2] = {
|
||||
{ 0, 0 },
|
||||
|
@ -154,6 +155,7 @@ int main(int argc, char** argv)
|
|||
{ 1, 1 },
|
||||
{ 1, 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
if (!usePbuffer) {
|
||||
eglSwapBuffers(dpy, surface);
|
||||
|
|
|
@ -16,5 +16,10 @@ cc_test {
|
|||
|
||||
static_libs: ["libglTest"],
|
||||
|
||||
cflags: ["-DGL_GLEXT_PROTOTYPES"],
|
||||
cflags: [
|
||||
"-DGL_GLEXT_PROTOTYPES",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
}
|
||||
|
|
|
@ -64,7 +64,6 @@ int main(int /*argc*/, char** /*argv*/)
|
|||
eglMakeCurrent(dpy, surface, surface, context);
|
||||
eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
|
||||
eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
|
||||
GLint dim = w<h ? w : h;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
|
|
@ -16,5 +16,10 @@ cc_test {
|
|||
|
||||
static_libs: ["libglTest"],
|
||||
|
||||
cflags: ["-DGL_GLEXT_PROTOTYPES"],
|
||||
cflags: [
|
||||
"-DGL_GLEXT_PROTOTYPES",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
}
|
||||
|
|
|
@ -340,7 +340,6 @@ int main(int /*argc*/, char** /*argv*/) {
|
|||
checkEglError("eglQuerySurface");
|
||||
eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
|
||||
checkEglError("eglQuerySurface");
|
||||
GLint dim = w < h ? w : h;
|
||||
|
||||
fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
|
||||
|
||||
|
|
|
@ -16,5 +16,9 @@ cc_test {
|
|||
|
||||
static_libs: ["libglTest"],
|
||||
|
||||
cflags: ["-DGL_GLEXT_PROTOTYPES"],
|
||||
cflags: [
|
||||
"-DGL_GLEXT_PROTOTYPES",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -444,7 +444,6 @@ int main(int /*argc*/, char** /*argv*/) {
|
|||
checkEglError("eglQuerySurface");
|
||||
eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
|
||||
checkEglError("eglQuerySurface");
|
||||
GLint dim = w < h ? w : h;
|
||||
|
||||
fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
|
||||
|
||||
|
|
|
@ -20,5 +20,7 @@ cc_test {
|
|||
cflags: [
|
||||
"-DGL_GLEXT_PROTOTYPES",
|
||||
"-DEGL_EGLEXT_PROTOTYPES",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@ const bool yuvTexSameUV = false;
|
|||
static sp<GraphicBuffer> yuvTexBuffer;
|
||||
static GLuint yuvTex;
|
||||
|
||||
bool setupYuvTexSurface(EGLDisplay dpy, EGLContext context) {
|
||||
bool setupYuvTexSurface(EGLDisplay dpy, EGLContext /*context*/) {
|
||||
int blockWidth = yuvTexWidth > 16 ? yuvTexWidth / 16 : 1;
|
||||
int blockHeight = yuvTexHeight > 16 ? yuvTexHeight / 16 : 1;
|
||||
yuvTexBuffer = new GraphicBuffer(yuvTexWidth, yuvTexHeight, yuvTexFormat,
|
||||
|
@ -399,7 +399,6 @@ int main(int /*argc*/, char** /*argv*/) {
|
|||
checkEglError("eglQuerySurface");
|
||||
eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
|
||||
checkEglError("eglQuerySurface");
|
||||
GLint dim = w < h ? w : h;
|
||||
|
||||
fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
|
||||
|
||||
|
|
|
@ -3,6 +3,11 @@ cc_test {
|
|||
|
||||
srcs: ["gl_basic.cpp"],
|
||||
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
gtest: false,
|
||||
|
||||
shared_libs: [
|
||||
|
|
|
@ -191,8 +191,6 @@ int printEGLConfigurations(EGLDisplay dpy) {
|
|||
|
||||
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 main(int /*argc*/, char **/*argv*/)
|
|||
|
||||
int init_gl_surface(const WindowSurface& windowSurface)
|
||||
{
|
||||
EGLint numConfigs = 1;
|
||||
EGLConfig myConfig = {0};
|
||||
EGLint attrib[] =
|
||||
{
|
||||
|
@ -265,7 +262,6 @@ int init_gl_surface(const WindowSurface& windowSurface)
|
|||
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 create_texture(void)
|
|||
|
||||
void render()
|
||||
{
|
||||
int i, j;
|
||||
int quads = 1;
|
||||
|
||||
const GLfloat vertices[] = {
|
||||
-1, -1, 0,
|
||||
1, -1, 0,
|
||||
|
|
|
@ -20,5 +20,9 @@ cc_test {
|
|||
|
||||
static_libs: ["libglTest"],
|
||||
|
||||
cflags: ["-DGL_GLEXT_PROTOTYPES"],
|
||||
cflags: [
|
||||
"-DGL_GLEXT_PROTOTYPES",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -44,13 +44,6 @@ static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE) {
|
|||
}
|
||||
}
|
||||
|
||||
static void checkGlError(const char* op) {
|
||||
for (GLint error = glGetError(); error; error
|
||||
= glGetError()) {
|
||||
fprintf(stderr, "after %s() glError (0x%x)\n", op, error);
|
||||
}
|
||||
}
|
||||
|
||||
bool doTest(uint32_t w, uint32_t h);
|
||||
|
||||
static EGLDisplay dpy;
|
||||
|
@ -118,7 +111,6 @@ int main(int /*argc*/, char** /*argv*/) {
|
|||
checkEglError("eglQuerySurface");
|
||||
eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
|
||||
checkEglError("eglQuerySurface");
|
||||
GLint dim = w < h ? w : h;
|
||||
|
||||
glViewport(0, 0, w, h);
|
||||
|
||||
|
|
|
@ -19,5 +19,7 @@ cc_test {
|
|||
cflags: [
|
||||
"-DGL_GLEXT_PROTOTYPES",
|
||||
"-DEGL_EGLEXT_PROTOTYPES",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -289,7 +289,6 @@ int main(int /*argc*/, char** /*argv*/) {
|
|||
checkEglError("eglQuerySurface");
|
||||
eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
|
||||
checkEglError("eglQuerySurface");
|
||||
GLint dim = w < h ? w : h;
|
||||
|
||||
fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
|
||||
|
||||
|
|
|
@ -3,6 +3,11 @@ cc_test {
|
|||
|
||||
srcs: ["gralloc.cpp"],
|
||||
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
gtest: false,
|
||||
|
||||
shared_libs: [
|
||||
|
|
|
@ -4,6 +4,8 @@ include $(CLEAR_VARS)
|
|||
LOCAL_SRC_FILES:= \
|
||||
linetex.cpp
|
||||
|
||||
LOCAL_CFLAGS := -Wall -Werror
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libcutils \
|
||||
libEGL \
|
||||
|
|
|
@ -4,6 +4,8 @@ include $(CLEAR_VARS)
|
|||
LOCAL_SRC_FILES:= \
|
||||
swapinterval.cpp
|
||||
|
||||
LOCAL_CFLAGS := -Wall -Werror
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libcutils \
|
||||
libutils \
|
||||
|
|
|
@ -21,5 +21,6 @@ LOCAL_MODULE:= test-opengl-textures
|
|||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES
|
||||
LOCAL_CFLAGS += -Wall -Werror
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
|
|
@ -87,12 +87,6 @@ int main(int /*argc*/, char** /*argv*/)
|
|||
0x0000, 0x5555, 0x0000, 0x5555,
|
||||
0xAAAA, 0xFFFF, 0xAAAA, 0xFFFF };
|
||||
|
||||
uint16_t t5551[] = {
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0xFFFF, 0x0000, 0xFFFF, 0x0000,
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0xFFFF, 0x0000, 0xFFFF, 0x0000 };
|
||||
|
||||
uint32_t t32[] = {
|
||||
0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000,
|
||||
0xFF00FF00, 0xFFFF0000, 0xFF000000, 0xFF0000FF,
|
||||
|
|
|
@ -4,6 +4,8 @@ include $(CLEAR_VARS)
|
|||
LOCAL_SRC_FILES:= \
|
||||
tritex.cpp
|
||||
|
||||
LOCAL_CFLAGS := -Wall -Werror
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libcutils \
|
||||
libEGL \
|
||||
|
|
|
@ -93,9 +93,6 @@ static void gluLookAt(float eyeX, float eyeY, float eyeZ,
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int q;
|
||||
int start, end;
|
||||
|
||||
printf("Initializing EGL...\n");
|
||||
|
||||
WindowSurface windowSurface;
|
||||
|
@ -120,7 +117,6 @@ int main(int argc, char **argv)
|
|||
|
||||
int init_gl_surface(const WindowSurface& windowSurface)
|
||||
{
|
||||
EGLint numConfigs = 1;
|
||||
EGLConfig myConfig = {0};
|
||||
EGLint attrib[] =
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue