diff options
Diffstat (limited to 'strings/ctype-sjis.c')
-rw-r--r-- | strings/ctype-sjis.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 8f7158cc9c9..dfa8819a4db 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -182,13 +182,13 @@ static uchar NEAR sort_order_sjis[]= (0x80<=(c) && (c)<=0xfc)) -static int ismbchar_sjis(CHARSET_INFO *cs __attribute__((unused)), +static uint ismbchar_sjis(CHARSET_INFO *cs __attribute__((unused)), const char* p, const char *e) { return (issjishead((uchar) *p) && (e-p)>1 && issjistail((uchar)p[1]) ? 2: 0); } -static int mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c) +static uint mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c) { return (issjishead((uchar) c) ? 2 : 1); } @@ -198,8 +198,8 @@ static int mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c) static int my_strnncoll_sjis_internal(CHARSET_INFO *cs, - const uchar **a_res, uint a_length, - const uchar **b_res, uint b_length) + const uchar **a_res, size_t a_length, + const uchar **b_res, size_t b_length) { const uchar *a= *a_res, *b= *b_res; const uchar *a_end= a + a_length; @@ -230,9 +230,9 @@ static int my_strnncoll_sjis_internal(CHARSET_INFO *cs, static int my_strnncoll_sjis(CHARSET_INFO *cs __attribute__((unused)), - const uchar *a, uint a_length, - const uchar *b, uint b_length, - my_bool b_is_prefix) + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool b_is_prefix) { int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length); if (b_is_prefix && a_length > b_length) @@ -242,8 +242,8 @@ static int my_strnncoll_sjis(CHARSET_INFO *cs __attribute__((unused)), static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)), - const uchar *a, uint a_length, - const uchar *b, uint b_length, + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, my_bool diff_if_only_endspace_difference) { const uchar *a_end= a + a_length, *b_end= b + b_length; @@ -281,9 +281,9 @@ static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)), -static int my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)), - uchar *dest, uint len, - const uchar *src, uint srclen) +static size_t my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)), + uchar *dest, size_t len, + const uchar *src, size_t srclen) { uchar *d_end = dest + len; uchar *s_end = (uchar*) src + srclen; @@ -324,15 +324,16 @@ static int my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)), #define max_sort_char ((char) 255) static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)), - const char *ptr,uint ptr_length, + const char *ptr,size_t ptr_length, pbool escape, pbool w_one, pbool w_many, - uint res_length, char *min_str,char *max_str, - uint *min_length,uint *max_length) + size_t res_length, + char *min_str,char *max_str, + size_t *min_length,size_t *max_length) { const char *end= ptr + ptr_length; char *min_org=min_str; char *min_end=min_str+res_length; - uint charlen= res_length / cs->mbmaxlen; + size_t charlen= res_length / cs->mbmaxlen; for ( ; ptr < end && min_str < min_end && charlen > 0 ; charlen--) { @@ -363,7 +364,7 @@ static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)), 'a\0\0... is the smallest possible string when we have space expand a\ff\ff... is the biggest possible string */ - *min_length= ((cs->state & MY_CS_BINSORT) ? (uint) (min_str - min_org) : + *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) : res_length); *max_length= res_length; do @@ -376,7 +377,7 @@ static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)), *min_str++ = *max_str++ = *ptr++; } - *min_length= *max_length= (uint) (min_str - min_org); + *min_length= *max_length= (size_t) (min_str - min_org); while (min_str != min_end) *min_str++= *max_str++= ' '; /* Because if key compression */ return 0; @@ -4553,12 +4554,12 @@ my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)), } static -uint my_numcells_sjis(CHARSET_INFO *cs __attribute__((unused)), +size_t my_numcells_sjis(CHARSET_INFO *cs __attribute__((unused)), const char *str, const char *str_end) { - uint clen= 0; - const unsigned char *b= (const unsigned char *) str; - const unsigned char *e= (const unsigned char *) str_end; + size_t clen; + const uchar *b= (const uchar *) str; + const uchar *e= (const uchar *) str_end; for (clen= 0; b < e; ) { @@ -4586,9 +4587,9 @@ uint my_numcells_sjis(CHARSET_INFO *cs __attribute__((unused)), CP932 additional characters are also accepted. */ static -uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)), - const char *b, const char *e, - uint pos, int *error) +size_t my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, + size_t pos, int *error) { const char *b0= b; *error= 0; @@ -4616,7 +4617,7 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)), break; } } - return (uint) (b - b0); + return (size_t) (b - b0); } |