Loading cmds/bootanimation/BootAnimation.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -159,8 +159,8 @@ status_t BootAnimation::initTexture(void* buffer, size_t len) SkBitmap bitmap; SkMemoryStream stream(buffer, len); SkImageDecoder* codec = SkImageDecoder::Factory(&stream); codec->setDitherImage(false); if (codec) { codec->setDitherImage(false); codec->decode(&stream, &bitmap, SkBitmap::kARGB_8888_Config, SkImageDecoder::kDecodePixels_Mode); Loading core/jni/android_os_Debug.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -335,6 +335,7 @@ static jint read_binder_stat(const char* stat) // loop until we have the block that represents this process do { if (fgets(line, 1024, fp) == 0) { fclose(fp); return -1; } } while (strncmp(compare, line, len)); Loading @@ -344,13 +345,16 @@ static jint read_binder_stat(const char* stat) do { if (fgets(line, 1024, fp) == 0) { fclose(fp); return -1; } } while (strncmp(compare, line, len)); // we have the line, now increment the line ptr to the value char* ptr = line + len; return atoi(ptr); jint result = atoi(ptr); fclose(fp); return result; } static jint android_os_Debug_getBinderSentTransactions(JNIEnv *env, jobject clazz) Loading core/jni/android_util_Process.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -395,7 +395,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); Loading @@ -414,7 +414,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; Loading Loading @@ -446,14 +446,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); } Loading Loading @@ -711,13 +711,13 @@ 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; i++; } while (buffer[i] != term && i < endIndex) { while (i < endIndex && buffer[i] != term) { i++; } if (end < 0) { Loading @@ -727,7 +727,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++; } } Loading libs/androidfw/AssetManager.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -688,7 +688,7 @@ const ResTable* AssetManager::getResTable(bool required) const } } else { ALOGV("loading resource table %s\n", ap.path.string()); Asset* ass = const_cast<AssetManager*>(this)-> ass = const_cast<AssetManager*>(this)-> openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap); Loading libs/androidfw/ObbFile.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ bool ObbFile::parseObbFile(int fd) { lseek64(fd, fileLength - kFooterTagSize, SEEK_SET); char *footer = new char[kFooterTagSize]; char footer[kFooterTagSize]; actual = TEMP_FAILURE_RETRY(read(fd, footer, kFooterTagSize)); if (actual != kFooterTagSize) { ALOGW("couldn't read footer signature: %s\n", strerror(errno)); Loading Loading
cmds/bootanimation/BootAnimation.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -159,8 +159,8 @@ status_t BootAnimation::initTexture(void* buffer, size_t len) SkBitmap bitmap; SkMemoryStream stream(buffer, len); SkImageDecoder* codec = SkImageDecoder::Factory(&stream); codec->setDitherImage(false); if (codec) { codec->setDitherImage(false); codec->decode(&stream, &bitmap, SkBitmap::kARGB_8888_Config, SkImageDecoder::kDecodePixels_Mode); Loading
core/jni/android_os_Debug.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -335,6 +335,7 @@ static jint read_binder_stat(const char* stat) // loop until we have the block that represents this process do { if (fgets(line, 1024, fp) == 0) { fclose(fp); return -1; } } while (strncmp(compare, line, len)); Loading @@ -344,13 +345,16 @@ static jint read_binder_stat(const char* stat) do { if (fgets(line, 1024, fp) == 0) { fclose(fp); return -1; } } while (strncmp(compare, line, len)); // we have the line, now increment the line ptr to the value char* ptr = line + len; return atoi(ptr); jint result = atoi(ptr); fclose(fp); return result; } static jint android_os_Debug_getBinderSentTransactions(JNIEnv *env, jobject clazz) Loading
core/jni/android_util_Process.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -395,7 +395,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); Loading @@ -414,7 +414,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; Loading Loading @@ -446,14 +446,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); } Loading Loading @@ -711,13 +711,13 @@ 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; i++; } while (buffer[i] != term && i < endIndex) { while (i < endIndex && buffer[i] != term) { i++; } if (end < 0) { Loading @@ -727,7 +727,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++; } } Loading
libs/androidfw/AssetManager.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -688,7 +688,7 @@ const ResTable* AssetManager::getResTable(bool required) const } } else { ALOGV("loading resource table %s\n", ap.path.string()); Asset* ass = const_cast<AssetManager*>(this)-> ass = const_cast<AssetManager*>(this)-> openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap); Loading
libs/androidfw/ObbFile.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ bool ObbFile::parseObbFile(int fd) { lseek64(fd, fileLength - kFooterTagSize, SEEK_SET); char *footer = new char[kFooterTagSize]; char footer[kFooterTagSize]; actual = TEMP_FAILURE_RETRY(read(fd, footer, kFooterTagSize)); if (actual != kFooterTagSize) { ALOGW("couldn't read footer signature: %s\n", strerror(errno)); Loading