mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-08-31 06:31:55 +00:00
214 lines
11 KiB
Diff
214 lines
11 KiB
Diff
![]() |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Daniel Micay <danielmicay@gmail.com>
|
||
|
Date: Tue, 16 Aug 2022 16:50:48 -0400
|
||
|
Subject: [PATCH] constify JNINativeMethod tables
|
||
|
|
||
|
---
|
||
|
luni/src/main/native/android_system_OsConstants.cpp | 2 +-
|
||
|
luni/src/main/native/java_lang_StringToReal.cpp | 2 +-
|
||
|
luni/src/main/native/java_lang_invoke_MethodHandle.cpp | 2 +-
|
||
|
luni/src/main/native/java_lang_invoke_VarHandle.cpp | 2 +-
|
||
|
luni/src/main/native/libcore_icu_ICU.cpp | 2 +-
|
||
|
luni/src/main/native/libcore_io_AsynchronousCloseMonitor.cpp | 2 +-
|
||
|
luni/src/main/native/libcore_io_Linux.cpp | 2 +-
|
||
|
luni/src/main/native/libcore_io_Memory.cpp | 2 +-
|
||
|
luni/src/main/native/libcore_math_NativeBN.cpp | 2 +-
|
||
|
.../src/main/native/libcore_util_NativeAllocationRegistry.cpp | 2 +-
|
||
|
luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp | 4 ++--
|
||
|
luni/src/main/native/sun_misc_Unsafe.cpp | 2 +-
|
||
|
ojluni/src/main/native/Character.cpp | 2 +-
|
||
|
ojluni/src/main/native/jdk_internal_misc_VM.cpp | 2 +-
|
||
|
14 files changed, 15 insertions(+), 15 deletions(-)
|
||
|
|
||
|
diff --git a/luni/src/main/native/android_system_OsConstants.cpp b/luni/src/main/native/android_system_OsConstants.cpp
|
||
|
index 50e3c104666..8ad66d2742b 100644
|
||
|
--- a/luni/src/main/native/android_system_OsConstants.cpp
|
||
|
+++ b/luni/src/main/native/android_system_OsConstants.cpp
|
||
|
@@ -722,7 +722,7 @@ static void OsConstants_initConstants(JNIEnv* env, jclass c) {
|
||
|
initConstant(env, c, "_SC_XOPEN_XCU_VERSION", _SC_XOPEN_XCU_VERSION);
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(OsConstants, initConstants, "()V"),
|
||
|
};
|
||
|
void register_android_system_OsConstants(JNIEnv* env) {
|
||
|
diff --git a/luni/src/main/native/java_lang_StringToReal.cpp b/luni/src/main/native/java_lang_StringToReal.cpp
|
||
|
index 7a492856394..edd71fad700 100644
|
||
|
--- a/luni/src/main/native/java_lang_StringToReal.cpp
|
||
|
+++ b/luni/src/main/native/java_lang_StringToReal.cpp
|
||
|
@@ -892,7 +892,7 @@ static jdouble StringToReal_parseDblImpl(JNIEnv* env, jclass, jstring s, jint e)
|
||
|
return createDouble(env, str.c_str(), e);
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(StringToReal, parseFltImpl, "(Ljava/lang/String;I)F"),
|
||
|
NATIVE_METHOD(StringToReal, parseDblImpl, "(Ljava/lang/String;I)D"),
|
||
|
};
|
||
|
diff --git a/luni/src/main/native/java_lang_invoke_MethodHandle.cpp b/luni/src/main/native/java_lang_invoke_MethodHandle.cpp
|
||
|
index 0441d4552dc..3335c6de9ac 100644
|
||
|
--- a/luni/src/main/native/java_lang_invoke_MethodHandle.cpp
|
||
|
+++ b/luni/src/main/native/java_lang_invoke_MethodHandle.cpp
|
||
|
@@ -29,7 +29,7 @@ static jobject MethodHandle_invoke(JNIEnv* env, jobject, jobjectArray) {
|
||
|
return nullptr;
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(MethodHandle, invokeExact, "([Ljava/lang/Object;)Ljava/lang/Object;"),
|
||
|
NATIVE_METHOD(MethodHandle, invoke, "([Ljava/lang/Object;)Ljava/lang/Object;"),
|
||
|
};
|
||
|
diff --git a/luni/src/main/native/java_lang_invoke_VarHandle.cpp b/luni/src/main/native/java_lang_invoke_VarHandle.cpp
|
||
|
index e1cc1c7f8b5..9f5215a5204 100644
|
||
|
--- a/luni/src/main/native/java_lang_invoke_VarHandle.cpp
|
||
|
+++ b/luni/src/main/native/java_lang_invoke_VarHandle.cpp
|
||
|
@@ -210,7 +210,7 @@ static jboolean VarHandle_weakCompareAndSetRelease(JNIEnv* env, jobject, jobject
|
||
|
return JNI_FALSE;
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(VarHandle, compareAndExchange, "([Ljava/lang/Object;)Ljava/lang/Object;"),
|
||
|
NATIVE_METHOD(VarHandle, compareAndExchangeAcquire, "([Ljava/lang/Object;)Ljava/lang/Object;"),
|
||
|
NATIVE_METHOD(VarHandle, compareAndExchangeRelease, "([Ljava/lang/Object;)Ljava/lang/Object;"),
|
||
|
diff --git a/luni/src/main/native/libcore_icu_ICU.cpp b/luni/src/main/native/libcore_icu_ICU.cpp
|
||
|
index f9401d1edb7..1531ad1ca59 100644
|
||
|
--- a/luni/src/main/native/libcore_icu_ICU.cpp
|
||
|
+++ b/luni/src/main/native/libcore_icu_ICU.cpp
|
||
|
@@ -112,7 +112,7 @@ static jstring ICU_getUnicodeVersion(JNIEnv* env, jclass) {
|
||
|
return versionString(env, unicodeVersion);
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(ICU, getAvailableLocalesNative, "()[Ljava/lang/String;"),
|
||
|
NATIVE_METHOD(ICU, getCldrVersion, "()Ljava/lang/String;"),
|
||
|
NATIVE_METHOD(ICU, getDefaultLocale, "()Ljava/lang/String;"),
|
||
|
diff --git a/luni/src/main/native/libcore_io_AsynchronousCloseMonitor.cpp b/luni/src/main/native/libcore_io_AsynchronousCloseMonitor.cpp
|
||
|
index e99edd6c4f9..61b75bcd358 100644
|
||
|
--- a/luni/src/main/native/libcore_io_AsynchronousCloseMonitor.cpp
|
||
|
+++ b/luni/src/main/native/libcore_io_AsynchronousCloseMonitor.cpp
|
||
|
@@ -26,7 +26,7 @@ static void AsynchronousCloseMonitor_signalBlockedThreads(JNIEnv* env, jclass, j
|
||
|
AsynchronousCloseMonitor::signalBlockedThreads(fd);
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(AsynchronousCloseMonitor, signalBlockedThreads, "(Ljava/io/FileDescriptor;)V"),
|
||
|
};
|
||
|
void register_libcore_io_AsynchronousCloseMonitor(JNIEnv* env) {
|
||
|
diff --git a/luni/src/main/native/libcore_io_Linux.cpp b/luni/src/main/native/libcore_io_Linux.cpp
|
||
|
index e8ed90e7a2c..0115e31d22d 100755
|
||
|
--- a/luni/src/main/native/libcore_io_Linux.cpp
|
||
|
+++ b/luni/src/main/native/libcore_io_Linux.cpp
|
||
|
@@ -2758,7 +2758,7 @@ static jint Linux_writev(JNIEnv* env, jobject, jobject javaFd, jobjectArray buff
|
||
|
#define NATIVE_METHOD_OVERLOAD(className, functionName, signature, variant) \
|
||
|
{ #functionName, signature, reinterpret_cast<void*>(className ## _ ## functionName ## variant) }
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(Linux, accept, "(Ljava/io/FileDescriptor;Ljava/net/SocketAddress;)Ljava/io/FileDescriptor;"),
|
||
|
NATIVE_METHOD(Linux, access, "(Ljava/lang/String;I)Z"),
|
||
|
NATIVE_METHOD(Linux, android_fdsan_exchange_owner_tag, "(Ljava/io/FileDescriptor;JJ)V"),
|
||
|
diff --git a/luni/src/main/native/libcore_io_Memory.cpp b/luni/src/main/native/libcore_io_Memory.cpp
|
||
|
index 851cb9fc4a7..72c71b7553d 100644
|
||
|
--- a/luni/src/main/native/libcore_io_Memory.cpp
|
||
|
+++ b/luni/src/main/native/libcore_io_Memory.cpp
|
||
|
@@ -242,7 +242,7 @@ static void Memory_unsafeBulkPut(JNIEnv* env, jclass, jbyteArray dstArray, jint
|
||
|
}
|
||
|
|
||
|
// The remaining Memory methods are contained in art/runtime/native/libcore_io_Memory.cc
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(Memory, memmove, "(Ljava/lang/Object;ILjava/lang/Object;IJ)V"),
|
||
|
FAST_NATIVE_METHOD(Memory, peekByte, "(J)B"),
|
||
|
FAST_NATIVE_METHOD(Memory, peekIntNative, "(J)I"),
|
||
|
diff --git a/luni/src/main/native/libcore_math_NativeBN.cpp b/luni/src/main/native/libcore_math_NativeBN.cpp
|
||
|
index dc4b947358b..c6af376f6bc 100644
|
||
|
--- a/luni/src/main/native/libcore_math_NativeBN.cpp
|
||
|
+++ b/luni/src/main/native/libcore_math_NativeBN.cpp
|
||
|
@@ -164,7 +164,7 @@ static void NativeBN_BN_mod_exp(JNIEnv* env, jclass, jlong r, jlong a, jlong p,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(NativeBN, BN_div, "(JJJJ)V"),
|
||
|
NATIVE_METHOD(NativeBN, BN_free, "(J)V"),
|
||
|
NATIVE_METHOD(NativeBN, BN_mod_exp, "(JJJJ)V"),
|
||
|
diff --git a/luni/src/main/native/libcore_util_NativeAllocationRegistry.cpp b/luni/src/main/native/libcore_util_NativeAllocationRegistry.cpp
|
||
|
index ded578a9580..faaa5c7a7c4 100644
|
||
|
--- a/luni/src/main/native/libcore_util_NativeAllocationRegistry.cpp
|
||
|
+++ b/luni/src/main/native/libcore_util_NativeAllocationRegistry.cpp
|
||
|
@@ -29,7 +29,7 @@ static void NativeAllocationRegistry_applyFreeFunction(JNIEnv*,
|
||
|
nativeFreeFunction(nativePtr);
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(NativeAllocationRegistry, applyFreeFunction, "(JJ)V"),
|
||
|
};
|
||
|
|
||
|
diff --git a/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp b/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
|
||
|
index fdabcf71591..62a2cd37b76 100644
|
||
|
--- a/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
|
||
|
+++ b/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
|
||
|
@@ -1366,7 +1366,7 @@ static void ExpatParser_staticInitialize(JNIEnv* env, jobject classObject, jstri
|
||
|
emptyString = reinterpret_cast<jstring>(env->NewGlobalRef(empty));
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod parserMethods[] = {
|
||
|
+static const JNINativeMethod parserMethods[] = {
|
||
|
NATIVE_METHOD(ExpatParser, appendString, "(JLjava/lang/String;Z)V"),
|
||
|
NATIVE_METHOD(ExpatParser, appendBytes, "(J[BII)V"),
|
||
|
NATIVE_METHOD(ExpatParser, appendChars, "(J[CII)V"),
|
||
|
@@ -1380,7 +1380,7 @@ static JNINativeMethod parserMethods[] = {
|
||
|
NATIVE_METHOD(ExpatParser, staticInitialize, "(Ljava/lang/String;)V"),
|
||
|
};
|
||
|
|
||
|
-static JNINativeMethod attributeMethods[] = {
|
||
|
+static const JNINativeMethod attributeMethods[] = {
|
||
|
NATIVE_METHOD(ExpatAttributes, freeAttributes, "(J)V"),
|
||
|
NATIVE_METHOD(ExpatAttributes, getIndexForQName, "(JLjava/lang/String;)I"),
|
||
|
NATIVE_METHOD(ExpatAttributes, getIndex, "(JLjava/lang/String;Ljava/lang/String;)I"),
|
||
|
diff --git a/luni/src/main/native/sun_misc_Unsafe.cpp b/luni/src/main/native/sun_misc_Unsafe.cpp
|
||
|
index 49848a2db2b..87b2feac807 100644
|
||
|
--- a/luni/src/main/native/sun_misc_Unsafe.cpp
|
||
|
+++ b/luni/src/main/native/sun_misc_Unsafe.cpp
|
||
|
@@ -23,7 +23,7 @@ static jobject Unsafe_allocateInstance(JNIEnv* env, jclass, jclass c) {
|
||
|
return env->AllocObject(c);
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
NATIVE_METHOD(Unsafe, allocateInstance, "(Ljava/lang/Class;)Ljava/lang/Object;"),
|
||
|
};
|
||
|
void register_sun_misc_Unsafe(JNIEnv* env) {
|
||
|
diff --git a/ojluni/src/main/native/Character.cpp b/ojluni/src/main/native/Character.cpp
|
||
|
index 3e27c674d2f..719190c81ae 100644
|
||
|
--- a/ojluni/src/main/native/Character.cpp
|
||
|
+++ b/ojluni/src/main/native/Character.cpp
|
||
|
@@ -158,7 +158,7 @@ Character_getNameImpl(JNIEnv* env, jclass, jint codePoint) {
|
||
|
return (U_FAILURE(status) || byteCount == 0) ? NULL : env->NewStringUTF(buf);
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
FAST_NATIVE_METHOD(Character, digitImpl, "(II)I"),
|
||
|
FAST_NATIVE_METHOD(Character, getDirectionalityImpl, "(I)B"),
|
||
|
NATIVE_METHOD(Character, getNameImpl, "(I)Ljava/lang/String;"),
|
||
|
diff --git a/ojluni/src/main/native/jdk_internal_misc_VM.cpp b/ojluni/src/main/native/jdk_internal_misc_VM.cpp
|
||
|
index 8e413286798..9791a13b84f 100644
|
||
|
--- a/ojluni/src/main/native/jdk_internal_misc_VM.cpp
|
||
|
+++ b/ojluni/src/main/native/jdk_internal_misc_VM.cpp
|
||
|
@@ -29,7 +29,7 @@ JNIEXPORT jlong JNICALL VM_getNanoTimeAdjustment(jlong offsetInSeconds) {
|
||
|
return JVM_GetNanoTimeAdjustment(nullptr, nullptr, offsetInSeconds);
|
||
|
}
|
||
|
|
||
|
-static JNINativeMethod gMethods[] = {
|
||
|
+static const JNINativeMethod gMethods[] = {
|
||
|
CRITICAL_NATIVE_METHOD(VM, getNanoTimeAdjustment, "(J)J"),
|
||
|
};
|
||
|
|