diff options
Diffstat (limited to 'newlib/libc/stdlib/mprec.h')
-rw-r--r-- | newlib/libc/stdlib/mprec.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h index 5a71576..d4732ca 100644 --- a/newlib/libc/stdlib/mprec.h +++ b/newlib/libc/stdlib/mprec.h @@ -370,9 +370,12 @@ typedef struct _Bigint _Bigint; #define gethex __gethex #define copybits __copybits #define hexnan __hexnan -#define hexdig_init __hexdig_init -#define hexdig __hexdig +#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) +#define __get_hexdig(x) __hexdig[x] /* NOTE: must evaluate arg only once */ +#else /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */ +#define __get_hexdig(x) __hexdig_fun(x) +#endif /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */ #define tens __mprec_tens #define bigtens __mprec_bigtens @@ -395,13 +398,15 @@ _Bigint * _EXFUN(d2b,(struct _reent *p, double d, int *e, int *bits)); _Bigint * _EXFUN(lshift,(struct _reent *p, _Bigint *b, int k)); _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, struct FPI *fpi, Long *exp, _Bigint **bp, int sign)); +int _EXFUN(gethex,(struct _reent *p, _CONST char **sp, _CONST struct FPI *fpi, Long *exp, _Bigint **bp, int sign)); double _EXFUN(ratio,(_Bigint *a, _Bigint *b)); __ULong _EXFUN(any_on,(_Bigint *b, int k)); void _EXFUN(copybits,(__ULong *c, int n, _Bigint *b)); -void _EXFUN(hexdig_init,(void)); +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) || defined(_SMALL_HEXDIG) +unsigned char _EXFUN(__hexdig_fun,(unsigned char)); +#endif /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */ #ifdef INFNAN_CHECK -int _EXFUN(hexnan,(_CONST char **sp, struct FPI *fpi, __ULong *x0)); +int _EXFUN(hexnan,(_CONST char **sp, _CONST struct FPI *fpi, __ULong *x0)); #endif #define Bcopy(x,y) memcpy((char *)&x->_sign, (char *)&y->_sign, y->_wds*sizeof(__Long) + 2*sizeof(int)) @@ -409,7 +414,9 @@ int _EXFUN(hexnan,(_CONST char **sp, struct FPI *fpi, __ULong *x0)); extern _CONST double tinytens[]; extern _CONST double bigtens[]; extern _CONST double tens[]; -extern unsigned char hexdig[]; +#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) +extern _CONST unsigned char __hexdig[]; +#endif /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */ double _EXFUN(_mprec_log10,(int)); |