aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/correction.cpp
diff options
context:
space:
mode:
authorYusuke Nojima <nojima@google.com>2011-09-14 16:09:24 +0900
committerYusuke Nojima <nojima@google.com>2011-09-14 16:09:24 +0900
commit032cfeef5abe3a5ddf2e9ef20d834869f8090bee (patch)
tree4d740612922bb4783b1d0a76db2e64a04aa11fcb /native/src/correction.cpp
parent14c840fb27376e2ea2cc66804a1a545551e3a747 (diff)
downloadlatinime-032cfeef5abe3a5ddf2e9ef20d834869f8090bee.tar.gz
latinime-032cfeef5abe3a5ddf2e9ef20d834869f8090bee.tar.xz
latinime-032cfeef5abe3a5ddf2e9ef20d834869f8090bee.zip
Delete unused function and add TODO comment for a potential bug.
Change-Id: I7b16de1bd6b278c51d56eb1904e186c3db3b7f3d
Diffstat (limited to 'native/src/correction.cpp')
-rw-r--r--native/src/correction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/native/src/correction.cpp b/native/src/correction.cpp
index 5a0e608b8..d5bfed017 100644
--- a/native/src/correction.cpp
+++ b/native/src/correction.cpp
@@ -429,6 +429,9 @@ inline static void multiplyIntCapped(const int multiplier, int *base) {
if (multiplier == 2) {
*base = TWO_31ST_DIV_2 >= temp ? temp << 1 : S_INT_MAX;
} else {
+ // TODO: This overflow check gives a wrong answer when, for example,
+ // temp = 2^16 + 1 and multiplier = 2^17 + 1.
+ // Fix this behavior.
const int tempRetval = temp * multiplier;
*base = tempRetval >= temp ? tempRetval : S_INT_MAX;
}