* 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.
This commit is contained in:
Corinna Vinschen
2013-06-10 15:27:43 +00:00
parent d7e4267f45
commit e9c0122ec0
6 changed files with 126 additions and 83 deletions

View File

@ -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)