diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-11-20 18:03:05 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-11-20 18:03:05 +0100 |
commit | 51bf1b81f3c4c7c02d8101f8ab6eb5609892e728 (patch) | |
tree | ebae89c9758e456413847d5de99de8444efb7c01 /newlib/libc/stdlib/gdtoa-hexnan.c | |
parent | b5d8a403eca4b15e4e5a9bc5dd6a85780e6e1d3f (diff) | |
download | cygnal-51bf1b81f3c4c7c02d8101f8ab6eb5609892e728.tar.gz cygnal-51bf1b81f3c4c7c02d8101f8ab6eb5609892e728.tar.bz2 cygnal-51bf1b81f3c4c7c02d8101f8ab6eb5609892e728.zip |
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>
Diffstat (limited to 'newlib/libc/stdlib/gdtoa-hexnan.c')
-rw-r--r-- | newlib/libc/stdlib/gdtoa-hexnan.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/newlib/libc/stdlib/gdtoa-hexnan.c b/newlib/libc/stdlib/gdtoa-hexnan.c index 463000528..24e3783be 100644 --- a/newlib/libc/stdlib/gdtoa-hexnan.c +++ b/newlib/libc/stdlib/gdtoa-hexnan.c @@ -44,6 +44,24 @@ THIS SOFTWARE. #include "gdtoa.h" #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 _DEFUN (L_shift, (x, x1, i), __ULong *x _AND |