summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-12-08 12:26:10 +0200
committerunknown <monty@mysql.com>2003-12-08 12:26:10 +0200
commit43b42ceee1702fe42e12c1b59a8e97cac3ed87c6 (patch)
treeac05a9d9cd3c2f907970eb0272e897313f840f95 /strings
parent8bf9ccb627af48fa24cce5699c9a9c2314cc406d (diff)
parente505696ffc54eeb819c5a59abeb3866155641ed8 (diff)
downloadmariadb-git-43b42ceee1702fe42e12c1b59a8e97cac3ed87c6.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/my/mysql-4.1 sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-euc_kr.c: Auto merged strings/ctype-gb2312.c: Auto merged strings/ctype-gbk.c: Auto merged strings/ctype-sjis.c: Auto merged strings/ctype-ujis.c: Auto merged
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-big5.c15
-rw-r--r--strings/ctype-euc_kr.c4
-rw-r--r--strings/ctype-gb2312.c15
-rw-r--r--strings/ctype-gbk.c4
-rw-r--r--strings/ctype-sjis.c16
-rw-r--r--strings/ctype-ucs2.c6
-rw-r--r--strings/ctype-ujis.c14
7 files changed, 39 insertions, 35 deletions
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index b7a87e21f0f..85f066c4eba 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -6183,16 +6183,16 @@ my_wc_mb_big5(CHARSET_INFO *cs __attribute__((unused)),
if (s >= e)
return MY_CS_TOOSMALL;
- if(wc<0x80)
+ if ((int) wc < 0x80)
{
- s[0]=wc;
+ s[0]= (uchar) wc;
return 1;
}
- if(!(code=func_uni_big5_onechar(wc)))
+ if (!(code=func_uni_big5_onechar(wc)))
return MY_CS_ILUNI;
- if(s+2>e)
+ if (s+2>e)
return MY_CS_TOOSMALL;
s[0]=code>>8;
@@ -6201,6 +6201,7 @@ my_wc_mb_big5(CHARSET_INFO *cs __attribute__((unused)),
return 2;
}
+
static int
my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc,const uchar *s,const uchar *e)
@@ -6211,16 +6212,16 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
if (s >= e)
return MY_CS_TOOFEW(0);
- if(hi<0x80)
+ if (hi<0x80)
{
pwc[0]=hi;
return 1;
}
- if(s+2>e)
+ if (s+2>e)
return MY_CS_TOOFEW(0);
- if(!(pwc[0]=func_big5_uni_onechar((hi<<8)+s[1])))
+ if (!(pwc[0]=func_big5_uni_onechar((hi<<8)+s[1])))
return MY_CS_ILSEQ;
return 2;
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index ace0c4aef5d..addd7803680 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -8591,9 +8591,9 @@ my_wc_mb_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
if (s >= e)
return MY_CS_TOOSMALL;
- if (wc<0x80)
+ if ((uint) wc < 0x80)
{
- s[0]=wc;
+ s[0]= (uchar) wc;
return 1;
}
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 248755785f1..b84ddc9081b 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -5641,16 +5641,16 @@ my_wc_mb_gb2312(CHARSET_INFO *cs __attribute__((unused)),
if (s >= e)
return MY_CS_TOOSMALL;
- if (wc<0x80)
+ if ((uint) wc < 0x80)
{
- s[0]=wc;
+ s[0]= (uchar) wc;
return 1;
}
if (!(code=func_uni_gb2312_onechar(wc)))
return MY_CS_ILUNI;
- if(s+2>e)
+ if (s+2>e)
return MY_CS_TOOSMALL;
code|=0x8080;
@@ -5659,26 +5659,27 @@ my_wc_mb_gb2312(CHARSET_INFO *cs __attribute__((unused)),
return 2;
}
+
static int
my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi;
- hi=s[0];
+ hi=(int) s[0];
if (s >= e)
return MY_CS_TOOFEW(0);
- if(hi<0x80)
+ if (hi<0x80)
{
pwc[0]=hi;
return 1;
}
- if(s+2>e)
+ if (s+2>e)
return MY_CS_TOOFEW(0);
- if(!(pwc[0]=func_gb2312_uni_onechar(((hi<<8)+s[1])&0x7F7F)))
+ if (!(pwc[0]=func_gb2312_uni_onechar(((hi<<8)+s[1])&0x7F7F)))
return MY_CS_ILSEQ;
return 2;
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 3b2f5b784ed..585dc66be4c 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -9837,9 +9837,9 @@ my_wc_mb_gbk(CHARSET_INFO *cs __attribute__((unused)),
if (s >= e)
return MY_CS_TOOSMALL;
- if (wc<0x80)
+ if ((uint) wc < 0x80)
{
- s[0]=wc;
+ s[0]= (uchar) wc;
return 1;
}
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index d1cabbd72d6..a84fbd16e5d 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -4428,16 +4428,16 @@ my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)),
if (s >= e)
return MY_CS_TOOSMALL;
- if(wc<0x80)
+ if ((int) wc < 0x80)
{
- s[0]=wc;
+ s[0]= (uchar) wc;
return 1;
}
- if(!(code=func_uni_sjis_onechar(wc)))
+ if (!(code=func_uni_sjis_onechar(wc)))
return MY_CS_ILUNI;
- if(s+2>e)
+ if (s+2>e)
return MY_CS_TOOSMALL;
s[0]=code>>8;
@@ -4445,6 +4445,7 @@ my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)),
return 2;
}
+
static int
my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
@@ -4453,16 +4454,16 @@ my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
if (s >= e)
return MY_CS_TOOFEW(0);
- if(hi<0x80)
+ if (hi<0x80)
{
pwc[0]=hi;
return 1;
}
- if(s+2>e)
+ if (s+2>e)
return MY_CS_TOOFEW(0);
- if(!(pwc[0]=func_sjis_uni_onechar((hi<<8)+s[1])))
+ if (!(pwc[0]=func_sjis_uni_onechar((hi<<8)+s[1])))
return MY_CS_ILSEQ;
return 2;
@@ -4481,6 +4482,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_hash_sort_simple,
};
+
static MY_CHARSET_HANDLER my_charset_handler=
{
ismbchar_sjis,
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index cdcd91b2916..beb803a69f2 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -106,8 +106,8 @@ static int my_uni_ucs2 (CHARSET_INFO *cs __attribute__((unused)) ,
if ( r+2 > e )
return MY_CS_TOOSMALL;
- r[0]=wc >> 8;
- r[1]=wc & 0xFF;
+ r[0]= (uchar) (wc >> 8);
+ r[1]= (uchar) (wc & 0xFF);
return 2;
}
@@ -862,7 +862,7 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
s+=cnv;
if (wc > (int) (uchar) 'e' || !wc)
break; /* Can't be part of double */
- *b++=wc;
+ *b++= (char) wc;
}
*b= 0;
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 484ee605273..2815b70351b 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -252,25 +252,25 @@ my_wc_mb_jisx0201(CHARSET_INFO *cs __attribute__((unused)),
uchar *e __attribute__((unused)))
{
- if (wc <= 0x7D)
+ if ((int) wc <= 0x7D)
{
- *s = wc;
+ *s = (uchar) wc;
return (wc == 0x5C) ? MY_CS_ILUNI : 1;
}
if (wc >= 0xFF61 && wc <= 0xFF9F)
{
- *s = (wc - 0xFEC0);
+ *s = (uchar) (wc - 0xFEC0);
return 1;
}
- if (wc==0x00A5)
+ if (wc == 0x00A5)
{
*s = 0x5C;
return 1;
}
- if (wc==0x203E)
+ if (wc == 0x203E)
{
*s = 0x7E;
return 1;
@@ -8349,12 +8349,12 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
if (s >= e)
return MY_CS_TOOSMALL;
- if (wc<0x80)
+ if ((int) wc < 0x80)
{
if (s>e)
return MY_CS_TOOSMALL;
- *s=wc;
+ *s= (uchar) wc;
return 1;
}