gnu/154385: Minor fixes to contrib/libstdc++
Pedro Giffuni
giffunip at tutopia.com
Sun Jan 30 00:40:04 UTC 2011
>Number: 154385
>Category: gnu
>Synopsis: Minor fixes to contrib/libstdc++
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Jan 30 00:40:04 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Pedro Giffuni
>Release: 8.1-Release
>Organization:
>Environment:
FreeBSD mogwai.giffuni.net 8.1-RELEASE FreeBSD 8.1-RELEASE #1: Sat Jul 17 14:19:59 PDT 2010 root at build8x64.pcbsd.org:/usr/obj/usr/pcbsd-build81/fbsd-source/8.1/sys/PCBSD amd64
[
>Description:
Fix a couple of libstdc++ issues committed to the FSF tree before the GPLv3 switch:
PR libstdc++/33128
* include/tr1_impl/random (uniform_int<>::_M_call): Deal with
__urng() returning negative values.
PR libstdc++/33084
* include/std/valarray (operator _Op(const _Tp&,
const valarray<>&)): Fix typo.
>How-To-Repeat:
>Fix:
Patch attached.
Patch attached with submission follows:
--- libstdc++/include/tr1/random 2007/04/07 08:38:39 123637
+++ libstdc++/include/tr1/random 2007/08/28 08:48:54 127850
@@ -1618,7 +1618,11 @@
result_type
_M_call(_UniformRandomNumberGenerator& __urng,
result_type __min, result_type __max, true_type)
- { return result_type(__urng() % (__max - __min + 1)) + __min; }
+ {
+ typedef typename __gnu_cxx::__add_unsigned<typename
+ _UniformRandomNumberGenerator::result_type>::__type __utype;
+ return result_type(__utype(__urng()) % (__max - __min + 1)) + __min;
+ }
template<typename _UniformRandomNumberGenerator>
result_type
--- libstdc++/include/std/std_valarray.h 2007/01/15 16:45:44 120799
+++ libstdc++/include/std/std_valarray.h 2007/08/17 09:28:09 127580
@@ -1010,7 +1010,7 @@
{ \
typedef _BinClos<_Name, _Constant, _ValArray, _Tp, _Tp> _Closure; \
typedef typename __fun<_Name, _Tp>::result_type _Rt; \
- return _Expr<_Closure, _Tp>(_Closure(__t, __v)); \
+ return _Expr<_Closure, _Rt>(_Closure(__t, __v)); \
}
_DEFINE_BINARY_OPERATOR(+, __plus)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list