summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-03-29 16:23:44 +0500
committerunknown <bar@mysql.com>2005-03-29 16:23:44 +0500
commit0b45706c3bb5d855d1cc71cd8610a2d9c96e9547 (patch)
treed8f8d6413472a918d5243bfbd4e1e9a6862491c2 /strings
parentdb5bb0c46c4892c75e4ec5b7db9260c70664fd72 (diff)
downloadmariadb-git-0b45706c3bb5d855d1cc71cd8610a2d9c96e9547.tar.gz
ctype-utf8.c, ctype-sjis.c:
Safer and mode readable way. strings/ctype-sjis.c: Safer and mode readable way. strings/ctype-utf8.c: Safer and mode readable way.
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-sjis.c7
-rw-r--r--strings/ctype-utf8.c9
2 files changed, 3 insertions, 13 deletions
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 0cb30a9b6ee..20f0081888f 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -4576,12 +4576,7 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
const char *b0= b;
while (pos && b < e)
{
- /*
- Cast to int8 for extra safety.
- "char" can be unsigned by default
- on some platforms.
- */
- if (((int8)b[0]) >= 0)
+ if ((uchar) b[0] < 128)
{
/* Single byte ascii character */
b++;
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 4d2bff5e89f..83725878a50 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -2129,12 +2129,7 @@ int my_strcasecmp_utf8(CHARSET_INFO *cs, const char *s, const char *t)
{
my_wc_t s_wc,t_wc;
- /*
- Cast to int8 for extra safety.
- char can be unsigned by default
- on some platforms.
- */
- if (((int8)s[0]) >= 0)
+ if ((uchar) s[0] < 128)
{
/*
s[0] is between 0 and 127.
@@ -2181,7 +2176,7 @@ int my_strcasecmp_utf8(CHARSET_INFO *cs, const char *s, const char *t)
/* Do the same for the second string */
- if (((int8)t[0]) >= 0)
+ if ((uchar) t[0] < 128)
{
/* Convert single byte character into weight */
t_wc= plane00[(uchar) t[0]].tolower;