Commit ed2807f4 by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/39835 (Bootstrap failure:…

re PR libstdc++/39835 (Bootstrap failure: libstdc++-v3/include/bits/random.h:3630: error: expected â,â or â...â before numeric constant)

2009-04-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/39835
	* include/bits/random.h: Avoid the badname __alpha (and, for
	consistency, __beta too).
	* include/bits/random.tcc: Likewise.

From-SVN: r146516
parent 2970ccb3
2009-04-21 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/39835
* include/bits/random.h: Avoid the badname __alpha (and, for
consistency, __beta too).
* include/bits/random.tcc: Likewise.
2009-04-19 Jan Hubicka <jh@suse.cz> 2009-04-19 Jan Hubicka <jh@suse.cz>
* include/c_compatibility/stdatomic.h (__atomic_flag_for_address): Use * include/c_compatibility/stdatomic.h (__atomic_flag_for_address): Use
......
...@@ -3627,9 +3627,9 @@ namespace std ...@@ -3627,9 +3627,9 @@ namespace std
friend class gamma_distribution<_RealType>; friend class gamma_distribution<_RealType>;
explicit explicit
param_type(_RealType __alpha = _RealType(1), param_type(_RealType __alpha_val = _RealType(1),
_RealType __beta = _RealType(1)) _RealType __beta_val = _RealType(1))
: _M_alpha(__alpha), _M_beta(__beta) : _M_alpha(__alpha_val), _M_beta(__beta_val)
{ {
_GLIBCXX_DEBUG_ASSERT(_M_alpha > _RealType(0)); _GLIBCXX_DEBUG_ASSERT(_M_alpha > _RealType(0));
_M_initialize(); _M_initialize();
...@@ -3660,9 +3660,9 @@ namespace std ...@@ -3660,9 +3660,9 @@ namespace std
* @f$ \alpha @f$ and @f$ \beta @f$. * @f$ \alpha @f$ and @f$ \beta @f$.
*/ */
explicit explicit
gamma_distribution(_RealType __alpha = _RealType(1), gamma_distribution(_RealType __alpha_val = _RealType(1),
_RealType __beta = _RealType(1)) _RealType __beta_val = _RealType(1))
: _M_param(__alpha, __beta) : _M_param(__alpha_val, __beta_val)
{ } { }
explicit explicit
......
...@@ -1921,14 +1921,14 @@ namespace std ...@@ -1921,14 +1921,14 @@ namespace std
__aurng(__urng); __aurng(__urng);
bool __reject; bool __reject;
const _RealType __alpha = __param.alpha(); const _RealType __alpha_val = __param.alpha();
const _RealType __beta = __param.beta(); const _RealType __beta_val = __param.beta();
if (__alpha >= 1) if (__alpha_val >= 1)
{ {
// alpha - log(4) // alpha - log(4)
const result_type __b = __alpha const result_type __b = __alpha_val
- result_type(1.3862943611198906188344642429163531L); - result_type(1.3862943611198906188344642429163531L);
const result_type __c = __alpha + __param._M_l_d; const result_type __c = __alpha_val + __param._M_l_d;
const result_type __1l = 1 / __param._M_l_d; const result_type __1l = 1 / __param._M_l_d;
// 1 + log(9 / 2) // 1 + log(9 / 2)
...@@ -1936,11 +1936,11 @@ namespace std ...@@ -1936,11 +1936,11 @@ namespace std
do do
{ {
const result_type __u = __aurng() / __beta; const result_type __u = __aurng() / __beta_val;
const result_type __v = __aurng() / __beta; const result_type __v = __aurng() / __beta_val;
const result_type __y = __1l * std::log(__v / (1 - __v)); const result_type __y = __1l * std::log(__v / (1 - __v));
__x = __alpha * std::exp(__y); __x = __alpha_val * std::exp(__y);
const result_type __z = __u * __v * __v; const result_type __z = __u * __v * __v;
const result_type __r = __b + __c * __y - __x; const result_type __r = __b + __c * __y - __x;
...@@ -1953,12 +1953,12 @@ namespace std ...@@ -1953,12 +1953,12 @@ namespace std
} }
else else
{ {
const result_type __c = 1 / __alpha; const result_type __c = 1 / __alpha_val;
do do
{ {
const result_type __z = -std::log(__aurng() / __beta); const result_type __z = -std::log(__aurng() / __beta_val);
const result_type __e = -std::log(__aurng() / __beta); const result_type __e = -std::log(__aurng() / __beta_val);
__x = std::pow(__z, __c); __x = std::pow(__z, __c);
...@@ -1967,7 +1967,7 @@ namespace std ...@@ -1967,7 +1967,7 @@ namespace std
while (__reject); while (__reject);
} }
return __beta * __x; return __beta_val * __x;
} }
template<typename _RealType, typename _CharT, typename _Traits> template<typename _RealType, typename _CharT, typename _Traits>
...@@ -2005,10 +2005,10 @@ namespace std ...@@ -2005,10 +2005,10 @@ namespace std
const typename __ios_base::fmtflags __flags = __is.flags(); const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec | __ios_base::skipws); __is.flags(__ios_base::dec | __ios_base::skipws);
_RealType __alpha, __beta; _RealType __alpha_val, __beta_val;
__is >> __alpha >> __beta; __is >> __alpha_val >> __beta_val;
__x.param(typename gamma_distribution<_RealType>:: __x.param(typename gamma_distribution<_RealType>::
param_type(__alpha, __beta)); param_type(__alpha_val, __beta_val));
__is.flags(__flags); __is.flags(__flags);
return __is; return __is;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment