summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-hung Hsieh <chh@google.com>2017-11-03 16:09:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-11-03 16:09:13 +0000
commitb9ce062aa4a8f8b5c076405c63d77b986173b931 (patch)
treee693be428f4a254a18bbe39a1ef41ae404b266f2
parentaa0ad5191cc5df7c9904d4a6ae76534e5a3f8515 (diff)
parent7cd8d8db5465b0acb6389b6525af65d797cfdc02 (diff)
downloadLegacyCamera-o-mr1-iot-preview-6.tar.gz
Merge "Use -Werror in packages/apps/LegacyCamera/jni"android-o-mr1-iot-preview-6o-mr1-iot-preview-6
-rwxr-xr-xjni/Android.mk14
-rw-r--r--jni/feature_mos/src/mosaic/Blend.cpp2
-rw-r--r--jni/feature_mos/src/mosaic/ImageUtils.h2
-rwxr-xr-xjni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp4
4 files changed, 20 insertions, 2 deletions
diff --git a/jni/Android.mk b/jni/Android.mk
index 8b816270..37213bcf 100755
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -10,6 +10,20 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/feature_mos/src/mosaic
LOCAL_CFLAGS := -O3 -DNDEBUG
+LOCAL_CFLAGS += -Wall -Werror
+# suppress existing non-critical warnings
+LOCAL_CFLAGS += \
+ -Wno-gnu-static-float-init \
+ -Wno-non-literal-null-conversion \
+ -Wno-self-assign \
+ -Wno-unused-parameter \
+ -Wno-unused-variable \
+ -Wno-unused-function \
+
+# some warnings should be fixed
+LOCAL_CFLAGS += \
+ -Wno-error=sometimes-uninitialized \
+
LOCAL_CPPFLAGS := -std=gnu++98
LOCAL_SRC_FILES := \
diff --git a/jni/feature_mos/src/mosaic/Blend.cpp b/jni/feature_mos/src/mosaic/Blend.cpp
index e37755de..56194623 100644
--- a/jni/feature_mos/src/mosaic/Blend.cpp
+++ b/jni/feature_mos/src/mosaic/Blend.cpp
@@ -792,7 +792,7 @@ int Blend::PerformFinalBlending(YUVinfo &imgMos, MosaicRect &cropping_rect)
delete b[j];
}
- delete b;
+ delete [] b;
return BLEND_RET_OK;
}
diff --git a/jni/feature_mos/src/mosaic/ImageUtils.h b/jni/feature_mos/src/mosaic/ImageUtils.h
index 87782383..92965ca8 100644
--- a/jni/feature_mos/src/mosaic/ImageUtils.h
+++ b/jni/feature_mos/src/mosaic/ImageUtils.h
@@ -47,7 +47,7 @@ public:
/**
* Definition of an empty image.
*/
- static const int IMAGE_TYPE_NOIMAGE = NULL;
+ static const int IMAGE_TYPE_NOIMAGE = 0;
/**
* Convert image from BGR (interlaced) to YVU (non-interlaced)
diff --git a/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp b/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp
index af6779a3..2bcffcf5 100755
--- a/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp
+++ b/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp
@@ -35,6 +35,10 @@ GLushort g_iIndices[] = { 0, 1, 2, 3 };
WarpRenderer::WarpRenderer() : Renderer()
{
+ // suppress warnings of unused private fields
+ (void) mTexHandle;
+ (void) mTexCoordHandle;
+ (void) mTriangleVerticesHandle;
}
WarpRenderer::~WarpRenderer() {