diff options
author | Andreas Gampe <agampe@google.com> | 2014-11-10 17:49:02 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-11-10 17:49:02 -0800 |
commit | e5160e7e59f96aa457e7a4217197150086e8b7ca (patch) | |
tree | 6d93f2920b014e9750ec36a2a35c702587579a07 /media/mca | |
parent | a31318620bce4e00e80188ee2778b7799cbdf0dc (diff) |
Frameworks/base: Wall Werror in media/mca
Turn on -Wall -Werror in media/mca. Fix warnings.
Change-Id: I2a43df1d0639babe240b91942a5ea3f8babdef93
Diffstat (limited to 'media/mca')
-rw-r--r-- | media/mca/filterfw/jni/Android.mk | 6 | ||||
-rw-r--r-- | media/mca/filterfw/jni/jni_gl_environment.cpp | 6 | ||||
-rw-r--r-- | media/mca/filterfw/jni/jni_init.cpp | 2 | ||||
-rw-r--r-- | media/mca/filterfw/native/Android.mk | 2 | ||||
-rw-r--r-- | media/mca/filterfw/native/core/shader_program.cpp | 8 | ||||
-rw-r--r-- | media/mca/filterfw/native/core/vertex_frame.cpp | 4 | ||||
-rw-r--r-- | media/mca/filterpacks/Android.mk | 4 | ||||
-rw-r--r-- | media/mca/filterpacks/native/imageproc/invert.c | 4 | ||||
-rw-r--r-- | media/mca/filterpacks/native/imageproc/to_rgba.c | 10 |
9 files changed, 27 insertions, 19 deletions
diff --git a/media/mca/filterfw/jni/Android.mk b/media/mca/filterfw/jni/Android.mk index 5aa5af17e90d..67337e03fe18 100644 --- a/media/mca/filterfw/jni/Android.mk +++ b/media/mca/filterfw/jni/Android.mk @@ -38,8 +38,8 @@ include $(LOCAL_PATH)/../native/libfilterfw.mk # Also need the JNI headers. LOCAL_C_INCLUDES += \ - $(JNI_H_INCLUDE) \ - $(LOCAL_PATH)/.. + $(JNI_H_INCLUDE) \ + $(LOCAL_PATH)/.. # Don't prelink this library. For more efficient code, you may want # to add this library to the prelink map and set this to true. However, @@ -47,5 +47,7 @@ LOCAL_C_INCLUDES += \ # part of a system image. LOCAL_PRELINK_MODULE := false +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code + include $(BUILD_STATIC_LIBRARY) diff --git a/media/mca/filterfw/jni/jni_gl_environment.cpp b/media/mca/filterfw/jni/jni_gl_environment.cpp index 6da7b7c766fd..5f007396f287 100644 --- a/media/mca/filterfw/jni/jni_gl_environment.cpp +++ b/media/mca/filterfw/jni/jni_gl_environment.cpp @@ -20,8 +20,8 @@ #include "jni/jni_gl_environment.h" #include "jni/jni_util.h" -#include <media/mediarecorder.h> #include "native/core/gl_env.h" +#include <media/mediarecorder.h> #include <gui/IGraphicBufferProducer.h> #include <gui/Surface.h> @@ -92,8 +92,8 @@ jboolean Java_android_filterfw_core_GLEnvironment_nativeIsContextActive(JNIEnv* return gl_env ? ToJBool(gl_env->IsContextActive()) : JNI_FALSE; } -jboolean Java_android_filterfw_core_GLEnvironment_nativeIsAnyContextActive(JNIEnv* env, - jclass clazz) { +jboolean Java_android_filterfw_core_GLEnvironment_nativeIsAnyContextActive(JNIEnv* /* env */, + jclass /* clazz */) { return ToJBool(GLEnv::IsAnyContextActive()); } diff --git a/media/mca/filterfw/jni/jni_init.cpp b/media/mca/filterfw/jni/jni_init.cpp index 3b131f1478ad..956a5a5c9854 100644 --- a/media/mca/filterfw/jni/jni_init.cpp +++ b/media/mca/filterfw/jni/jni_init.cpp @@ -27,7 +27,7 @@ using namespace android::filterfw; JavaVM* g_current_java_vm_ = NULL; -jint JNI_OnLoad(JavaVM* vm, void* reserved) { +jint JNI_OnLoad(JavaVM* vm, void* /* reserved */) { // Set the current vm pointer g_current_java_vm_ = vm; diff --git a/media/mca/filterfw/native/Android.mk b/media/mca/filterfw/native/Android.mk index 46ee28302cfa..7c4703fd5172 100644 --- a/media/mca/filterfw/native/Android.mk +++ b/media/mca/filterfw/native/Android.mk @@ -39,6 +39,8 @@ include $(LOCAL_PATH)/libfilterfw.mk # gcc should always be placed at the end. LOCAL_EXPORT_LDLIBS := -llog -lgcc +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code + # TODO: Build a shared library as well? include $(BUILD_STATIC_LIBRARY) diff --git a/media/mca/filterfw/native/core/shader_program.cpp b/media/mca/filterfw/native/core/shader_program.cpp index d92eb313200e..002327b45442 100644 --- a/media/mca/filterfw/native/core/shader_program.cpp +++ b/media/mca/filterfw/native/core/shader_program.cpp @@ -318,15 +318,15 @@ GLuint ShaderProgram::CompileShader(GLenum shader_type, const char* source) { ALOGE("Problem compiling shader! Source:"); ALOGE("%s", source); std::string src(source); - unsigned int cur_pos = 0; - unsigned int next_pos = 0; - int line_number = 1; + size_t cur_pos = 0; + size_t next_pos = 0; + size_t line_number = 1; while ( (next_pos = src.find_first_of('\n', cur_pos)) != std::string::npos) { ALOGE("%03d : %s", line_number, src.substr(cur_pos, next_pos-cur_pos).c_str()); cur_pos = next_pos + 1; line_number++; } - ALOGE("%03d : %s", line_number, src.substr(cur_pos, next_pos-cur_pos).c_str()); + ALOGE("%03zu : %s", line_number, src.substr(cur_pos, next_pos-cur_pos).c_str()); GLint log_length = 0; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &log_length); diff --git a/media/mca/filterfw/native/core/vertex_frame.cpp b/media/mca/filterfw/native/core/vertex_frame.cpp index 822573fcc32a..9fb9eaa92721 100644 --- a/media/mca/filterfw/native/core/vertex_frame.cpp +++ b/media/mca/filterfw/native/core/vertex_frame.cpp @@ -25,10 +25,6 @@ namespace android { namespace filterfw { -// GL Extensions that are dynamically looked up at runtime -static PFNGLMAPBUFFEROESPROC GLMapBufferOES = NULL; -static PFNGLUNMAPBUFFEROESPROC GLUnmapBufferOES = NULL; - VertexFrame::VertexFrame(int size) : vbo_(0), size_(size) { diff --git a/media/mca/filterpacks/Android.mk b/media/mca/filterpacks/Android.mk index 6e54f604baa0..d030749da172 100644 --- a/media/mca/filterpacks/Android.mk +++ b/media/mca/filterpacks/Android.mk @@ -28,6 +28,8 @@ LOCAL_SRC_FILES := native/base/geometry.cpp \ LOCAL_CFLAGS := -DANDROID +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code + include external/stlport/libstlport.mk include $(BUILD_STATIC_LIBRARY) @@ -50,4 +52,6 @@ LOCAL_SHARED_LIBRARIES := liblog libutils libfilterfw LOCAL_PRELINK_MODULE := false +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code + include $(BUILD_SHARED_LIBRARY) diff --git a/media/mca/filterpacks/native/imageproc/invert.c b/media/mca/filterpacks/native/imageproc/invert.c index 5938aac05ffc..f5f9e2728a85 100644 --- a/media/mca/filterpacks/native/imageproc/invert.c +++ b/media/mca/filterpacks/native/imageproc/invert.c @@ -16,12 +16,14 @@ #include <android/log.h> +#define ATTRIBUTE_UNUSED __attribute__((unused)) + int invert_process(const char** inputs, const int* input_sizes, int input_count, char* output, int output_size, - void* user_data) { + void* user_data ATTRIBUTE_UNUSED) { // Make sure we have exactly one input if (input_count != 1) return 0; diff --git a/media/mca/filterpacks/native/imageproc/to_rgba.c b/media/mca/filterpacks/native/imageproc/to_rgba.c index bf4db2afdd76..80094c0e703e 100644 --- a/media/mca/filterpacks/native/imageproc/to_rgba.c +++ b/media/mca/filterpacks/native/imageproc/to_rgba.c @@ -16,12 +16,14 @@ #include <stdlib.h> +#define ATTRIBUTE_UNUSED __attribute__((unused)) + int gray_to_rgb_process(const char** inputs, const int* input_sizes, int input_count, char* output, int output_size, - void* user_data) { + void* user_data ATTRIBUTE_UNUSED) { // Make sure we have exactly one input if (input_count != 1) return 0; @@ -52,7 +54,7 @@ int rgba_to_rgb_process(const char** inputs, int input_count, char* output, int output_size, - void* user_data) { + void* user_data ATTRIBUTE_UNUSED) { // Make sure we have exactly one input if (input_count != 1) return 0; @@ -84,7 +86,7 @@ int gray_to_rgba_process(const char** inputs, int input_count, char* output, int output_size, - void* user_data) { + void* user_data ATTRIBUTE_UNUSED) { // Make sure we have exactly one input if (input_count != 1) return 0; @@ -116,7 +118,7 @@ int rgb_to_rgba_process(const char** inputs, int input_count, char* output, int output_size, - void* user_data) { + void* user_data ATTRIBUTE_UNUSED) { // Make sure we have exactly one input if (input_count != 1) return 0; |