summaryrefslogtreecommitdiffstats
path: root/core/jni/android_util_Process.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-10-29 14:58:16 -0700
committerElliott Hughes <enh@google.com>2013-10-29 14:58:16 -0700
commitdd86ed9b578332661ecea50e20f91335a0151a88 (patch)
tree159ad9c9e4d992207f827ac6cdaa52532c6227ec /core/jni/android_util_Process.cpp
parent887b4e89e713fd554e54f948fae52ddd7f8e03ca (diff)
parented84dea928a5a830a19b5bcab7ad05a7e92f3279 (diff)
downloadframeworks_base-dd86ed9b578332661ecea50e20f91335a0151a88.zip
frameworks_base-dd86ed9b578332661ecea50e20f91335a0151a88.tar.gz
frameworks_base-dd86ed9b578332661ecea50e20f91335a0151a88.tar.bz2
resolved conflicts for merge of ed84dea9 to master
Change-Id: Id214389f321f07aadd7a25e454a07863d7b128cb
Diffstat (limited to 'core/jni/android_util_Process.cpp')
-rw-r--r--core/jni/android_util_Process.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index e7e70d1..cbed99f 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -405,7 +405,7 @@ static int pid_compare(const void* v1, const void* v2)
return *((const jint*)v1) - *((const jint*)v2);
}
-static jlong getFreeMemoryImpl(const char* const sums[], const int sumsLen[], int num)
+static jlong getFreeMemoryImpl(const char* const sums[], const size_t sumsLen[], size_t num)
{
int fd = open("/proc/meminfo", O_RDONLY);
@@ -424,7 +424,7 @@ static jlong getFreeMemoryImpl(const char* const sums[], const int sumsLen[], in
}
buffer[len] = 0;
- int numFound = 0;
+ size_t numFound = 0;
jlong mem = 0;
char* p = buffer;
@@ -456,14 +456,14 @@ static jlong getFreeMemoryImpl(const char* const sums[], const int sumsLen[], in
static jlong android_os_Process_getFreeMemory(JNIEnv* env, jobject clazz)
{
static const char* const sums[] = { "MemFree:", "Cached:", NULL };
- static const int sumsLen[] = { strlen("MemFree:"), strlen("Cached:"), 0 };
+ static const size_t sumsLen[] = { strlen("MemFree:"), strlen("Cached:"), 0 };
return getFreeMemoryImpl(sums, sumsLen, 2);
}
static jlong android_os_Process_getTotalMemory(JNIEnv* env, jobject clazz)
{
static const char* const sums[] = { "MemTotal:", NULL };
- static const int sumsLen[] = { strlen("MemTotal:"), 0 };
+ static const size_t sumsLen[] = { strlen("MemTotal:"), 0 };
return getFreeMemoryImpl(sums, sumsLen, 1);
}
@@ -728,7 +728,7 @@ jboolean android_os_Process_parseProcLineArray(JNIEnv* env, jobject clazz,
jsize end = -1;
if ((mode&PROC_PARENS) != 0) {
- while (buffer[i] != ')' && i < endIndex) {
+ while (i < endIndex && buffer[i] != ')') {
i++;
}
end = i;
@@ -740,7 +740,7 @@ jboolean android_os_Process_parseProcLineArray(JNIEnv* env, jobject clazz,
end = i;
i++;
}
- while (buffer[i] != term && i < endIndex) {
+ while (i < endIndex && buffer[i] != term) {
i++;
}
if (end < 0) {
@@ -750,7 +750,7 @@ jboolean android_os_Process_parseProcLineArray(JNIEnv* env, jobject clazz,
if (i < endIndex) {
i++;
if ((mode&PROC_COMBINE) != 0) {
- while (buffer[i] == term && i < endIndex) {
+ while (i < endIndex && buffer[i] == term) {
i++;
}
}