Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags. Fix associated errors about unused paramenters and implict sign conversions. For sign conversion this was largely in the area of enums, so add ostream operators for the effected enums and fix tools/generate-operator-out.py. Tidy arena allocation code and arena allocated data types, rather than fixing new and delete operators. Remove dead code. Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc index c35bb30..e1ceb8c 100644 --- a/runtime/native/dalvik_system_VMRuntime.cc +++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -166,13 +166,13 @@ return env->NewStringUTF(isa_string); } -static jboolean VMRuntime_is64Bit(JNIEnv* env, jobject) { +static jboolean VMRuntime_is64Bit(JNIEnv*, jobject) { bool is64BitMode = (sizeof(void*) == sizeof(uint64_t)); return is64BitMode ? JNI_TRUE : JNI_FALSE; } static jboolean VMRuntime_isCheckJniEnabled(JNIEnv* env, jobject) { - return Runtime::Current()->GetJavaVM()->IsCheckJniEnabled() ? JNI_TRUE : JNI_FALSE; + return down_cast<JNIEnvExt*>(env)->vm->IsCheckJniEnabled() ? JNI_TRUE : JNI_FALSE; } static void VMRuntime_setTargetSdkVersionNative(JNIEnv*, jobject, jint target_sdk_version) { @@ -201,9 +201,10 @@ Runtime::Current()->GetHeap()->RegisterNativeFree(env, static_cast<size_t>(bytes)); } -static void VMRuntime_updateProcessState(JNIEnv* env, jobject, jint process_state) { - Runtime::Current()->GetHeap()->UpdateProcessState(static_cast<gc::ProcessState>(process_state)); - Runtime::Current()->UpdateProfilerState(process_state); +static void VMRuntime_updateProcessState(JNIEnv*, jobject, jint process_state) { + Runtime* runtime = Runtime::Current(); + runtime->GetHeap()->UpdateProcessState(static_cast<gc::ProcessState>(process_state)); + runtime->UpdateProfilerState(process_state); } static void VMRuntime_trimHeap(JNIEnv*, jobject) { @@ -514,8 +515,9 @@ * for ART. */ static void VMRuntime_registerAppInfo(JNIEnv* env, jclass, jstring pkgName, - jstring appDir, jstring procName) { - const char *pkgNameChars = env->GetStringUTFChars(pkgName, NULL); + jstring appDir ATTRIBUTE_UNUSED, + jstring procName ATTRIBUTE_UNUSED) { + const char *pkgNameChars = env->GetStringUTFChars(pkgName, nullptr); std::string profileFile = StringPrintf("/data/dalvik-cache/profiles/%s", pkgNameChars); Runtime::Current()->StartProfiler(profileFile.c_str());