From fb4dae84aa1100aad44b8e98d1b18257842e721f Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Sun, 29 May 2005 08:19:36 +0000 Subject: [PATCH] - Added a couple of (float) casts. - Fixed isblank() to compile properly. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14957 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/ctype_isblank.c | 4 ++-- library/math_nextafterf.c | 12 ++++++------ library/stdio_vfprintf.c | 10 +++++----- library/stdio_vfscanf.c | 6 +++--- library/stdlib_strtod.c | 6 +++--- library/stdlib_strtof.c | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/library/ctype_isblank.c b/library/ctype_isblank.c index f445631..e23c104 100644 --- a/library/ctype_isblank.c +++ b/library/ctype_isblank.c @@ -1,5 +1,5 @@ /* - * $Id: ctype_isblank.c,v 1.1 2005-05-11 20:15:25 obarthel Exp $ + * $Id: ctype_isblank.c,v 1.2 2005-05-29 08:19:36 obarthel Exp $ * * :ts=4 * @@ -37,7 +37,7 @@ /****************************************************************************/ -#undef isspace +#undef isblank /****************************************************************************/ diff --git a/library/math_nextafterf.c b/library/math_nextafterf.c index c5abc23..d4854d4 100644 --- a/library/math_nextafterf.c +++ b/library/math_nextafterf.c @@ -1,5 +1,5 @@ /* - * $Id: math_nextafterf.c,v 1.1 2005-05-12 13:21:43 obarthel Exp $ + * $Id: math_nextafterf.c,v 1.2 2005-05-29 08:19:36 obarthel Exp $ * * :ts=4 * @@ -62,15 +62,15 @@ nextafterf(float x, float y) ix = hx&0x7fffffff; /* |x| */ iy = hy&0x7fffffff; /* |y| */ - if((ix>0x7f800000) || /* x is nan */ - (iy>0x7f800000)) /* y is nan */ - return x+y; + if((ix>0x7f800000) || /* x is nan */ + (iy>0x7f800000)) /* y is nan */ + return (float)(x+y); if(x==y) return x; /* x=y, return x */ if(ix==0) { /* x == 0 */ SET_FLOAT_WORD(x,(hy&0x80000000U)|1);/* return +-minsubnormal */ y = x*x; if(y==x) return y; else return x; /* raise underflow flag */ - } + } if(hx>=0) { /* x > 0 */ if(hx>hy) { /* x > y, x -= ulp */ hx -= 1; @@ -85,7 +85,7 @@ nextafterf(float x, float y) } } hy = hx&0x7f800000; - if(hy>=0x7f800000) return x+x; /* overflow */ + if(hy>=0x7f800000) return (float)(x+x); /* overflow */ if(hy<0x00800000) { /* underflow */ y = x*x; if(y!=x) { /* raise underflow flag */ diff --git a/library/stdio_vfprintf.c b/library/stdio_vfprintf.c index 6f00b66..7145fb7 100644 --- a/library/stdio_vfprintf.c +++ b/library/stdio_vfprintf.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_vfprintf.c,v 1.17 2005-05-12 14:42:32 obarthel Exp $ + * $Id: stdio_vfprintf.c,v 1.18 2005-05-29 08:19:36 obarthel Exp $ * * :ts=4 * @@ -89,7 +89,7 @@ get_num_leading_digits(__long_double_t v,int radix) /* For some reason log() can crash on GCC 68k... */ #if (!defined(__GNUC__) || defined(__PPC__)) { - num_digits = 1 + floor(log(v) / log(radix)); + num_digits = 1 + floor(log(v) / log((double)radix)); } #else { @@ -866,11 +866,11 @@ vfprintf(FILE * stream,const char * format, va_list arg) roundoff_position = max_digits; if(roundoff_position >= 0) - roundoff_fudge = pow(radix,(double)(roundoff_position + 1)); + roundoff_fudge = pow((double)radix,(double)(roundoff_position + 1)); } else { - roundoff_fudge = pow(radix,(double)(precision + 1)); + roundoff_fudge = pow((double)radix,(double)(precision + 1)); } if(roundoff_fudge > 0.0) @@ -936,7 +936,7 @@ vfprintf(FILE * stream,const char * format, va_list arg) simply scale the value without any loss of precision (we just change the floating point exponent). */ - v /= pow(radix,(double)num_leading_digits); + v /= pow((double)radix,(double)num_leading_digits); for(i = 0 ; (max_digits != 0) && (i < num_leading_digits) && (output_buffer < buffer_stop) ; i++) { diff --git a/library/stdio_vfscanf.c b/library/stdio_vfscanf.c index a47f393..08470e6 100644 --- a/library/stdio_vfscanf.c +++ b/library/stdio_vfscanf.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_vfscanf.c,v 1.15 2005-05-14 10:52:31 obarthel Exp $ + * $Id: stdio_vfscanf.c,v 1.16 2005-05-29 08:19:36 obarthel Exp $ * * :ts=4 * @@ -1107,14 +1107,14 @@ vfscanf(FILE *stream, const char *format, va_list arg) double divisor; /* A negative exponent means division. */ - divisor = pow(radix,(double)exponent); + divisor = pow((double)radix,(double)exponent); if(divisor != 0.0) sum = sum / divisor; } else { /* A positive exponent means multiplication. */ - new_sum = sum * pow(radix,(double)exponent); + new_sum = sum * pow((double)radix,(double)exponent); if(new_sum >= sum) sum = new_sum; else diff --git a/library/stdlib_strtod.c b/library/stdlib_strtod.c index a8bc413..750e584 100644 --- a/library/stdlib_strtod.c +++ b/library/stdlib_strtod.c @@ -1,5 +1,5 @@ /* - * $Id: stdlib_strtod.c,v 1.7 2005-05-14 10:52:31 obarthel Exp $ + * $Id: stdlib_strtod.c,v 1.8 2005-05-29 08:19:36 obarthel Exp $ * * :ts=4 * @@ -326,7 +326,7 @@ strtod(const char *str, char ** ptr) double divisor; /* A negative exponent means division. */ - divisor = pow(radix,(double)exponent); + divisor = pow((double)radix,(double)exponent); if(divisor != 0.0) { new_sum = sum / divisor; @@ -343,7 +343,7 @@ strtod(const char *str, char ** ptr) else { /* A positive exponent means multiplication. */ - new_sum = sum * pow(radix,(double)exponent); + new_sum = sum * pow((double)radix,(double)exponent); if(new_sum < sum) error = ERANGE; else diff --git a/library/stdlib_strtof.c b/library/stdlib_strtof.c index 11260c1..6b96010 100644 --- a/library/stdlib_strtof.c +++ b/library/stdlib_strtof.c @@ -1,5 +1,5 @@ /* - * $Id: stdlib_strtof.c,v 1.5 2005-05-14 10:52:31 obarthel Exp $ + * $Id: stdlib_strtof.c,v 1.6 2005-05-29 08:19:36 obarthel Exp $ * * :ts=4 * @@ -326,7 +326,7 @@ strtof(const char *str, char ** ptr) float divisor; /* A negative exponent means division. */ - divisor = pow(radix,(float)exponent); + divisor = pow((double)radix,(float)exponent); if(divisor != 0.0) { new_sum = sum / divisor; @@ -343,7 +343,7 @@ strtof(const char *str, char ** ptr) else { /* A positive exponent means multiplication. */ - new_sum = sum * pow(radix,(float)exponent); + new_sum = sum * pow((double)radix,(float)exponent); if(new_sum < sum) error = ERANGE; else