diff --git a/native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp b/native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp index 30ca3f1b85c04152fb25d0f4c456c98bfbceeecf..3c482ca5878fcb2f1fc8563900ed210064bddbdc 100644 --- a/native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp +++ b/native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp @@ -43,9 +43,12 @@ static void latinime_Keyboard_release(JNIEnv *env, jclass clazz, jlong proximity } static JNINativeMethod sMethods[] = { - {"setProximityInfoNative", "(Ljava/lang/String;IIIII[II[I[I[I[I[I[F[F[F)J", - reinterpret_cast<void *>(latinime_Keyboard_setProximityInfo)}, - {"releaseProximityInfoNative", "(J)V", reinterpret_cast<void *>(latinime_Keyboard_release)} + {const_cast<char *>("setProximityInfoNative"), + const_cast<char *>("(Ljava/lang/String;IIIII[II[I[I[I[I[I[F[F[F)J"), + reinterpret_cast<void *>(latinime_Keyboard_setProximityInfo)}, + {const_cast<char *>("releaseProximityInfoNative"), + const_cast<char *>("(J)V"), + reinterpret_cast<void *>(latinime_Keyboard_release)} }; int register_ProximityInfo(JNIEnv *env) { diff --git a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp index 9321c4b8cf79c7b4ce54637e67a891377089767c..11fa3da3a329aa0b0d9f2573046a89d155da050a 100644 --- a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp +++ b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp @@ -280,19 +280,27 @@ static void releaseDictBuf(const void *dictBuf, const size_t length, const int f } static JNINativeMethod sMethods[] = { - {"openNative", "(Ljava/lang/String;JJ)J", - reinterpret_cast<void *>(latinime_BinaryDictionary_open)}, - {"closeNative", "(J)V", reinterpret_cast<void *>(latinime_BinaryDictionary_close)}, - {"getSuggestionsNative", "(JJJ[I[I[I[I[IIIZ[IZ[I[I[I[I)I", - reinterpret_cast<void *>(latinime_BinaryDictionary_getSuggestions)}, - {"getProbabilityNative", "(J[I)I", - reinterpret_cast<void *>(latinime_BinaryDictionary_getProbability)}, - {"isValidBigramNative", "(J[I[I)Z", - reinterpret_cast<void *>(latinime_BinaryDictionary_isValidBigram)}, - {"calcNormalizedScoreNative", "([I[II)F", - reinterpret_cast<void *>(latinime_BinaryDictionary_calcNormalizedScore)}, - {"editDistanceNative", "([I[I)I", - reinterpret_cast<void *>(latinime_BinaryDictionary_editDistance)} + {const_cast<char *>("openNative"), + const_cast<char *>("(Ljava/lang/String;JJ)J"), + reinterpret_cast<void *>(latinime_BinaryDictionary_open)}, + {const_cast<char *>("closeNative"), + const_cast<char *>("(J)V"), + reinterpret_cast<void *>(latinime_BinaryDictionary_close)}, + {const_cast<char *>("getSuggestionsNative"), + const_cast<char *>("(JJJ[I[I[I[I[IIIZ[IZ[I[I[I[I)I"), + reinterpret_cast<void *>(latinime_BinaryDictionary_getSuggestions)}, + {const_cast<char *>("getProbabilityNative"), + const_cast<char *>("(J[I)I"), + reinterpret_cast<void *>(latinime_BinaryDictionary_getProbability)}, + {const_cast<char *>("isValidBigramNative"), + const_cast<char *>("(J[I[I)Z"), + reinterpret_cast<void *>(latinime_BinaryDictionary_isValidBigram)}, + {const_cast<char *>("calcNormalizedScoreNative"), + const_cast<char *>("([I[II)F"), + reinterpret_cast<void *>(latinime_BinaryDictionary_calcNormalizedScore)}, + {const_cast<char *>("editDistanceNative"), + const_cast<char *>("([I[I)I"), + reinterpret_cast<void *>(latinime_BinaryDictionary_editDistance)} }; int register_BinaryDictionary(JNIEnv *env) { diff --git a/native/jni/com_android_inputmethod_latin_DicTraverseSession.cpp b/native/jni/com_android_inputmethod_latin_DicTraverseSession.cpp index 9b39245b9c227e05866a997f9d51594fdc8e176c..dfe3b09d8c46b13c8bbb67140da02c8fce7a0666 100644 --- a/native/jni/com_android_inputmethod_latin_DicTraverseSession.cpp +++ b/native/jni/com_android_inputmethod_latin_DicTraverseSession.cpp @@ -48,12 +48,15 @@ static void latinime_releaseDicTraverseSession(JNIEnv *env, jclass clazz, jlong } static JNINativeMethod sMethods[] = { - {"setDicTraverseSessionNative", "(Ljava/lang/String;)J", - reinterpret_cast<void *>(latinime_setDicTraverseSession)}, - {"initDicTraverseSessionNative", "(JJ[II)V", - reinterpret_cast<void *>(latinime_initDicTraverseSession)}, - {"releaseDicTraverseSessionNative", "(J)V", - reinterpret_cast<void *>(latinime_releaseDicTraverseSession)} + {const_cast<char *>("setDicTraverseSessionNative"), + const_cast<char *>("(Ljava/lang/String;)J"), + reinterpret_cast<void *>(latinime_setDicTraverseSession)}, + {const_cast<char *>("initDicTraverseSessionNative"), + const_cast<char *>("(JJ[II)V"), + reinterpret_cast<void *>(latinime_initDicTraverseSession)}, + {const_cast<char *>("releaseDicTraverseSessionNative"), + const_cast<char *>("(J)V"), + reinterpret_cast<void *>(latinime_releaseDicTraverseSession)} }; int register_DicTraverseSession(JNIEnv *env) {