From 6a5d17cd2f55cdab01900af8933cb71b97b73a29 Mon Sep 17 00:00:00 2001
From: Jean Chalard <jchalard@google.com>
Date: Wed, 11 Jul 2012 11:55:25 +0900
Subject: [PATCH] Remove a useless parameter (A106)

Change-Id: Ic0ecea22212fd1a098a3a168da460374e446f4a3
---
 .../src/com/android/inputmethod/latin/BinaryDictionary.java | 5 ++---
 .../jni/com_android_inputmethod_latin_BinaryDictionary.cpp  | 6 +++---
 native/jni/src/bigram_dictionary.cpp                        | 3 +--
 native/jni/src/bigram_dictionary.h                          | 2 +-
 native/jni/src/dictionary.h                                 | 5 ++---
 5 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index 8eea626768..db8d3077db 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -93,8 +93,7 @@ public class BinaryDictionary extends Dictionary {
             int[] prevWordCodePointArray, boolean useFullEditDistance, char[] outputChars,
             int[] scores, int[] outputIndices);
     private native int getBigramsNative(long dict, int[] prevWord, int prevWordLength,
-            int[] inputCodes, int inputCodesLength, char[] outputChars, int[] scores,
-            int maxWordLength, int maxBigrams);
+            int[] inputCodes, int inputCodesLength, char[] outputChars, int[] scores);
     private static native float calcNormalizedScoreNative(
             char[] before, int beforeLength, char[] after, int afterLength, int score);
     private static native int editDistanceNative(
@@ -130,7 +129,7 @@ public class BinaryDictionary extends Dictionary {
             if (TextUtils.isEmpty(prevWord)) return null;
             int tmpCount = getBigramsNative(mNativeDict, prevWordCodePointArray,
                     prevWordCodePointArray.length, mInputCodes, composerSize,
-                    mOutputChars, mOutputScores, MAX_WORD_LENGTH, MAX_PREDICTIONS);
+                    mOutputChars, mOutputScores);
             count = Math.min(tmpCount, MAX_PREDICTIONS);
         } else {
             final InputPointers ips = composer.getInputPointers();
diff --git a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
index 4b18322d9d..5e3167bc35 100644
--- a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
+++ b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
@@ -167,7 +167,7 @@ static int latinime_BinaryDictionary_getSuggestions(JNIEnv *env, jobject object,
 
 static int latinime_BinaryDictionary_getBigrams(JNIEnv *env, jobject object, jlong dict,
         jintArray prevWordArray, jint prevWordLength, jintArray inputArray, jint inputArraySize,
-        jcharArray outputArray, jintArray frequencyArray, jint maxWordLength, jint maxBigrams) {
+        jcharArray outputArray, jintArray frequencyArray) {
     Dictionary *dictionary = (Dictionary*)dict;
     if (!dictionary) return 0;
     jint *prevWord = env->GetIntArrayElements(prevWordArray, 0);
@@ -175,7 +175,7 @@ static int latinime_BinaryDictionary_getBigrams(JNIEnv *env, jobject object, jlo
     jchar *outputChars = env->GetCharArrayElements(outputArray, 0);
     int *frequencies = env->GetIntArrayElements(frequencyArray, 0);
     int count = dictionary->getBigrams(prevWord, prevWordLength, inputCodes,
-            inputArraySize, (unsigned short*) outputChars, frequencies, maxWordLength, maxBigrams);
+            inputArraySize, (unsigned short*) outputChars, frequencies);
     env->ReleaseIntArrayElements(frequencyArray, frequencies, 0);
     env->ReleaseCharArrayElements(outputArray, outputChars, 0);
     env->ReleaseIntArrayElements(inputArray, inputCodes, JNI_ABORT);
@@ -265,7 +265,7 @@ static JNINativeMethod sMethods[] = {
             (void*) latinime_BinaryDictionary_getSuggestions},
     {"getFrequencyNative", "(J[II)I", (void*)latinime_BinaryDictionary_getFrequency},
     {"isValidBigramNative", "(J[I[I)Z", (void*)latinime_BinaryDictionary_isValidBigram},
-    {"getBigramsNative", "(J[II[II[C[III)I", (void*)latinime_BinaryDictionary_getBigrams},
+    {"getBigramsNative", "(J[II[II[C[I)I", (void*)latinime_BinaryDictionary_getBigrams},
     {"calcNormalizedScoreNative", "([CI[CII)F",
             (void*)latinime_BinaryDictionary_calcNormalizedScore},
     {"editDistanceNative", "([CI[CI)I", (void*)latinime_BinaryDictionary_editDistance}
diff --git a/native/jni/src/bigram_dictionary.cpp b/native/jni/src/bigram_dictionary.cpp
index 0c1aa70cbd..a9ea71813d 100644
--- a/native/jni/src/bigram_dictionary.cpp
+++ b/native/jni/src/bigram_dictionary.cpp
@@ -99,8 +99,7 @@ bool BigramDictionary::addWordBigram(unsigned short *word, int length, int frequ
  * reduce their scope to the ones that match the first letter.
  */
 int BigramDictionary::getBigrams(const int32_t *prevWord, int prevWordLength, int *inputCodes,
-        int codesSize, unsigned short *bigramChars, int *bigramFreq, int maxWordLength,
-        int maxBigrams) const {
+        int codesSize, unsigned short *bigramChars, int *bigramFreq) const {
     // TODO: remove unused arguments, and refrain from storing stuff in members of this class
     // TODO: have "in" arguments before "out" ones, and make out args explicit in the name
 
diff --git a/native/jni/src/bigram_dictionary.h b/native/jni/src/bigram_dictionary.h
index 3f397af4d1..fa602a18a0 100644
--- a/native/jni/src/bigram_dictionary.h
+++ b/native/jni/src/bigram_dictionary.h
@@ -29,7 +29,7 @@ class BigramDictionary {
  public:
     BigramDictionary(const unsigned char *dict, int maxWordLength, int maxPredictions);
     int getBigrams(const int32_t *word, int length, int *inputCodes, int codesSize,
-            unsigned short *outWords, int *frequencies, int maxWordLength, int maxBigrams) const;
+            unsigned short *outWords, int *frequencies) const;
     int getBigramListPositionForWord(const int32_t *prevWord, const int prevWordLength,
             const bool forceLowerCaseSearch) const;
     void fillBigramAddressToFrequencyMapAndFilter(const int32_t *prevWord, const int prevWordLength,
diff --git a/native/jni/src/dictionary.h b/native/jni/src/dictionary.h
index 6742b48cf6..eb6cc96816 100644
--- a/native/jni/src/dictionary.h
+++ b/native/jni/src/dictionary.h
@@ -59,9 +59,8 @@ class Dictionary {
     }
 
     int getBigrams(const int32_t *word, int length, int *codes, int codesSize,
-            unsigned short *outWords, int *frequencies, int maxWordLength, int maxBigrams) const {
-        return mBigramDictionary->getBigrams(word, length, codes, codesSize, outWords, frequencies,
-                maxWordLength, maxBigrams);
+            unsigned short *outWords, int *frequencies) const {
+        return mBigramDictionary->getBigrams(word, length, codes, codesSize, outWords, frequencies);
     }
 
     int getFrequency(const int32_t *word, int length) const;
-- 
GitLab