Fix clang warnings in core/jni.
There are a few bugs in here too (mostly people expecting + to
concatenate C strings) :(
Change-Id: I0a243c05c4ea8b56e84896f37814d0fbea4c39d5
diff --git a/core/jni/android_hardware_camera2_DngCreator.cpp b/core/jni/android_hardware_camera2_DngCreator.cpp
index cd60f42..d542419 100644
--- a/core/jni/android_hardware_camera2_DngCreator.cpp
+++ b/core/jni/android_hardware_camera2_DngCreator.cpp
@@ -16,6 +16,15 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "DngCreator_JNI"
+#include <inttypes.h>
+#include <string.h>
+
+#include <utils/Log.h>
+#include <utils/Errors.h>
+#include <utils/StrongPointer.h>
+#include <utils/RefBase.h>
+#include <utils/Vector.h>
+#include <cutils/properties.h>
#include <system/camera_metadata.h>
#include <camera/CameraMetadata.h>
@@ -27,15 +36,6 @@
#include <img_utils/Input.h>
#include <img_utils/StripSource.h>
-#include <utils/Log.h>
-#include <utils/Errors.h>
-#include <utils/StrongPointer.h>
-#include <utils/RefBase.h>
-#include <utils/Vector.h>
-#include <cutils/properties.h>
-
-#include <string.h>
-
#include "android_runtime/AndroidRuntime.h"
#include "android_runtime/android_hardware_camera2_CameraMetadata.h"
@@ -758,7 +758,8 @@
}
}
if (uninitialized) {
- ALOGE("%s: No valid NoiseProfile coefficients for color plane %u", __FUNCTION__, p);
+ ALOGE("%s: No valid NoiseProfile coefficients for color plane %zu",
+ __FUNCTION__, p);
return BAD_VALUE;
}
}
@@ -1399,8 +1400,9 @@
if (entry.count > 0) {
if (entry.count != numCfaChannels * 2) {
- ALOGW("%s: Invalid entry count %u for noise profile returned in characteristics,"
- " no noise profile tag written...", __FUNCTION__, entry.count);
+ ALOGW("%s: Invalid entry count %zu for noise profile returned "
+ "in characteristics, no noise profile tag written...",
+ __FUNCTION__, entry.count);
} else {
if ((err = generateNoiseProfile(entry.data.d, cfaOut, numCfaChannels,
cfaPlaneColor, numPlaneColors, /*out*/ noiseProfile)) == OK) {
@@ -1795,8 +1797,9 @@
jint height, jobject inBuffer, jint rowStride, jint pixStride, jlong offset,
jboolean isDirect) {
ALOGV("%s:", __FUNCTION__);
- ALOGV("%s: nativeWriteImage called with: width=%d, height=%d, rowStride=%d, pixStride=%d,"
- " offset=%lld", __FUNCTION__, width, height, rowStride, pixStride, offset);
+ ALOGV("%s: nativeWriteImage called with: width=%d, height=%d, "
+ "rowStride=%d, pixStride=%d, offset=%" PRId64, __FUNCTION__, width,
+ height, rowStride, pixStride, offset);
uint32_t rStride = static_cast<uint32_t>(rowStride);
uint32_t pStride = static_cast<uint32_t>(pixStride);
uint32_t uWidth = static_cast<uint32_t>(width);
@@ -1903,12 +1906,12 @@
uint32_t uHeight = static_cast<uint32_t>(height);
uint64_t uOffset = static_cast<uint32_t>(offset);
- ALOGV("%s: nativeWriteInputStream called with: width=%d, height=%d, rowStride=%u,"
- "pixStride=%u, offset=%lld", __FUNCTION__, width, height, rowStride, pixStride,
- offset);
+ ALOGV("%s: nativeWriteInputStream called with: width=%d, height=%d, "
+ "rowStride=%d, pixStride=%d, offset=%" PRId64, __FUNCTION__, width,
+ height, rowStride, pixStride, offset);
sp<JniOutputStream> out = new JniOutputStream(env, outStream);
- if(env->ExceptionCheck()) {
+ if (env->ExceptionCheck()) {
ALOGE("%s: Could not allocate buffers for output stream", __FUNCTION__);
return;
}