mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Portability fixes
Fixed wrong number of warnings/duplicates for machines with high-byte-first
This commit is contained in:
@ -223,7 +223,7 @@ static uint16 big5strokexfrm(uint16 i)
|
||||
static int my_strnncoll_big5_internal(const uchar **a_res,
|
||||
const uchar **b_res, uint length)
|
||||
{
|
||||
const char *a= *a_res, *b= *b_res;
|
||||
const uchar *a= *a_res, *b= *b_res;
|
||||
|
||||
while (length--)
|
||||
{
|
||||
@ -236,10 +236,10 @@ static int my_strnncoll_big5_internal(const uchar **a_res,
|
||||
b+= 2;
|
||||
length--;
|
||||
}
|
||||
else if (sort_order_big5[(uchar) *a++] !=
|
||||
sort_order_big5[(uchar) *b++])
|
||||
return ((int) sort_order_big5[(uchar) a[-1]] -
|
||||
(int) sort_order_big5[(uchar) b[-1]]);
|
||||
else if (sort_order_big5[*a++] !=
|
||||
sort_order_big5[*b++])
|
||||
return ((int) sort_order_big5[a[-1]] -
|
||||
(int) sort_order_big5[b[-1]]);
|
||||
}
|
||||
*a_res= a;
|
||||
*b_res= b;
|
||||
|
@ -2585,7 +2585,7 @@ static uint16 gbksortorder(uint16 i)
|
||||
int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
|
||||
uint length)
|
||||
{
|
||||
const char *a= *a_res, *b= *b_res;
|
||||
const uchar *a= *a_res, *b= *b_res;
|
||||
uint a_char,b_char;
|
||||
|
||||
while (length--)
|
||||
@ -2601,9 +2601,9 @@ int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
|
||||
b+= 2;
|
||||
length--;
|
||||
}
|
||||
else if (sort_order_gbk[(uchar) *a++] != sort_order_gbk[(uchar) *b++])
|
||||
return ((int) sort_order_gbk[(uchar) a[-1]] -
|
||||
(int) sort_order_gbk[(uchar) b[-1]]);
|
||||
else if (sort_order_gbk[*a++] != sort_order_gbk[*b++])
|
||||
return ((int) sort_order_gbk[a[-1]] -
|
||||
(int) sort_order_gbk[b[-1]]);
|
||||
}
|
||||
*a_res= a;
|
||||
*b_res= b;
|
||||
|
@ -283,7 +283,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs,
|
||||
|
||||
while (pos)
|
||||
{
|
||||
if ((mblen= cs->cset->mb_wc(cs, &wc, b, e)) <0)
|
||||
if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <0)
|
||||
break;
|
||||
b+= mblen;
|
||||
pos--;
|
||||
|
@ -6750,8 +6750,8 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs,
|
||||
int s_res;
|
||||
int t_res;
|
||||
|
||||
slen= cs->cset->lengthsp(cs, s, slen);
|
||||
tlen= cs->cset->lengthsp(cs, t, tlen);
|
||||
slen= cs->cset->lengthsp(cs, (char*) s, slen);
|
||||
tlen= cs->cset->lengthsp(cs, (char*) t, tlen);
|
||||
|
||||
my_uca_scanner_init(&sscanner, cs, s, slen);
|
||||
my_uca_scanner_init(&tscanner, cs, t, tlen);
|
||||
@ -6796,7 +6796,7 @@ static void my_hash_sort_uca(CHARSET_INFO *cs,
|
||||
int s_res;
|
||||
my_uca_scanner scanner;
|
||||
|
||||
slen= cs->cset->lengthsp(cs, s, slen);
|
||||
slen= cs->cset->lengthsp(cs, (char*) s, slen);
|
||||
my_uca_scanner_init(&scanner, cs, s, slen);
|
||||
|
||||
while ((s_res= my_uca_scanner_next(&scanner)) >0)
|
||||
|
Reference in New Issue
Block a user