Make match function globally available to stdlib functions.
* libc/stdlib/strtod.c (match): Move from here... * libc/stdlib/gdtoa-hexnan.c (match): ...to here. * libc/stdlib/mprec.h (match): Declare and add __match define. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
b5d8a403ec
commit
51bf1b81f3
|
@ -1,3 +1,9 @@
|
||||||
|
2015-11-20 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* libc/stdlib/strtod.c (match): Move from here...
|
||||||
|
* libc/stdlib/gdtoa-hexnan.c (match): ...to here.
|
||||||
|
* libc/stdlib/mprec.h (match): Declare and add __match define.
|
||||||
|
|
||||||
2015-11-20 Corinna Vinschen <corinna@vinschen.de>
|
2015-11-20 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* libc/stdlib/wcstold.c (_strtold): Drop unused declaration.
|
* libc/stdlib/wcstold.c (_strtold): Drop unused declaration.
|
||||||
|
|
|
@ -44,6 +44,24 @@ THIS SOFTWARE.
|
||||||
#include "gdtoa.h"
|
#include "gdtoa.h"
|
||||||
|
|
||||||
#ifdef INFNAN_CHECK
|
#ifdef INFNAN_CHECK
|
||||||
|
int
|
||||||
|
_DEFUN (match, (sp, t),
|
||||||
|
_CONST char **sp _AND
|
||||||
|
char *t)
|
||||||
|
{
|
||||||
|
int c, d;
|
||||||
|
_CONST char *s = *sp;
|
||||||
|
|
||||||
|
while( (d = *t++) !=0) {
|
||||||
|
if ((c = *++s) >= 'A' && c <= 'Z')
|
||||||
|
c += 'a' - 'A';
|
||||||
|
if (c != d)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*sp = s + 1;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_DEFUN (L_shift, (x, x1, i),
|
_DEFUN (L_shift, (x, x1, i),
|
||||||
__ULong *x _AND
|
__ULong *x _AND
|
||||||
|
|
|
@ -360,6 +360,7 @@ typedef struct _Bigint _Bigint;
|
||||||
#define mult __multiply
|
#define mult __multiply
|
||||||
#define pow5mult __pow5mult
|
#define pow5mult __pow5mult
|
||||||
#define lshift __lshift
|
#define lshift __lshift
|
||||||
|
#define match __match
|
||||||
#define cmp __mcmp
|
#define cmp __mcmp
|
||||||
#define diff __mdiff
|
#define diff __mdiff
|
||||||
#define ulp __ulp
|
#define ulp __ulp
|
||||||
|
@ -396,6 +397,7 @@ int _EXFUN(hi0bits,(__ULong));
|
||||||
int _EXFUN(lo0bits,(__ULong *));
|
int _EXFUN(lo0bits,(__ULong *));
|
||||||
_Bigint * _EXFUN(d2b,(struct _reent *p, double d, int *e, int *bits));
|
_Bigint * _EXFUN(d2b,(struct _reent *p, double d, int *e, int *bits));
|
||||||
_Bigint * _EXFUN(lshift,(struct _reent *p, _Bigint *b, int k));
|
_Bigint * _EXFUN(lshift,(struct _reent *p, _Bigint *b, int k));
|
||||||
|
int _EXFUN(match,(const char**, char*));
|
||||||
_Bigint * _EXFUN(diff,(struct _reent *p, _Bigint *a, _Bigint *b));
|
_Bigint * _EXFUN(diff,(struct _reent *p, _Bigint *a, _Bigint *b));
|
||||||
int _EXFUN(cmp,(_Bigint *a, _Bigint *b));
|
int _EXFUN(cmp,(_Bigint *a, _Bigint *b));
|
||||||
int _EXFUN(gethex,(struct _reent *p, _CONST char **sp, _CONST struct FPI *fpi, Long *exp, _Bigint **bp, int sign));
|
int _EXFUN(gethex,(struct _reent *p, _CONST char **sp, _CONST struct FPI *fpi, Long *exp, _Bigint **bp, int sign));
|
||||||
|
|
|
@ -212,27 +212,6 @@ _DEFUN (ULtod, (L, bits, exp, k),
|
||||||
}
|
}
|
||||||
#endif /* !NO_HEX_FP */
|
#endif /* !NO_HEX_FP */
|
||||||
|
|
||||||
#ifdef INFNAN_CHECK
|
|
||||||
static int
|
|
||||||
_DEFUN (match, (sp, t),
|
|
||||||
_CONST char **sp _AND
|
|
||||||
char *t)
|
|
||||||
{
|
|
||||||
int c, d;
|
|
||||||
_CONST char *s = *sp;
|
|
||||||
|
|
||||||
while( (d = *t++) !=0) {
|
|
||||||
if ((c = *++s) >= 'A' && c <= 'Z')
|
|
||||||
c += 'a' - 'A';
|
|
||||||
if (c != d)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*sp = s + 1;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#endif /* INFNAN_CHECK */
|
|
||||||
|
|
||||||
|
|
||||||
double
|
double
|
||||||
_DEFUN (_strtod_r, (ptr, s00, se),
|
_DEFUN (_strtod_r, (ptr, s00, se),
|
||||||
struct _reent *ptr _AND
|
struct _reent *ptr _AND
|
||||||
|
|
Loading…
Reference in New Issue