summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcore/jni/android/graphics/Bitmap.cpp5
-rw-r--r--core/jni/android/graphics/BitmapFactory.cpp10
-rw-r--r--core/jni/android/graphics/GraphicsJNI.h3
-rw-r--r--core/jni/android/graphics/NinePatchImpl.cpp2
-rw-r--r--core/jni/android/graphics/pdf/PdfEditor.cpp12
-rw-r--r--core/jni/android/graphics/pdf/PdfRenderer.cpp8
-rw-r--r--core/jni/android/opengl/util.cpp12
-rw-r--r--core/jni/android_ddm_DdmHandleNativeHeap.cpp2
-rw-r--r--core/jni/android_hardware_Camera.cpp8
-rw-r--r--core/jni/android_hardware_camera2_CameraMetadata.cpp8
-rw-r--r--core/jni/android_hardware_camera2_DngCreator.cpp39
-rw-r--r--core/jni/android_media_AudioSystem.cpp6
-rw-r--r--core/jni/android_nio_utils.h1
-rw-r--r--core/jni/android_os_Trace.cpp12
-rw-r--r--core/jni/android_util_AssetManager.cpp44
-rw-r--r--core/jni/android_util_Binder.cpp1
-rw-r--r--core/jni/android_view_DisplayEventReceiver.cpp5
-rw-r--r--core/jni/com_android_internal_os_Zygote.cpp13
18 files changed, 96 insertions, 95 deletions
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index d7eef6e..61a34e5 100755
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -43,8 +43,11 @@ static void FromColor_D32(void* dst, const SkColor src[], int width,
static void FromColor_D32_Raw(void* dst, const SkColor src[], int width,
int, int) {
+ // Needed to thwart the unreachable code detection from clang.
+ static const bool sk_color_ne_zero = SK_COLOR_MATCHES_PMCOLOR_BYTE_ORDER;
+
// SkColor's ordering may be different from SkPMColor
- if (SK_COLOR_MATCHES_PMCOLOR_BYTE_ORDER) {
+ if (sk_color_ne_zero) {
memcpy(dst, src, width * sizeof(SkColor));
return;
}
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index a578b5d..0e08a8d 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -49,12 +49,6 @@ jmethodID gInsetStruct_constructorMethodID;
using namespace android;
-static inline int32_t validOrNeg1(bool isValid, int32_t value) {
-// return isValid ? value : -1;
- SkASSERT((int)isValid == 0 || (int)isValid == 1);
- return ((int32_t)isValid - 1) | value;
-}
-
jstring getMimeTypeString(JNIEnv* env, SkImageDecoder::Format format) {
static const struct {
SkImageDecoder::Format fFormat;
@@ -185,8 +179,8 @@ public:
const size_t size = sk_64_asS32(size64);
if (size > mSize) {
- ALOGW("bitmap marked for reuse (%d bytes) can't fit new bitmap (%d bytes)",
- mSize, size);
+ ALOGW("bitmap marked for reuse (%u bytes) can't fit new bitmap "
+ "(%zu bytes)", mSize, size);
return false;
}
diff --git a/core/jni/android/graphics/GraphicsJNI.h b/core/jni/android/graphics/GraphicsJNI.h
index e2b31cb..8ef56cf 100644
--- a/core/jni/android/graphics/GraphicsJNI.h
+++ b/core/jni/android/graphics/GraphicsJNI.h
@@ -19,7 +19,7 @@ class SkCanvas;
namespace android {
class Paint;
-class TypefaceImpl;
+struct TypefaceImpl;
}
class GraphicsJNI {
@@ -205,7 +205,6 @@ public:
private:
JavaVM* fVM;
- bool fAllocateInJavaHeap;
jbyteArray fStorageObj;
int fAllocCount;
};
diff --git a/core/jni/android/graphics/NinePatchImpl.cpp b/core/jni/android/graphics/NinePatchImpl.cpp
index c162c48..39a9554 100644
--- a/core/jni/android/graphics/NinePatchImpl.cpp
+++ b/core/jni/android/graphics/NinePatchImpl.cpp
@@ -120,7 +120,7 @@ void NinePatch_Draw(SkCanvas* canvas, const SkRect& bounds,
const int32_t* yDivs = chunk.getYDivs();
// if our SkCanvas were back by GL we should enable this and draw this as
// a mesh, which will be faster in most cases.
- if (false) {
+ if ((false)) {
SkNinePatch::DrawMesh(canvas, bounds, bitmap,
xDivs, chunk.numXDivs,
yDivs, chunk.numYDivs,
diff --git a/core/jni/android/graphics/pdf/PdfEditor.cpp b/core/jni/android/graphics/pdf/PdfEditor.cpp
index 98c42c9..17090b7 100644
--- a/core/jni/android/graphics/pdf/PdfEditor.cpp
+++ b/core/jni/android/graphics/pdf/PdfEditor.cpp
@@ -97,12 +97,12 @@ static jlong nativeOpen(JNIEnv* env, jclass thiz, jint fd, jlong size) {
switch (error) {
case FPDF_ERR_PASSWORD:
case FPDF_ERR_SECURITY: {
- jniThrowException(env, "java/lang/SecurityException",
- "cannot create document. Error:" + error);
+ jniThrowExceptionFmt(env, "java/lang/SecurityException",
+ "cannot create document. Error: %ld", error);
} break;
default: {
- jniThrowException(env, "java/io/IOException",
- "cannot create document. Error:" + error);
+ jniThrowExceptionFmt(env, "java/io/IOException",
+ "cannot create document. Error: %ld", error);
} break;
}
destroyLibraryIfNeeded();
@@ -169,8 +169,8 @@ static void nativeWrite(JNIEnv* env, jclass thiz, jlong documentPtr, jint fd) {
writer.WriteBlock = &writeBlock;
const bool success = FPDF_SaveAsCopy(document, &writer, FPDF_NO_INCREMENTAL);
if (!success) {
- jniThrowException(env, "java/io/IOException",
- "cannot write to fd. Error:" + errno);
+ jniThrowExceptionFmt(env, "java/io/IOException",
+ "cannot write to fd. Error: %d", errno);
destroyLibraryIfNeeded();
}
}
diff --git a/core/jni/android/graphics/pdf/PdfRenderer.cpp b/core/jni/android/graphics/pdf/PdfRenderer.cpp
index 2080f16..3319578 100644
--- a/core/jni/android/graphics/pdf/PdfRenderer.cpp
+++ b/core/jni/android/graphics/pdf/PdfRenderer.cpp
@@ -89,12 +89,12 @@ static jlong nativeCreate(JNIEnv* env, jclass thiz, jint fd, jlong size) {
switch (error) {
case FPDF_ERR_PASSWORD:
case FPDF_ERR_SECURITY: {
- jniThrowException(env, "java/lang/SecurityException",
- "cannot create document. Error:" + error);
+ jniThrowExceptionFmt(env, "java/lang/SecurityException",
+ "cannot create document. Error: %ld", error);
} break;
default: {
- jniThrowException(env, "java/io/IOException",
- "cannot create document. Error:" + error);
+ jniThrowExceptionFmt(env, "java/io/IOException",
+ "cannot create document. Error: %ld", error);
} break;
}
destroyLibraryIfNeeded();
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp
index e0ca951..f60a154 100644
--- a/core/jni/android/opengl/util.cpp
+++ b/core/jni/android/opengl/util.cpp
@@ -471,13 +471,13 @@ static
void multiplyMM(float* r, const float* lhs, const float* rhs)
{
for (int i=0 ; i<4 ; i++) {
- register const float rhs_i0 = rhs[ I(i,0) ];
- register float ri0 = lhs[ I(0,0) ] * rhs_i0;
- register float ri1 = lhs[ I(0,1) ] * rhs_i0;
- register float ri2 = lhs[ I(0,2) ] * rhs_i0;
- register float ri3 = lhs[ I(0,3) ] * rhs_i0;
+ const float rhs_i0 = rhs[ I(i,0) ];
+ float ri0 = lhs[ I(0,0) ] * rhs_i0;
+ float ri1 = lhs[ I(0,1) ] * rhs_i0;
+ float ri2 = lhs[ I(0,2) ] * rhs_i0;
+ float ri3 = lhs[ I(0,3) ] * rhs_i0;
for (int j=1 ; j<4 ; j++) {
- register const float rhs_ij = rhs[ I(i,j) ];
+ const float rhs_ij = rhs[ I(i,j) ];
ri0 += lhs[ I(j,0) ] * rhs_ij;
ri1 += lhs[ I(j,1) ] * rhs_ij;
ri2 += lhs[ I(j,2) ] * rhs_ij;
diff --git a/core/jni/android_ddm_DdmHandleNativeHeap.cpp b/core/jni/android_ddm_DdmHandleNativeHeap.cpp
index 9b96320..0938396 100644
--- a/core/jni/android_ddm_DdmHandleNativeHeap.cpp
+++ b/core/jni/android_ddm_DdmHandleNativeHeap.cpp
@@ -82,7 +82,7 @@ static jbyteArray DdmHandleNativeHeap_getLeakInfo(JNIEnv* env, jobject) {
get_malloc_leak_info(&allocBytes, &header.allocSize, &header.allocInfoSize,
&header.totalMemory, &header.backtraceSize);
- ALOGD("*** mapSize: %d allocSize: %d allocInfoSize: %d totalMemory: %d",
+ ALOGD("*** mapSize: %zu allocSize: %zu allocInfoSize: %zu totalMemory: %zu",
header.mapSize, header.allocSize, header.allocInfoSize, header.totalMemory);
#if defined(__LP64__)
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index c4f8f20..4d191a31 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -221,7 +221,7 @@ jbyteArray JNICameraContext::getCallbackBuffer(
// Vector access should be protected by lock in postData()
if (!buffers->isEmpty()) {
- ALOGV("Using callback buffer from queue of length %d", buffers->size());
+ ALOGV("Using callback buffer from queue of length %zu", buffers->size());
jbyteArray globalBuffer = buffers->itemAt(0);
buffers->removeAt(0);
@@ -231,7 +231,7 @@ jbyteArray JNICameraContext::getCallbackBuffer(
if (obj != NULL) {
jsize bufferLength = env->GetArrayLength(obj);
if ((int)bufferLength < (int)bufferSize) {
- ALOGE("Callback buffer was too small! Expected %d bytes, but got %d bytes!",
+ ALOGE("Callback buffer was too small! Expected %zu bytes, but got %d bytes!",
bufferSize, bufferLength);
env->DeleteLocalRef(obj);
return NULL;
@@ -444,7 +444,7 @@ void JNICameraContext::addCallbackBuffer(
jbyteArray callbackBuffer = (jbyteArray)env->NewGlobalRef(cbb);
mCallbackBuffers.push(callbackBuffer);
- ALOGV("Adding callback buffer to queue, %d total",
+ ALOGV("Adding callback buffer to queue, %zu total",
mCallbackBuffers.size());
// We want to make sure the camera knows we're ready for the
@@ -480,7 +480,7 @@ void JNICameraContext::clearCallbackBuffers_l(JNIEnv *env)
}
void JNICameraContext::clearCallbackBuffers_l(JNIEnv *env, Vector<jbyteArray> *buffers) {
- ALOGV("Clearing callback buffers, %d remained", buffers->size());
+ ALOGV("Clearing callback buffers, %zu remained", buffers->size());
while (!buffers->isEmpty()) {
env->DeleteGlobalRef(buffers->top());
buffers->pop();
diff --git a/core/jni/android_hardware_camera2_CameraMetadata.cpp b/core/jni/android_hardware_camera2_CameraMetadata.cpp
index a6a03e5..9132690 100644
--- a/core/jni/android_hardware_camera2_CameraMetadata.cpp
+++ b/core/jni/android_hardware_camera2_CameraMetadata.cpp
@@ -111,8 +111,8 @@ struct Helpers {
size_t typeSize = getTypeSize(type);
if (dataBytes % typeSize != 0) {
- ALOGE("%s: Expected dataBytes (%ud) to be divisible by typeSize "
- "(%ud)", __FUNCTION__, dataBytes, typeSize);
+ ALOGE("%s: Expected dataBytes (%zu) to be divisible by typeSize "
+ "(%zu)", __FUNCTION__, dataBytes, typeSize);
return BAD_VALUE;
}
@@ -219,7 +219,7 @@ static jboolean CameraMetadata_isEmpty(JNIEnv *env, jobject thiz) {
jboolean empty = metadata->isEmpty();
- ALOGV("%s: Empty returned %d, entry count was %d",
+ ALOGV("%s: Empty returned %d, entry count was %zu",
__FUNCTION__, empty, metadata->entryCount());
return empty;
@@ -675,7 +675,7 @@ static jint CameraMetadata_getTagFromKey(JNIEnv *env, jobject thiz, jstring keyN
"Could not find section name for key '%s')", key);
return 0;
} else {
- ALOGV("%s: Found matched section '%s' (%d)",
+ ALOGV("%s: Found matched section '%s' (%zu)",
__FUNCTION__, section, sectionIndex);
}
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 @@ static status_t generateNoiseProfile(const double* perChannelNoiseProfile, uint8
}
}
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 @@ static void DngCreator_init(JNIEnv* env, jobject thiz, jobject characteristicsPt
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 @@ static void DngCreator_nativeWriteImage(JNIEnv* env, jobject thiz, jobject outSt
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 @@ static void DngCreator_nativeWriteInputStream(JNIEnv* env, jobject thiz, jobject
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;
}
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index bdeaf29..378a700 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -1187,7 +1187,7 @@ android_media_AudioSystem_listAudioPatches(JNIEnv *env, jobject clazz,
jStatus = AUDIO_JAVA_ERROR;
goto exit;
}
- ALOGV("listAudioPatches patch %d num_sources %d num_sinks %d",
+ ALOGV("listAudioPatches patch %zu num_sources %d num_sinks %d",
i, nPatches[i].num_sources, nPatches[i].num_sinks);
env->SetIntField(patchHandle, gAudioHandleFields.mId, nPatches[i].id);
@@ -1211,7 +1211,7 @@ android_media_AudioSystem_listAudioPatches(JNIEnv *env, jobject clazz,
env->SetObjectArrayElement(jSources, j, jSource);
env->DeleteLocalRef(jSource);
jSource = NULL;
- ALOGV("listAudioPatches patch %d source %d is a %s handle %d",
+ ALOGV("listAudioPatches patch %zu source %zu is a %s handle %d",
i, j,
nPatches[i].sources[j].type == AUDIO_PORT_TYPE_DEVICE ? "device" : "mix",
nPatches[i].sources[j].id);
@@ -1236,7 +1236,7 @@ android_media_AudioSystem_listAudioPatches(JNIEnv *env, jobject clazz,
env->SetObjectArrayElement(jSinks, j, jSink);
env->DeleteLocalRef(jSink);
jSink = NULL;
- ALOGV("listAudioPatches patch %d sink %d is a %s handle %d",
+ ALOGV("listAudioPatches patch %zu sink %zu is a %s handle %d",
i, j,
nPatches[i].sinks[j].type == AUDIO_PORT_TYPE_DEVICE ? "device" : "mix",
nPatches[i].sinks[j].id);
diff --git a/core/jni/android_nio_utils.h b/core/jni/android_nio_utils.h
index 69c360c..5ada287 100644
--- a/core/jni/android_nio_utils.h
+++ b/core/jni/android_nio_utils.h
@@ -65,7 +65,6 @@ private:
JNIEnv* fEnv;
void* fPointer;
jarray fArray;
- jint fRemaining;
jboolean fCommit;
};
diff --git a/core/jni/android_os_Trace.cpp b/core/jni/android_os_Trace.cpp
index 7735464..52fd111 100644
--- a/core/jni/android_os_Trace.cpp
+++ b/core/jni/android_os_Trace.cpp
@@ -17,6 +17,8 @@
#define LOG_TAG "Trace"
// #define LOG_NDEBUG 0
+#include <inttypes.h>
+
#include <JNIHelp.h>
#include <ScopedUtfChars.h>
#include <ScopedStringChars.h>
@@ -48,7 +50,7 @@ static void android_os_Trace_nativeTraceCounter(JNIEnv* env, jclass clazz,
jlong tag, jstring nameStr, jint value) {
ScopedUtfChars name(env, nameStr);
- ALOGV("%s: %lld %s %d", __FUNCTION__, tag, name.c_str(), value);
+ ALOGV("%s: %" PRId64 " %s %d", __FUNCTION__, tag, name.c_str(), value);
atrace_int(tag, name.c_str(), value);
}
@@ -58,14 +60,14 @@ static void android_os_Trace_nativeTraceBegin(JNIEnv* env, jclass clazz,
String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
sanitizeString(utf8Chars);
- ALOGV("%s: %lld %s", __FUNCTION__, tag, utf8Chars.string());
+ ALOGV("%s: %" PRId64 " %s", __FUNCTION__, tag, utf8Chars.string());
atrace_begin(tag, utf8Chars.string());
}
static void android_os_Trace_nativeTraceEnd(JNIEnv* env, jclass clazz,
jlong tag) {
- ALOGV("%s: %lld", __FUNCTION__, tag);
+ ALOGV("%s: %" PRId64, __FUNCTION__, tag);
atrace_end(tag);
}
@@ -75,7 +77,7 @@ static void android_os_Trace_nativeAsyncTraceBegin(JNIEnv* env, jclass clazz,
String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
sanitizeString(utf8Chars);
- ALOGV("%s: %lld %s %d", __FUNCTION__, tag, utf8Chars.string(), cookie);
+ ALOGV("%s: %" PRId64 " %s %d", __FUNCTION__, tag, utf8Chars.string(), cookie);
atrace_async_begin(tag, utf8Chars.string(), cookie);
}
@@ -85,7 +87,7 @@ static void android_os_Trace_nativeAsyncTraceEnd(JNIEnv* env, jclass clazz,
String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
sanitizeString(utf8Chars);
- ALOGV("%s: %lld %s %d", __FUNCTION__, tag, utf8Chars.string(), cookie);
+ ALOGV("%s: %" PRId64 " %s %d", __FUNCTION__, tag, utf8Chars.string(), cookie);
atrace_async_end(tag, utf8Chars.string(), cookie);
}
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 21b4c3b..459cbd1 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -19,29 +19,28 @@
#include <android_runtime/android_util_AssetManager.h>
-#include "jni.h"
-#include "JNIHelp.h"
-#include "ScopedStringChars.h"
-#include "ScopedUtfChars.h"
-#include "android_util_Binder.h"
-#include <utils/misc.h>
-#include <android_runtime/AndroidRuntime.h>
-#include <utils/Log.h>
-
-#include <androidfw/Asset.h>
-#include <androidfw/AssetManager.h>
-#include <androidfw/AttributeFinder.h>
-#include <androidfw/ResourceTypes.h>
+#include <inttypes.h>
+#include <linux/capability.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/wait.h>
#include <private/android_filesystem_config.h> // for AID_SYSTEM
+#include "androidfw/Asset.h"
+#include "androidfw/AssetManager.h"
+#include "androidfw/AttributeFinder.h"
+#include "androidfw/ResourceTypes.h"
+#include "android_runtime/AndroidRuntime.h"
+#include "android_util_Binder.h"
#include "core_jni_helpers.h"
+#include "jni.h"
+#include "JNIHelp.h"
+#include "ScopedStringChars.h"
+#include "ScopedUtfChars.h"
+#include "utils/Log.h"
+#include "utils/misc.h"
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <linux/capability.h>
extern "C" int capget(cap_user_header_t hdrp, cap_user_data_t datap);
extern "C" int capset(cap_user_header_t hdrp, const cap_user_data_t datap);
@@ -1059,8 +1058,8 @@ static jboolean android_content_AssetManager_resolveAttrs(JNIEnv* env, jobject c
}
if (kDebugStyles) {
- ALOGI("APPLY STYLE: theme=0x%x defStyleAttr=0x%x defStyleRes=0x%x",
- themeToken, defStyleAttr, defStyleRes);
+ ALOGI("APPLY STYLE: theme=0x%" PRIx64 " defStyleAttr=0x%x "
+ "defStyleRes=0x%x", themeToken, defStyleAttr, defStyleRes);
}
ResTable::Theme* theme = reinterpret_cast<ResTable::Theme*>(themeToken);
@@ -1262,8 +1261,9 @@ static jboolean android_content_AssetManager_applyStyle(JNIEnv* env, jobject cla
}
if (kDebugStyles) {
- ALOGI("APPLY STYLE: theme=0x%x defStyleAttr=0x%x defStyleRes=0x%x xml=0x%x",
- themeToken, defStyleAttr, defStyleRes, xmlParserToken);
+ ALOGI("APPLY STYLE: theme=0x%" PRIx64 " defStyleAttr=0x%x defStyleRes=0x%x "
+ "xml=0x%" PRIx64, themeToken, defStyleAttr, defStyleRes,
+ xmlParserToken);
}
ResTable::Theme* theme = reinterpret_cast<ResTable::Theme*>(themeToken);
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 2496e70..0752c7e 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -208,7 +208,6 @@ static void report_exception(JNIEnv* env, jthrowable excep, const char* msg)
sleep(60);
ALOGE("Forcefully exiting");
exit(1);
- *((int *) 1) = 1;
}
bail:
diff --git a/core/jni/android_view_DisplayEventReceiver.cpp b/core/jni/android_view_DisplayEventReceiver.cpp
index b9fbccb..0d54953 100644
--- a/core/jni/android_view_DisplayEventReceiver.cpp
+++ b/core/jni/android_view_DisplayEventReceiver.cpp
@@ -18,9 +18,10 @@
//#define LOG_NDEBUG 0
-
#include "JNIHelp.h"
+#include <inttypes.h>
+
#include <android_runtime/AndroidRuntime.h>
#include <utils/Log.h>
#include <utils/Looper.h>
@@ -144,7 +145,7 @@ int NativeDisplayEventReceiver::handleEvent(int receiveFd, int events, void* dat
int32_t vsyncDisplayId;
uint32_t vsyncCount;
if (processPendingEvents(&vsyncTimestamp, &vsyncDisplayId, &vsyncCount)) {
- ALOGV("receiver %p ~ Vsync pulse: timestamp=%lld, id=%d, count=%d",
+ ALOGV("receiver %p ~ Vsync pulse: timestamp=%" PRId64 ", id=%d, count=%d",
this, vsyncTimestamp, vsyncDisplayId, vsyncCount);
mWaitingForVsync = false;
dispatchVsync(vsyncTimestamp, vsyncDisplayId, vsyncCount);
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 69d9387..c645e30 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -20,12 +20,12 @@
#include <sys/mount.h>
#include <linux/fs.h>
-#include <grp.h>
#include <fcntl.h>
+#include <grp.h>
+#include <inttypes.h>
#include <paths.h>
#include <signal.h>
#include <stdlib.h>
-#include <unistd.h>
#include <sys/capability.h>
#include <sys/personality.h>
#include <sys/prctl.h>
@@ -34,7 +34,7 @@
#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/wait.h>
-
+#include <unistd.h>
#include <cutils/fs.h>
#include <cutils/multiuser.h>
@@ -104,7 +104,7 @@ static void SigChldHandler(int /*signal_number*/) {
// so that it is restarted by init and system server will be restarted
// from there.
if (pid == gSystemServerPid) {
- ALOGE("Exit zygote because system server (%d) has terminated");
+ ALOGE("Exit zygote because system server (%d) has terminated", pid);
kill(getpid(), SIGKILL);
}
}
@@ -189,7 +189,8 @@ static void SetRLimits(JNIEnv* env, jobjectArray javaRlimits) {
int rc = setrlimit(javaRlimit[0], &rlim);
if (rc == -1) {
- ALOGE("setrlimit(%d, {%d, %d}) failed", javaRlimit[0], rlim.rlim_cur, rlim.rlim_max);
+ ALOGE("setrlimit(%d, {%ld, %ld}) failed", javaRlimit[0], rlim.rlim_cur,
+ rlim.rlim_max);
RuntimeAbort(env);
}
}
@@ -235,7 +236,7 @@ static void SetCapabilities(JNIEnv* env, int64_t permitted, int64_t effective) {
capdata[1].permitted = permitted >> 32;
if (capset(&capheader, &capdata[0]) == -1) {
- ALOGE("capset(%lld, %lld) failed", permitted, effective);
+ ALOGE("capset(%" PRId64 ", %" PRId64 ") failed", permitted, effective);
RuntimeAbort(env);
}
}