public inbox for newlib-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Make match function globally available to stdlib functions. Date: Fri, 20 Nov 2015 17:15:00 -0000 [thread overview] Message-ID: <20151120171533.75711.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=51bf1b81f3c4c7c02d8101f8ab6eb5609892e728 commit 51bf1b81f3c4c7c02d8101f8ab6eb5609892e728 Author: Corinna Vinschen <corinna@vinschen.de> Date: Fri Nov 20 18:03:05 2015 +0100 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> Diff: --- newlib/ChangeLog | 6 ++++++ newlib/libc/stdlib/gdtoa-hexnan.c | 18 ++++++++++++++++++ newlib/libc/stdlib/mprec.h | 2 ++ newlib/libc/stdlib/strtod.c | 21 --------------------- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index d37a378..27e19a1 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,5 +1,11 @@ 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> + * libc/stdlib/wcstold.c (_strtold): Drop unused declaration. 2015-11-19 Yaakov Selkowitz <yselkowi@redhat.com> diff --git a/newlib/libc/stdlib/gdtoa-hexnan.c b/newlib/libc/stdlib/gdtoa-hexnan.c index 4630005..24e3783 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 diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h index d4732ca..8472e7d 100644 --- a/newlib/libc/stdlib/mprec.h +++ b/newlib/libc/stdlib/mprec.h @@ -360,6 +360,7 @@ typedef struct _Bigint _Bigint; #define mult __multiply #define pow5mult __pow5mult #define lshift __lshift +#define match __match #define cmp __mcmp #define diff __mdiff #define ulp __ulp @@ -396,6 +397,7 @@ int _EXFUN(hi0bits,(__ULong)); int _EXFUN(lo0bits,(__ULong *)); _Bigint * _EXFUN(d2b,(struct _reent *p, double d, int *e, int *bits)); _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)); 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)); diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c index 9b064f4..433dc7f 100644 --- a/newlib/libc/stdlib/strtod.c +++ b/newlib/libc/stdlib/strtod.c @@ -212,27 +212,6 @@ _DEFUN (ULtod, (L, bits, exp, k), } #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 _DEFUN (_strtod_r, (ptr, s00, se), struct _reent *ptr _AND
reply other threads:[~2015-11-20 17:15 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20151120171533.75711.qmail@sourceware.org \ --to=corinna@sourceware.org \ --cc=newlib-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).