summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nick Kralevich <nnk@google.com> 2012-12-07 16:56:47 -0800
committer Nick Kralevich <nnk@google.com> 2012-12-07 16:56:47 -0800
commit7353cf305e9bbb2c5968358d34ead9ca9df970b1 (patch)
treee895eb71d046861496da6692f2112bf4c45b8848
parent1612e29826dfe55f8deca27374046c5931ce5335 (diff)
convert jint to uint32_t.
This works around a compiler bug, and is probably more correct anyway. Change-Id: I1c49064bd64c31dafae560e416c665de0449f245
-rw-r--r--core/jni/android_util_EventLog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/jni/android_util_EventLog.cpp b/core/jni/android_util_EventLog.cpp
index a3981ce8ec00..6ee504dbff72 100644
--- a/core/jni/android_util_EventLog.cpp
+++ b/core/jni/android_util_EventLog.cpp
@@ -71,8 +71,8 @@ static jint android_util_EventLog_writeEvent_String(JNIEnv* env, jobject clazz,
// Don't throw NPE -- I feel like it's sort of mean for a logging function
// to be all crashy if you pass in NULL -- but make the NULL value explicit.
const char *str = value != NULL ? env->GetStringUTFChars(value, NULL) : "NULL";
- jint len = strlen(str);
- const int max = sizeof(buf) - sizeof(len) - 2; // Type byte, final newline
+ uint32_t len = strlen(str);
+ size_t max = sizeof(buf) - sizeof(len) - 2; // Type byte, final newline
if (len > max) len = max;
buf[0] = EVENT_TYPE_STRING;