diff options
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-simple.c | 17 | ||||
-rw-r--r-- | strings/decimal.c | 22 | ||||
-rw-r--r-- | strings/strmov.c | 6 |
3 files changed, 23 insertions, 22 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 2bd497cbd24..7151f390e4b 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -307,6 +307,7 @@ void my_hash_sort_simple(CHARSET_INFO *cs, { register const uchar *sort_order=cs->sort_order; const uchar *end= key + len; + ulong n1, n2; /* Remove end space. We have to do this to be able to compare @@ -314,13 +315,17 @@ void my_hash_sort_simple(CHARSET_INFO *cs, */ while (end > key && end[-1] == ' ') end--; - + + n1= *nr1; + n2= *nr2; for (; key < (uchar*) end ; key++) { - nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * - ((uint) sort_order[(uint) *key])) + (nr1[0] << 8); - nr2[0]+=3; + n1^=(ulong) ((((uint) n1 & 63)+n2) * + ((uint) sort_order[(uint) *key])) + (n1 << 8); + n2+=3; } + *nr1= n1; + *nr2= n2; } @@ -1561,7 +1566,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), } } - digits= str - beg; + digits= (int) (str - beg); /* Continue to accumulate into ulonglong */ for (dot= NULL, ull= ul; str < end; str++) @@ -1598,7 +1603,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), } else { - shift= dot - str; + shift= (int) (dot - str); for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++); } goto exp; diff --git a/strings/decimal.c b/strings/decimal.c index 40243b89539..bb7ce6dafc9 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -30,7 +30,7 @@ integer that determines the number of significant digits in a particular radix R, where R is either 2 or 10. S is a non-negative integer. Every value of an exact numeric type of scale S is of the - form n*10^{-S}, where n is an integer such that �-R^P <= n <= R^P. + form n*10^{-S}, where n is an integer such that -R^P <= n <= R^P. [...] @@ -255,7 +255,7 @@ void max_decimal(int precision, int frac, decimal_t *to) } -static dec1 *remove_leading_zeroes(decimal_t *from, int *intg_result) +static dec1 *remove_leading_zeroes(const decimal_t *from, int *intg_result) { int intg= from->intg, i; dec1 *buf0= from->buf; @@ -333,7 +333,7 @@ int decimal_actual_fraction(decimal_t *from) E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW */ -int decimal2string(decimal_t *from, char *to, int *to_len, +int decimal2string(const decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler) { @@ -950,7 +950,7 @@ fatal_error: E_DEC_OK */ -int decimal2double(decimal_t *from, double *to) +int decimal2double(const decimal_t *from, double *to) { double result= 0.0; int i, exp= 0; @@ -1042,7 +1042,7 @@ int longlong2decimal(longlong from, decimal_t *to) return ull2dec(from, to); } -int decimal2ulonglong(decimal_t *from, ulonglong *to) +int decimal2ulonglong(const decimal_t *from, ulonglong *to) { dec1 *buf=from->buf; ulonglong x=0; @@ -1071,7 +1071,7 @@ int decimal2ulonglong(decimal_t *from, ulonglong *to) return E_DEC_OK; } -int decimal2longlong(decimal_t *from, longlong *to) +int decimal2longlong(const decimal_t *from, longlong *to) { dec1 *buf=from->buf; longlong x=0; @@ -1188,9 +1188,9 @@ int decimal2longlong(decimal_t *from, longlong *to) And for -1234567890.1234 it would be - 7E F2 04 37 2D FB 2D + 7E F2 04 C7 2D FB 2D */ -int decimal2bin(decimal_t *from, uchar *to, int precision, int frac) +int decimal2bin(const decimal_t *from, uchar *to, int precision, int frac) { dec1 mask=from->sign ? -1 : 0, *buf1=from->buf, *stop1; int error=E_DEC_OK, intg=precision-frac, @@ -1463,7 +1463,9 @@ int decimal_bin_size(int precision, int scale) intg0=intg/DIG_PER_DEC1, frac0=scale/DIG_PER_DEC1, intg0x=intg-intg0*DIG_PER_DEC1, frac0x=scale-frac0*DIG_PER_DEC1; - DBUG_ASSERT(scale >= 0 && precision > 0 && scale <= precision); + DBUG_ASSERT(scale >= 0); + DBUG_ASSERT(precision > 0); + DBUG_ASSERT(scale <= precision); return intg0*sizeof(dec1)+dig2bytes[intg0x]+ frac0*sizeof(dec1)+dig2bytes[frac0x]; } @@ -1487,7 +1489,7 @@ int decimal_bin_size(int precision, int scale) */ int -decimal_round(decimal_t *from, decimal_t *to, int scale, +decimal_round(const decimal_t *from, decimal_t *to, int scale, decimal_round_mode mode) { int frac0=scale>0 ? ROUND_UP(scale) : scale/DIG_PER_DEC1, diff --git a/strings/strmov.c b/strings/strmov.c index 1a945ad2a6f..7a3f2d02dcf 100644 --- a/strings/strmov.c +++ b/strings/strmov.c @@ -34,10 +34,6 @@ into dst, which seems useful. */ -#include "strings_def.h" - -#ifndef strmov - #if !defined(MC68000) && !defined(DS90) char *strmov(register char *dst, register const char *src) @@ -60,5 +56,3 @@ char *strmov(dst, src) } #endif - -#endif /* strmov */ |