pinyin/segmentor.h: fix comparision operator 73/139873/1 accepted/tizen/unified/20170721.202147 submit/tizen/20170721.023559
authorKefu Chai <tchaikov@gmail.com>
Tue, 7 Oct 2014 05:13:22 +0000 (13:13 +0800)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 21 Jul 2017 02:05:04 +0000 (11:05 +0900)
* fix a bunch of sign-compare warnings

Change-Id: Iacfa7983917080ef8b99dabd1c99b3e8e32bea9f

src/ime-core/imi_view_classic.cpp
src/pinyin/segmentor.h
src/portability.cpp

index ec5054c..db2f021 100644 (file)
@@ -197,11 +197,11 @@ CIMIClassicView::onKeyEvent(const CKeyEvent& key)
                && !m_pIC->isEmpty()) {
         changeMasks |= KEYEVENT_USED;
         if (m_candiPageFirst > 0) {
-            if (m_candiPageFirst > m_candiWindowSize)
+            if (m_candiPageFirst > m_candiWindowSize) {
                 m_candiPageFirst -= m_candiWindowSize;
-            else
+            } else {
                 m_candiPageFirst = 0;
-
+            }
             changeMasks |= CANDIDATE_MASK;
         }
     } else if (((modifiers == 0 && keycode == IM_VK_PAGE_DOWN)
index 9af15f1..162f7cb 100644 (file)
@@ -62,7 +62,7 @@ struct IPySegmentor {
                 return true;
 
             if (m_start == other.m_start)
-                return m_len < m_len;
+                return m_len < other.m_len;
 
             return false;
         }
index 58a06a6..ea3b4fb 100644 (file)
@@ -194,7 +194,7 @@ MBSTOWCS(TWCHAR *pwcs, const char* s, size_t n)
     const unsigned char *src = (const unsigned char*)s;
     TWCHAR* dst = pwcs;
 
-    while (dst - pwcs < n) {
+    while (dst - pwcs < (ssize_t)n) {
         if (*src < 0xc0 || *src >= 0xfe) {
             if (*src < 0x80) *dst++ = *src;
             if (*src++ == 0) break;