summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdlib/gdtoa-hexnan.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-06-10 15:27:43 +0000
committerCorinna Vinschen <corinna@vinschen.de>2013-06-10 15:27:43 +0000
commite9c0122ec043e57f6c23577474c7afb1f8cad79b (patch)
treeb9c99dd0f525fe9344c07dc117953816217100a1 /newlib/libc/stdlib/gdtoa-hexnan.c
parentd7e4267f4531815b7fc60d89ee049ae14b0d7cf7 (diff)
downloadcygnal-e9c0122ec043e57f6c23577474c7afb1f8cad79b.tar.gz
cygnal-e9c0122ec043e57f6c23577474c7afb1f8cad79b.tar.bz2
cygnal-e9c0122ec043e57f6c23577474c7afb1f8cad79b.zip
* libc/stdlib/gdtoa-gethex.c (__hexdig): Constify.
(hexdig_init): Remove. (__hexdig_fun): New function. hexdig_init, added __hexdig_fun (gethex): Call __get_hexdig macro rather than hexdig. * libc/stdlib/gdtoa-hexnan.c (hexnan): Constify fpi argument. Call __get_hexdig macro rather than hexdig. * libc/stdlib/ldtoa.c: Throughout constify functions arguments where required by constifying the following arrays. (ezero): Constify. (eone): Constify. (ermsg): Constify. (etens): Constify. (emtens): Constify. (nan113): Constify. (nan64): Constify. (nan53): Constify. (nan24): Constify. * libc/stdlib/mprec.h (__get_hexdig): Define. (gethex): Constify args in declaration where appropriate. (hexnan): Ditto. (hexdig_init): Remove declaration. (__hexdig_fun): Declare. * libc/stdlib/strtod.c (fpi): Constify. (fpinan): Constify.
Diffstat (limited to 'newlib/libc/stdlib/gdtoa-hexnan.c')
-rw-r--r--newlib/libc/stdlib/gdtoa-hexnan.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/newlib/libc/stdlib/gdtoa-hexnan.c b/newlib/libc/stdlib/gdtoa-hexnan.c
index 189fb238d..463000528 100644
--- a/newlib/libc/stdlib/gdtoa-hexnan.c
+++ b/newlib/libc/stdlib/gdtoa-hexnan.c
@@ -64,15 +64,13 @@ _DEFUN (L_shift, (x, x1, i),
int
_DEFUN (hexnan, (sp, fpi, x0),
_CONST char **sp _AND
- FPI *fpi _AND
+ _CONST FPI *fpi _AND
__ULong *x0)
{
__ULong c, h, *x, *x1, *xe;
_CONST char *s;
int havedig, hd0, i, nbits;
- if (!hexdig['0'])
- hexdig_init();
nbits = fpi->nbits;
x = x0 + (nbits >> kshift);
if (nbits & kmask)
@@ -82,7 +80,7 @@ _DEFUN (hexnan, (sp, fpi, x0),
havedig = hd0 = i = 0;
s = *sp;
while((c = *(_CONST unsigned char*)++s)) {
- if (!(h = hexdig[c])) {
+ if (!(h = __get_hexdig(c))) {
if (c <= ' ') {
if (hd0 < havedig) {
if (x < x1 && i < 8)