* sprintf.c, util.c (quorem, nrv_alloc, dtoa): enabled floating point

support.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-08-12 07:06:33 +00:00
parent e2159ba730
commit 076b6a226f
3 changed files with 12 additions and 6 deletions

View File

@ -1,3 +1,8 @@
Tue Aug 12 16:06:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sprintf.c, util.c (quorem, nrv_alloc, dtoa): enabled floating point
support.
Tue Aug 12 15:52:45 2008 Narihiro Nakamura <authorNari@gmail.com> Tue Aug 12 15:52:45 2008 Narihiro Nakamura <authorNari@gmail.com>
* gc.c (gc_profile_result): use sprintf. * gc.c (gc_profile_result): use sprintf.

View File

@ -1034,6 +1034,8 @@ fmt_setup(char *buf, int c, int flags, int width, int prec)
#endif #endif
#undef vsnprintf #undef vsnprintf
#undef snprintf #undef snprintf
#define FLOATING_POINT 1
#define BSD__dtoa dtoa
#include "missing/vsnprintf.c" #include "missing/vsnprintf.c"
static int static int

11
util.c
View File

@ -1235,9 +1235,14 @@ extern double rnd_prod(double, double), rnd_quot(double, double);
#endif #endif
#endif /* NO_LONG_LONG */ #endif /* NO_LONG_LONG */
#define MULTIPLE_THREADS 1
#ifndef MULTIPLE_THREADS #ifndef MULTIPLE_THREADS
#define ACQUIRE_DTOA_LOCK(n) /*nothing*/ #define ACQUIRE_DTOA_LOCK(n) /*nothing*/
#define FREE_DTOA_LOCK(n) /*nothing*/ #define FREE_DTOA_LOCK(n) /*nothing*/
#else
#define ACQUIRE_DTOA_LOCK(n) /*unused right now*/
#define FREE_DTOA_LOCK(n) /*unused right now*/
#endif #endif
#define Kmax 15 #define Kmax 15
@ -3069,7 +3074,6 @@ ret:
return sign ? -dval(rv) : dval(rv); return sign ? -dval(rv) : dval(rv);
} }
#if 0 /* unused right now */
static int static int
quorem(Bigint *b, Bigint *S) quorem(Bigint *b, Bigint *S)
{ {
@ -3180,13 +3184,11 @@ quorem(Bigint *b, Bigint *S)
} }
return q; return q;
} }
#endif
#ifndef MULTIPLE_THREADS #ifndef MULTIPLE_THREADS
static char *dtoa_result; static char *dtoa_result;
#endif #endif
#if 0 /* unused right now */
static char * static char *
rv_alloc(int i) rv_alloc(int i)
{ {
@ -3217,7 +3219,6 @@ nrv_alloc(const char *s, char **rve, int n)
*rve = t; *rve = t;
return rv; return rv;
} }
#endif
/* freedtoa(s) must be used to free values s returned by dtoa /* freedtoa(s) must be used to free values s returned by dtoa
* when MULTIPLE_THREADS is #defined. It should be used in all cases, * when MULTIPLE_THREADS is #defined. It should be used in all cases,
@ -3271,7 +3272,6 @@ freedtoa(char *s)
* calculation. * calculation.
*/ */
#if 0 /* unused right now */
char * char *
dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
{ {
@ -3941,7 +3941,6 @@ ret1:
*rve = s; *rve = s;
return s0; return s0;
} }
#endif
void void
ruby_each_words(const char *str, void (*func)(const char*, int, void*), void *arg) ruby_each_words(const char *str, void (*func)(const char*, int, void*), void *arg)