From e9c0122ec043e57f6c23577474c7afb1f8cad79b Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 10 Jun 2013 15:27:43 +0000 Subject: * 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. --- newlib/libc/stdlib/gdtoa-hexnan.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'newlib/libc/stdlib/gdtoa-hexnan.c') 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) -- cgit v1.2.3