Fix issues detected by static analysis tool 81/141381/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20170816.012126 accepted/tizen/4.0/unified/20170816.015110 accepted/tizen/4.0/unified/20170829.015801 accepted/tizen/unified/20170801.054940 submit/tizen/20170731.100903 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100004 submit/tizen_4.0_unified/20170814.115522 tizen_4.0.IoT.p1_release tizen_4.0.IoT.p2_release tizen_4.0.m2_release
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 31 Jul 2017 08:08:55 +0000 (17:08 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 31 Jul 2017 08:08:57 +0000 (17:08 +0900)
Change-Id: If14691fd381a2ff3d4268dd996848e766e07416b
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/scim_anthy_preedit.cpp
src/scim_anthy_style_file.cpp

index c828e06..4037e51 100755 (executable)
@@ -587,16 +587,16 @@ get_period_rule (TypingMethod method, PeriodStyle period)
 }
 
 static ConvRule *
-get_comma_rule (TypingMethod method, CommaStyle period)
+get_comma_rule (TypingMethod method, CommaStyle comma)
 {
     switch (method) {
     case SCIM_ANTHY_TYPING_METHOD_KANA:
-        switch (period) {
-        case SCIM_ANTHY_PERIOD_WIDE:
+        switch (comma) {
+        case SCIM_ANTHY_COMMA_WIDE:
             return scim_anthy_kana_wide_comma_rule;
-        case SCIM_ANTHY_PERIOD_HALF:
+        case SCIM_ANTHY_COMMA_HALF:
             return scim_anthy_kana_half_comma_rule;
-        case SCIM_ANTHY_PERIOD_JAPANESE:
+        case SCIM_ANTHY_COMMA_JAPANESE:
         default:
             return scim_anthy_kana_ja_comma_rule;
         };
@@ -604,12 +604,12 @@ get_comma_rule (TypingMethod method, CommaStyle period)
 
     case SCIM_ANTHY_TYPING_METHOD_ROMAJI:
     default:
-        switch (period) {
-        case SCIM_ANTHY_PERIOD_WIDE:
+        switch (comma) {
+        case SCIM_ANTHY_COMMA_WIDE:
             return scim_anthy_romaji_wide_comma_rule;
-        case SCIM_ANTHY_PERIOD_HALF:
+        case SCIM_ANTHY_COMMA_HALF:
             return scim_anthy_romaji_half_comma_rule;
-        case SCIM_ANTHY_PERIOD_JAPANESE:
+        case SCIM_ANTHY_COMMA_JAPANESE:
         default:
             return scim_anthy_romaji_ja_comma_rule;
         };
index 1e8d9a7..95f4559 100755 (executable)
@@ -134,7 +134,7 @@ StyleLine::get_section (String &section)
          spos < m_line.length () && isspace (m_line[spos]);
          spos++);
     for (epos = m_line.length () - 1;
-         epos >= 0 && isspace (m_line[epos]);
+         isspace (m_line[epos]);
          epos--);
     spos++;
 
@@ -201,7 +201,7 @@ get_value_position (String &str)
         }
     }
     if (spos >= str.length ())
-        return true;
+        return 1;
     else
         spos++;
     for (;