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