diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/strfmon_l.c | 13 | ||||
-rw-r--r-- | stdlib/strtod_l.c | 3 | ||||
-rw-r--r-- | stdlib/tst-strtod.c | 6 |
3 files changed, 10 insertions, 12 deletions
diff --git a/stdlib/strfmon_l.c b/stdlib/strfmon_l.c index 8e63d459e3..eb7a17801a 100644 --- a/stdlib/strfmon_l.c +++ b/stdlib/strfmon_l.c @@ -90,9 +90,6 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, { struct locale_data *current = loc->__locales[LC_MONETARY]; _IO_strfile f; -#ifdef _IO_MTSAFE_IO - _IO_lock_t lock; -#endif struct printf_info info; char *dest; /* Pointer so copy the output. */ const char *fmt; /* Pointer that walks through format. */ @@ -517,11 +514,11 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, /* Print the number. */ #ifdef _IO_MTSAFE_IO - f._sbf._f._lock = &lock; + f._sbf._f._lock = NULL; #endif - INTUSE(_IO_init) ((_IO_FILE *) &f, 0); - _IO_JUMPS ((struct _IO_FILE_plus *) &f) = &_IO_str_jumps; - INTUSE(_IO_str_init_static) ((_IO_strfile *) &f, dest, + INTUSE(_IO_init) (&f._sbf._f, 0); + _IO_JUMPS (&f._sbf) = &_IO_str_jumps; + INTUSE(_IO_str_init_static) (&f, dest, (s + maxsize) - dest, dest); /* We clear the last available byte so we can find out whether the numeric representation is too long. */ @@ -537,7 +534,7 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, info.extra = 1; /* This means use values from LC_MONETARY. */ ptr = &fpnum; - done = __printf_fp ((FILE *) &f, &info, &ptr); + done = __printf_fp (&f._sbf._f, &info, &ptr); if (done < 0) return -1; diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c index 09a8f9bb3b..9ddfa3fa66 100644 --- a/stdlib/strtod_l.c +++ b/stdlib/strtod_l.c @@ -1,5 +1,5 @@ /* Convert string representing a number to float value, using given locale. - Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008 + Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -232,6 +232,7 @@ round_and_return (mp_limb_t *retval, int exponent, int negative, # define DENORM_EXP (MIN_EXP - 2) #endif exponent = DENORM_EXP; + __set_errno (ERANGE); } if ((round_limb & (((mp_limb_t) 1) << round_bit)) != 0 diff --git a/stdlib/tst-strtod.c b/stdlib/tst-strtod.c index 628e40ca39..c30eb1ee12 100644 --- a/stdlib/tst-strtod.c +++ b/stdlib/tst-strtod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,96,97,98,99,2000,2001,2003 Free Software Foundation, Inc. +/* Copyright (C) 1991,1996-2001,2003,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -61,10 +61,10 @@ static const struct ltest tests[] = { "0x00.0014p19", 160.0, '\0', 0 }, { "0x1p-1023", 1.11253692925360069154511635866620203210960799023116591527666e-308, - '\0', 0 }, + '\0', ERANGE }, { "0x0.8p-1022", 1.11253692925360069154511635866620203210960799023116591527666e-308, - '\0', 0 }, + '\0', ERANGE }, #if __GNUC_PREREQ(2,96) /* For older GCC release HUGE_VAL is not a constant. */ { "Inf", HUGE_VAL, '\0', 0 }, |