am ef86bbce: Add const_cast to live with host\'s jni.h

* commit 'ef86bbceaef53acbb4e56e2fa45a7dd0e3c2ccdb':
  Add const_cast to live with host's jni.h
This commit is contained in:
Tadashi G. Takaoka 2013-03-26 03:30:10 -07:00 committed by Android Git Automerger
commit 50cc14b549
3 changed files with 36 additions and 22 deletions

View file

@ -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"),
const_cast<char *>("(Ljava/lang/String;IIIII[II[I[I[I[I[I[F[F[F)J"),
reinterpret_cast<void *>(latinime_Keyboard_setProximityInfo)}, reinterpret_cast<void *>(latinime_Keyboard_setProximityInfo)},
{"releaseProximityInfoNative", "(J)V", reinterpret_cast<void *>(latinime_Keyboard_release)} {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) {

View file

@ -280,18 +280,26 @@ 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"),
const_cast<char *>("(Ljava/lang/String;JJ)J"),
reinterpret_cast<void *>(latinime_BinaryDictionary_open)}, reinterpret_cast<void *>(latinime_BinaryDictionary_open)},
{"closeNative", "(J)V", reinterpret_cast<void *>(latinime_BinaryDictionary_close)}, {const_cast<char *>("closeNative"),
{"getSuggestionsNative", "(JJJ[I[I[I[I[IIIZ[IZ[I[I[I[I)I", 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)}, reinterpret_cast<void *>(latinime_BinaryDictionary_getSuggestions)},
{"getProbabilityNative", "(J[I)I", {const_cast<char *>("getProbabilityNative"),
const_cast<char *>("(J[I)I"),
reinterpret_cast<void *>(latinime_BinaryDictionary_getProbability)}, reinterpret_cast<void *>(latinime_BinaryDictionary_getProbability)},
{"isValidBigramNative", "(J[I[I)Z", {const_cast<char *>("isValidBigramNative"),
const_cast<char *>("(J[I[I)Z"),
reinterpret_cast<void *>(latinime_BinaryDictionary_isValidBigram)}, reinterpret_cast<void *>(latinime_BinaryDictionary_isValidBigram)},
{"calcNormalizedScoreNative", "([I[II)F", {const_cast<char *>("calcNormalizedScoreNative"),
const_cast<char *>("([I[II)F"),
reinterpret_cast<void *>(latinime_BinaryDictionary_calcNormalizedScore)}, reinterpret_cast<void *>(latinime_BinaryDictionary_calcNormalizedScore)},
{"editDistanceNative", "([I[I)I", {const_cast<char *>("editDistanceNative"),
const_cast<char *>("([I[I)I"),
reinterpret_cast<void *>(latinime_BinaryDictionary_editDistance)} reinterpret_cast<void *>(latinime_BinaryDictionary_editDistance)}
}; };

View file

@ -48,11 +48,14 @@ static void latinime_releaseDicTraverseSession(JNIEnv *env, jclass clazz, jlong
} }
static JNINativeMethod sMethods[] = { static JNINativeMethod sMethods[] = {
{"setDicTraverseSessionNative", "(Ljava/lang/String;)J", {const_cast<char *>("setDicTraverseSessionNative"),
const_cast<char *>("(Ljava/lang/String;)J"),
reinterpret_cast<void *>(latinime_setDicTraverseSession)}, reinterpret_cast<void *>(latinime_setDicTraverseSession)},
{"initDicTraverseSessionNative", "(JJ[II)V", {const_cast<char *>("initDicTraverseSessionNative"),
const_cast<char *>("(JJ[II)V"),
reinterpret_cast<void *>(latinime_initDicTraverseSession)}, reinterpret_cast<void *>(latinime_initDicTraverseSession)},
{"releaseDicTraverseSessionNative", "(J)V", {const_cast<char *>("releaseDicTraverseSessionNative"),
const_cast<char *>("(J)V"),
reinterpret_cast<void *>(latinime_releaseDicTraverseSession)} reinterpret_cast<void *>(latinime_releaseDicTraverseSession)}
}; };