Add const_cast to live with host's jni.h
Bug: 7970626 Change-Id: I2fd09e16dd9df36eebca2d737a0b7cc3ddd1c862main
parent
73d00e68d8
commit
ef86bbceae
|
@ -43,9 +43,12 @@ static void latinime_Keyboard_release(JNIEnv *env, jclass clazz, jlong proximity
|
||||||
}
|
}
|
||||||
|
|
||||||
static JNINativeMethod sMethods[] = {
|
static JNINativeMethod sMethods[] = {
|
||||||
{"setProximityInfoNative", "(Ljava/lang/String;IIIII[II[I[I[I[I[I[F[F[F)J",
|
{const_cast<char *>("setProximityInfoNative"),
|
||||||
reinterpret_cast<void *>(latinime_Keyboard_setProximityInfo)},
|
const_cast<char *>("(Ljava/lang/String;IIIII[II[I[I[I[I[I[F[F[F)J"),
|
||||||
{"releaseProximityInfoNative", "(J)V", reinterpret_cast<void *>(latinime_Keyboard_release)}
|
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) {
|
int register_ProximityInfo(JNIEnv *env) {
|
||||||
|
|
|
@ -280,19 +280,27 @@ static void releaseDictBuf(const void *dictBuf, const size_t length, const int f
|
||||||
}
|
}
|
||||||
|
|
||||||
static JNINativeMethod sMethods[] = {
|
static JNINativeMethod sMethods[] = {
|
||||||
{"openNative", "(Ljava/lang/String;JJ)J",
|
{const_cast<char *>("openNative"),
|
||||||
reinterpret_cast<void *>(latinime_BinaryDictionary_open)},
|
const_cast<char *>("(Ljava/lang/String;JJ)J"),
|
||||||
{"closeNative", "(J)V", reinterpret_cast<void *>(latinime_BinaryDictionary_close)},
|
reinterpret_cast<void *>(latinime_BinaryDictionary_open)},
|
||||||
{"getSuggestionsNative", "(JJJ[I[I[I[I[IIIZ[IZ[I[I[I[I)I",
|
{const_cast<char *>("closeNative"),
|
||||||
reinterpret_cast<void *>(latinime_BinaryDictionary_getSuggestions)},
|
const_cast<char *>("(J)V"),
|
||||||
{"getProbabilityNative", "(J[I)I",
|
reinterpret_cast<void *>(latinime_BinaryDictionary_close)},
|
||||||
reinterpret_cast<void *>(latinime_BinaryDictionary_getProbability)},
|
{const_cast<char *>("getSuggestionsNative"),
|
||||||
{"isValidBigramNative", "(J[I[I)Z",
|
const_cast<char *>("(JJJ[I[I[I[I[IIIZ[IZ[I[I[I[I)I"),
|
||||||
reinterpret_cast<void *>(latinime_BinaryDictionary_isValidBigram)},
|
reinterpret_cast<void *>(latinime_BinaryDictionary_getSuggestions)},
|
||||||
{"calcNormalizedScoreNative", "([I[II)F",
|
{const_cast<char *>("getProbabilityNative"),
|
||||||
reinterpret_cast<void *>(latinime_BinaryDictionary_calcNormalizedScore)},
|
const_cast<char *>("(J[I)I"),
|
||||||
{"editDistanceNative", "([I[I)I",
|
reinterpret_cast<void *>(latinime_BinaryDictionary_getProbability)},
|
||||||
reinterpret_cast<void *>(latinime_BinaryDictionary_editDistance)}
|
{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) {
|
int register_BinaryDictionary(JNIEnv *env) {
|
||||||
|
|
|
@ -48,12 +48,15 @@ static void latinime_releaseDicTraverseSession(JNIEnv *env, jclass clazz, jlong
|
||||||
}
|
}
|
||||||
|
|
||||||
static JNINativeMethod sMethods[] = {
|
static JNINativeMethod sMethods[] = {
|
||||||
{"setDicTraverseSessionNative", "(Ljava/lang/String;)J",
|
{const_cast<char *>("setDicTraverseSessionNative"),
|
||||||
reinterpret_cast<void *>(latinime_setDicTraverseSession)},
|
const_cast<char *>("(Ljava/lang/String;)J"),
|
||||||
{"initDicTraverseSessionNative", "(JJ[II)V",
|
reinterpret_cast<void *>(latinime_setDicTraverseSession)},
|
||||||
reinterpret_cast<void *>(latinime_initDicTraverseSession)},
|
{const_cast<char *>("initDicTraverseSessionNative"),
|
||||||
{"releaseDicTraverseSessionNative", "(J)V",
|
const_cast<char *>("(JJ[II)V"),
|
||||||
reinterpret_cast<void *>(latinime_releaseDicTraverseSession)}
|
reinterpret_cast<void *>(latinime_initDicTraverseSession)},
|
||||||
|
{const_cast<char *>("releaseDicTraverseSessionNative"),
|
||||||
|
const_cast<char *>("(J)V"),
|
||||||
|
reinterpret_cast<void *>(latinime_releaseDicTraverseSession)}
|
||||||
};
|
};
|
||||||
|
|
||||||
int register_DicTraverseSession(JNIEnv *env) {
|
int register_DicTraverseSession(JNIEnv *env) {
|
||||||
|
|
Loading…
Reference in New Issue