Fix warnings and enable -Werror
Fix unused-variable and empty for loop body warnings, disable
enum-conversion warnings, and enable -Wall -Werror
Test: builds
Change-Id: I7f349b29b1c64f4b4c3be9cae8b543fedf133d4d
diff --git a/Android.bp b/Android.bp
index 14291fc..173db03 100644
--- a/Android.bp
+++ b/Android.bp
@@ -104,6 +104,9 @@
],
cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-enum-conversion",
"-Depl_LINUX",
"-Wno-unused-parameter",
],
diff --git a/Embedded/common/src/b_BitFeatureEm/LocalScanDetector.c b/Embedded/common/src/b_BitFeatureEm/LocalScanDetector.c
index 880dba3..235f6e7 100644
--- a/Embedded/common/src/b_BitFeatureEm/LocalScanDetector.c
+++ b/Embedded/common/src/b_BitFeatureEm/LocalScanDetector.c
@@ -675,7 +675,8 @@
}
while( !sortedL );
- for( iL = ( sizeL >> 1 ); iL < sizeL && actArrL[ idxArrL[ iL ] ] >= 0; iL++ );
+ for( iL = ( sizeL >> 1 ); iL < sizeL && actArrL[ idxArrL[ iL ] ] >= 0; iL++ )
+ ;
{
uint32 subSizeL = iL;
diff --git a/FaceDetector_jni.cpp b/FaceDetector_jni.cpp
index b31761c..ab765fc 100644
--- a/FaceDetector_jni.cpp
+++ b/FaceDetector_jni.cpp
@@ -197,7 +197,6 @@
btk_HDCR hdcr = (btk_HDCR)(_env->GetLongField(_this, gFaceDetectorOffsets.dcr));
btk_HFaceFinder hfd =
(btk_HFaceFinder)(_env->GetLongField(_this, gFaceDetectorOffsets.fd));
- u32 maxFaces = _env->GetIntField(_this, gFaceDetectorOffsets.maxFaces);
u32 width = _env->GetIntField(_this, gFaceDetectorOffsets.width);
u32 height = _env->GetIntField(_this, gFaceDetectorOffsets.height);
@@ -257,7 +256,6 @@
btk_FaceFinder_getDCR(hfd, hdcr);
getFaceData(hdcr, &faceData);
- const float X2F = 1.0f / 65536.0f;
_env->SetFloatField(face, gFaceOffsets.confidence, faceData.confidence);
_env->SetFloatField(face, gFaceOffsets.midpointx, faceData.midpointx);
_env->SetFloatField(face, gFaceOffsets.midpointy, faceData.midpointy);