aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-05-29 00:23:14 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-29 00:23:14 -0700
commitbf61bba35feda09a2ad08475481ce042879ff5bb (patch)
tree09f02cdb6717f9b202386673ff48f53d8f68277d
parentbd40b94f965b1602bea35fd92f2f05d524f9ab3b (diff)
parent402b0570505c7ea1389e1c153e5db0300568ce26 (diff)
downloadlatinime-bf61bba35feda09a2ad08475481ce042879ff5bb.tar.gz
latinime-bf61bba35feda09a2ad08475481ce042879ff5bb.tar.xz
latinime-bf61bba35feda09a2ad08475481ce042879ff5bb.zip
Merge "Fix two small possible bugs." into jb-dev
-rw-r--r--native/jni/src/bigram_dictionary.cpp2
-rw-r--r--native/jni/src/binary_format.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/native/jni/src/bigram_dictionary.cpp b/native/jni/src/bigram_dictionary.cpp
index ac2a26172..8c73f4400 100644
--- a/native/jni/src/bigram_dictionary.cpp
+++ b/native/jni/src/bigram_dictionary.cpp
@@ -149,8 +149,8 @@ int BigramDictionary::getBigramListPositionForWord(const int32_t *prevWord,
} else {
pos = BinaryFormat::skipOtherCharacters(root, pos);
}
- pos = BinaryFormat::skipChildrenPosition(flags, pos);
pos = BinaryFormat::skipFrequency(flags, pos);
+ pos = BinaryFormat::skipChildrenPosition(flags, pos);
pos = BinaryFormat::skipShortcuts(root, flags, pos);
return pos;
}
diff --git a/native/jni/src/binary_format.h b/native/jni/src/binary_format.h
index 40f197619..4a1649c5e 100644
--- a/native/jni/src/binary_format.h
+++ b/native/jni/src/binary_format.h
@@ -421,7 +421,7 @@ inline int BinaryFormat::getWordAtAddress(const uint8_t* const root, const int a
// We count chars in order to avoid infinite loops if the file is broken or
// if there is some other bug
int charCount = maxDepth;
- while (-1 != nextChar && --charCount > 0) {
+ while (NOT_A_CHARACTER != nextChar && --charCount > 0) {
outWord[++wordPos] = nextChar;
nextChar = getCharCodeAndForwardPointer(root, &pos);
}