mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merge
strings/ctype-utf8.c: Auto merged strings/ctype-simple.c: merge Change '#if 0' to '#ifdef NOT_USED'
This commit is contained in:
@ -214,7 +214,8 @@ long my_strntol_8bit(CHARSET_INFO *cs,
|
||||
const char *save, *e;
|
||||
int overflow;
|
||||
|
||||
#if 0
|
||||
*err= 0; /* Initialize error indicator */
|
||||
#ifdef NOT_USED
|
||||
if (base < 0 || base == 1 || base > 36)
|
||||
base = 10;
|
||||
#endif
|
||||
@ -243,12 +244,12 @@ long my_strntol_8bit(CHARSET_INFO *cs,
|
||||
else
|
||||
negative = 0;
|
||||
|
||||
#if 0
|
||||
#ifdef NOT_USED
|
||||
if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
|
||||
s += 2;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#ifdef NOT_USED
|
||||
if (base == 0)
|
||||
{
|
||||
if (*s == '0')
|
||||
@ -336,7 +337,8 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
|
||||
const char *save, *e;
|
||||
int overflow;
|
||||
|
||||
#if 0
|
||||
*err= 0; /* Initialize error indicator */
|
||||
#ifdef NOT_USED
|
||||
if (base < 0 || base == 1 || base > 36)
|
||||
base = 10;
|
||||
#endif
|
||||
@ -364,12 +366,12 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
|
||||
else
|
||||
negative = 0;
|
||||
|
||||
#if 0
|
||||
#ifdef NOT_USED
|
||||
if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
|
||||
s += 2;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#ifdef NOT_USED
|
||||
if (base == 0)
|
||||
{
|
||||
if (*s == '0')
|
||||
@ -449,7 +451,8 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const char *save;
|
||||
int overflow;
|
||||
|
||||
#if 0
|
||||
*err= 0; /* Initialize error indicator */
|
||||
#ifdef NOT_USED
|
||||
if (base < 0 || base == 1 || base > 36)
|
||||
base = 10;
|
||||
#endif
|
||||
@ -477,12 +480,12 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||
else
|
||||
negative = 0;
|
||||
|
||||
#if 0
|
||||
#ifdef NOT_USED
|
||||
if (base == 16 && s[0] == '0' && (s[1]=='X'|| s[1]=='x'))
|
||||
s += 2;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#ifdef NOT_USED
|
||||
if (base == 0)
|
||||
{
|
||||
if (*s == '0')
|
||||
@ -571,7 +574,8 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
|
||||
const char *save;
|
||||
int overflow;
|
||||
|
||||
#if 0
|
||||
*err= 0; /* Initialize error indicator */
|
||||
#ifdef NOT_USED
|
||||
if (base < 0 || base == 1 || base > 36)
|
||||
base = 10;
|
||||
#endif
|
||||
@ -599,12 +603,12 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
|
||||
else
|
||||
negative = 0;
|
||||
|
||||
#if 0
|
||||
#ifdef NOT_USED
|
||||
if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
|
||||
s += 2;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#ifdef NOT_USED
|
||||
if (base == 0)
|
||||
{
|
||||
if (*s == '0')
|
||||
@ -679,7 +683,8 @@ noconv:
|
||||
cs Character set information
|
||||
str String to convert to double
|
||||
length Optional length for string.
|
||||
end pointer to end of converted string
|
||||
end result pointer to end of converted string
|
||||
err Error number if failed conversion
|
||||
|
||||
NOTES:
|
||||
If length is not INT_MAX32 or str[length] != 0 then the given str must
|
||||
@ -689,23 +694,28 @@ noconv:
|
||||
It's implemented this way to save a buffer allocation and a memory copy.
|
||||
|
||||
RETURN
|
||||
value of number in string
|
||||
Value of number in string
|
||||
*/
|
||||
|
||||
|
||||
double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||
char *str, uint length,
|
||||
char **end, int *err __attribute__ ((unused)))
|
||||
char **end, int *err)
|
||||
{
|
||||
char end_char;
|
||||
double result;
|
||||
|
||||
errno= 0; /* Safety */
|
||||
if (length == INT_MAX32 || str[length] == 0)
|
||||
return strtod(str, end);
|
||||
end_char= str[length];
|
||||
str[length]= 0;
|
||||
result= strtod(str, end);
|
||||
str[length]= end_char; /* Restore end char */
|
||||
result= strtod(str, end);
|
||||
else
|
||||
{
|
||||
end_char= str[length];
|
||||
str[length]= 0;
|
||||
result= strtod(str, end);
|
||||
str[length]= end_char; /* Restore end char */
|
||||
}
|
||||
*err= errno;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -2464,7 +2464,9 @@ long my_strntol_ucs2(CHARSET_INFO *cs,
|
||||
register const char *e=nptr+l;
|
||||
const char *save;
|
||||
|
||||
do {
|
||||
*err= 0;
|
||||
do
|
||||
{
|
||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
||||
{
|
||||
switch (wc)
|
||||
@ -2577,7 +2579,9 @@ ulong my_strntoul_ucs2(CHARSET_INFO *cs,
|
||||
register const char *e=nptr+l;
|
||||
const char *save;
|
||||
|
||||
do {
|
||||
*err= 0;
|
||||
do
|
||||
{
|
||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
||||
{
|
||||
switch (wc)
|
||||
@ -2684,7 +2688,9 @@ longlong my_strntoll_ucs2(CHARSET_INFO *cs,
|
||||
register const char *e=nptr+l;
|
||||
const char *save;
|
||||
|
||||
do {
|
||||
*err= 0;
|
||||
do
|
||||
{
|
||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
||||
{
|
||||
switch (wc)
|
||||
@ -2799,7 +2805,9 @@ ulonglong my_strntoull_ucs2(CHARSET_INFO *cs,
|
||||
register const char *e=nptr+l;
|
||||
const char *save;
|
||||
|
||||
do {
|
||||
*err= 0;
|
||||
do
|
||||
{
|
||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
||||
{
|
||||
switch (wc)
|
||||
@ -2834,7 +2842,8 @@ bs:
|
||||
cutoff = (~(ulonglong) 0) / (unsigned long int) base;
|
||||
cutlim = (uint) ((~(ulonglong) 0) % (unsigned long int) base);
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
||||
{
|
||||
s+=cnv;
|
||||
@ -2891,7 +2900,7 @@ bs:
|
||||
|
||||
double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
||||
char *nptr, uint length,
|
||||
char **endptr, int *err __attribute__ ((unused)))
|
||||
char **endptr, int *err)
|
||||
{
|
||||
char buf[256];
|
||||
double res;
|
||||
@ -2900,7 +2909,8 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
||||
register const char *end;
|
||||
my_wc_t wc;
|
||||
int cnv;
|
||||
|
||||
|
||||
*err= 0;
|
||||
/* Cut too long strings */
|
||||
if (length >= sizeof(buf))
|
||||
length= sizeof(buf)-1;
|
||||
@ -2915,7 +2925,9 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
||||
}
|
||||
*b= 0;
|
||||
|
||||
errno= 0;
|
||||
res=strtod(buf, endptr);
|
||||
*err= errno;
|
||||
if (endptr)
|
||||
*endptr=(char*) (*endptr-buf+nptr);
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user