locale_facets.tcc (num_put::_M_convert_float): Extend comment, reduce __cs_size for non-fixed outputs.
2001-12-07 Paolo Carlini <pcarlini@unitus.it> * include/bits/locale_facets.tcc (num_put::_M_convert_float): Extend comment, reduce __cs_size for non-fixed outputs. From-SVN: r47767
This commit is contained in:
parent
9975c6d428
commit
46d360629c
@ -1,3 +1,8 @@
|
||||
2001-12-07 Paolo Carlini <pcarlini@unitus.it>
|
||||
|
||||
* include/bits/locale_facets.tcc (num_put::_M_convert_float):
|
||||
Extend comment, reduce __cs_size for non-fixed outputs.
|
||||
|
||||
2001-12-07 Paolo Carlini <pcarlini@unitus.it>
|
||||
|
||||
* include/bits/basic_string.tcc (_M_mutate): Fix typo
|
||||
|
@ -762,9 +762,13 @@ namespace std
|
||||
// Consider the possibility of long ios_base::fixed outputs
|
||||
const bool __fixed = __io.flags() & ios_base::fixed;
|
||||
const int __max_exp = numeric_limits<_ValueT>::max_exponent10;
|
||||
// XXX Why + 4? Why * 4? What's going on? Who's on first?
|
||||
// ios_base::fixed outputs may need up to __max_exp+1 chars
|
||||
// for the integer part + up to __max_digits chars for the
|
||||
// fractional part + 3 chars for sign, decimal point, '\0'. On
|
||||
// the other hand, for non-fixed outputs __max_digits*3 chars
|
||||
// are largely sufficient.
|
||||
const int __cs_size = __fixed ? __max_exp + __max_digits + 4
|
||||
: __max_digits * 4;
|
||||
: __max_digits * 3;
|
||||
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
|
||||
|
||||
int __len;
|
||||
|
Loading…
x
Reference in New Issue
Block a user