summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-big5.c2
-rw-r--r--strings/ctype-cp932.c4
-rw-r--r--strings/ctype-gbk.c2
-rw-r--r--strings/ctype-mb.c4
-rw-r--r--strings/ctype-simple.c8
-rw-r--r--strings/ctype-sjis.c4
-rw-r--r--strings/ctype-ucs2.c8
-rw-r--r--strings/ctype-ujis.c10
-rw-r--r--strings/ctype-utf8.c2
9 files changed, 22 insertions, 22 deletions
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index ff4ce6fdb51..b467c8c5ba3 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -6309,7 +6309,7 @@ uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return b - b0;
+ return (uint) (b - b0);
}
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index c77ce858dff..be3526519cb 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -213,7 +213,7 @@ static int my_strnncoll_cp932_internal(CHARSET_INFO *cs,
uint a_char= cp932code(*a, *(a+1));
uint b_char= cp932code(*b, *(b+1));
if (a_char != b_char)
- return a_char - b_char;
+ return (int) a_char - (int) b_char;
a += 2;
b += 2;
} else
@@ -5449,7 +5449,7 @@ uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return b - b0;
+ return (uint) (b - b0);
}
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 6fb072d266d..7196d004ad5 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -9956,7 +9956,7 @@ uint my_well_formed_len_gbk(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return b - b0;
+ return (uint) (b - b0);
}
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index cbbd035c631..4b22f158284 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -260,7 +260,7 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
pos+= (mblen= my_ismbchar(cs, pos, end)) ? mblen : 1;
length--;
}
- return length ? end+2-start : pos-start;
+ return length ? (uint) (end + 2 - start) : (uint) (pos - start);
}
@@ -282,7 +282,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
b+= mblen;
pos--;
}
- return b - b_start;
+ return (uint) (b - b_start);
}
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 9e3a328ec26..af673b78254 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1051,7 +1051,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
if (*str == '.')
{
for(str++ ; str != end && *str == '0' ; str++);
- return str-str0;
+ return (ulong) (str - str0);
}
return 0;
@@ -1061,7 +1061,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
if (!my_isspace(cs,*str))
break;
}
- return str-str0;
+ return (ulong) (str - str0);
default:
return 0;
}
@@ -1078,14 +1078,14 @@ void my_fill_8bit(CHARSET_INFO *cs __attribute__((unused)),
uint my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e)
{
- return e-b;
+ return (uint) (e - b);
}
uint my_numcells_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e)
{
- return e-b;
+ return (uint) (e - b);
}
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 7f34ee3fa2d..900acefd4ea 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -213,7 +213,7 @@ static int my_strnncoll_sjis_internal(CHARSET_INFO *cs,
uint a_char= sjiscode(*a, *(a+1));
uint b_char= sjiscode(*b, *(b+1));
if (a_char != b_char)
- return a_char - b_char;
+ return (int) a_char - (int) b_char;
a += 2;
b += 2;
} else
@@ -4605,7 +4605,7 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return b - b0;
+ return (uint) (b - b0);
}
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index c3caaeadfb3..025fdd5a7f6 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -215,7 +215,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs,
s+=s_res;
t+=t_res;
}
- return t_is_prefix ? t-te : ((se-s) - (te-t));
+ return t_is_prefix ? (int) (t - te) : (int) ((se - s) - (te - t));
}
/*
@@ -326,7 +326,7 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
s+=s_res;
t+=t_res;
}
- return ( (se-s) - (te-t) );
+ return (int) ( (se-s) - (te-t) );
}
@@ -1349,7 +1349,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
s+=s_res;
t+=t_res;
}
- return t_is_prefix ? t-te : ((se-s) - (te-t));
+ return t_is_prefix ? (int) (t - te) : (int) ((se-s) - (te-t));
}
static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs,
@@ -1494,7 +1494,7 @@ ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)),
if (str[0] != '\0' || str[1] != ' ')
break;
}
- return str - str0;
+ return (ulong) (str - str0);
default:
return 0;
}
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 612dda2b3eb..f20e2756810 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -8270,7 +8270,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
if (b >= (uchar *) end) /* need more bytes */
{
*error= 1;
- return chbeg - beg; /* unexpected EOL */
+ return (uint) (chbeg - beg); /* unexpected EOL */
}
if (ch == 0x8E) /* [x8E][xA0-xDF] */
@@ -8278,7 +8278,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
if (*b >= 0xA0 && *b <= 0xDF)
continue;
*error= 1;
- return chbeg - beg; /* invalid sequence */
+ return (uint) (chbeg - beg); /* invalid sequence */
}
if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
@@ -8287,7 +8287,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
if (b >= (uchar*) end)
{
*error= 1;
- return chbeg - beg; /* unexpected EOL */
+ return (uint) (chbeg - beg);/* unexpected EOL */
}
}
@@ -8295,9 +8295,9 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
continue;
*error= 1;
- return chbeg - beg; /* invalid sequence */
+ return (uint) (chbeg - beg); /* invalid sequence */
}
- return b - (uchar *) beg;
+ return (uint) (b - (uchar *) beg);
}
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 205701e87c7..0bf57967630 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -2008,7 +2008,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs,
s+=s_res;
t+=t_res;
}
- return t_is_prefix ? t-te : ((se-s) - (te-t));
+ return t_is_prefix ? (int) (t-te) : (int) ((se-s) - (te-t));
}