summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-12-08 12:25:37 +0200
committerunknown <monty@mysql.com>2003-12-08 12:25:37 +0200
commite505696ffc54eeb819c5a59abeb3866155641ed8 (patch)
tree2e2c3dbf3b3ed7009ec1572281cd1711c0875a30 /strings
parent580d754da662f7f9e0abf47f9e738ff737eecf6c (diff)
downloadmariadb-git-e505696ffc54eeb819c5a59abeb3866155641ed8.tar.gz
Portability fixes for Windows
VC++Files/client/mysqlclient.dsp: Update for windows VC++Files/libmysql/libmysql.dsp: Update for windows VC++Files/strings/strings.dsp: Update for windows libmysqld/lib_sql.cc: Update for windows scripts/make_win_src_distribution.sh: Update for windows scripts/mysql_install_db.sh: Update for windows sql/mysqld.cc: Remove not used variable sql/set_var.cc: Indentation cleanups sql/share/czech/errmsg.txt: Fixed wrong delimiters sql/share/danish/errmsg.txt: Fixed wrong delimiters sql/share/dutch/errmsg.txt: Fixed wrong delimiters sql/share/english/errmsg.txt: Fixed wrong delimiters sql/share/estonian/errmsg.txt: Fixed wrong delimiters sql/share/french/errmsg.txt: Fixed wrong delimiters sql/share/greek/errmsg.txt: Fixed wrong delimiters sql/share/hungarian/errmsg.txt: Fixed wrong delimiters sql/share/italian/errmsg.txt: Fixed wrong delimiters sql/share/japanese/errmsg.txt: Fixed wrong delimiters sql/share/korean/errmsg.txt: Fixed wrong delimiters sql/share/norwegian-ny/errmsg.txt: Fixed wrong delimiters sql/share/norwegian/errmsg.txt: Fixed wrong delimiters sql/share/polish/errmsg.txt: Fixed wrong delimiters sql/share/portuguese/errmsg.txt: Fixed wrong delimiters sql/share/romanian/errmsg.txt: Fixed wrong delimiters sql/share/russian/errmsg.txt: Fixed wrong delimiters sql/share/serbian/errmsg.txt: Fixed wrong delimiters sql/share/slovak/errmsg.txt: Fixed wrong delimiters sql/share/spanish/errmsg.txt: Fixed wrong delimiters sql/share/swedish/errmsg.txt: Fixed wrong delimiters sql/share/ukrainian/errmsg.txt: Fixed wrong delimiters sql/sql_acl.cc: Removed compiler warnings strings/ctype-big5.c: Removed compiler warnings (VC++) strings/ctype-euc_kr.c: Removed compiler warnings (VC++) strings/ctype-gb2312.c: Removed compiler warnings (VC++) strings/ctype-gbk.c: Removed compiler warnings (VC++) strings/ctype-sjis.c: Removed compiler warnings (VC++) strings/ctype-ucs2.c: Removed compiler warnings (VC++) strings/ctype-ujis.c: Removed compiler warnings (VC++)
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 878493bc31f..d70b06217c0 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 d47c4268642..5b04d9fa53b 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 d429fa34eea..afc418e01bd 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 fa7aa175103..db500644674 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 f302e678b9f..f08f8d4f0c2 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 29375aca727..a6f8ac65771 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;
}