aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-05-14 11:15:14 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-14 11:15:14 +0000
commit0e40c0ce82078d58cc078a092a913e4ed4fdf326 (patch)
treebbec2280bcff2b005b8f0e50e4b1691fc756a8d8 /native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
parent60497abd91a5aa85cedf37c1e6d80fb17239e898 (diff)
parent32bdf9f3446d567f05bc49281a4ec43d4a19b2bf (diff)
downloadlatinime-0e40c0ce82078d58cc078a092a913e4ed4fdf326.tar.gz
latinime-0e40c0ce82078d58cc078a092a913e4ed4fdf326.tar.xz
latinime-0e40c0ce82078d58cc078a092a913e4ed4fdf326.zip
am 32bdf9f3: Merge "Use JniDataUtils::putXxxToArray() to output a value."
* commit '32bdf9f3446d567f05bc49281a4ec43d4a19b2bf': Use JniDataUtils::putXxxToArray() to output a value.
Diffstat (limited to 'native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp')
-rw-r--r--native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
index 418c77d7c..18b78c4df 100644
--- a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
+++ b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
@@ -136,10 +136,9 @@ static void latinime_BinaryDictionary_getHeaderInfo(JNIEnv *env, jclass clazz, j
if (!dictionary) return;
const DictionaryHeaderStructurePolicy *const headerPolicy =
dictionary->getDictionaryStructurePolicy()->getHeaderStructurePolicy();
- const int headerSize = headerPolicy->getSize();
- env->SetIntArrayRegion(outHeaderSize, 0 /* start */, 1 /* len */, &headerSize);
- const int formatVersion = headerPolicy->getFormatVersionNumber();
- env->SetIntArrayRegion(outFormatVersion, 0 /* start */, 1 /* len */, &formatVersion);
+ JniDataUtils::putIntToArray(env, outHeaderSize, 0 /* index */, headerPolicy->getSize());
+ JniDataUtils::putIntToArray(env, outFormatVersion, 0 /* index */,
+ headerPolicy->getFormatVersionNumber());
// Output attribute map
jclass arrayListClass = env->FindClass("java/util/ArrayList");
jmethodID addMethodId = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z");
@@ -184,8 +183,7 @@ static void latinime_BinaryDictionary_getSuggestions(JNIEnv *env, jclass clazz,
jfloatArray inOutLanguageWeight) {
Dictionary *dictionary = reinterpret_cast<Dictionary *>(dict);
// Assign 0 to outSuggestionCount here in case of returning earlier in this method.
- int count = 0;
- env->SetIntArrayRegion(outSuggestionCount, 0, 1 /* len */, &count);
+ JniDataUtils::putIntToArray(env, outSuggestionCount, 0 /* index */, 0);
if (!dictionary) {
return;
}