From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 30 00:40:04 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0D09106566B for ; Sun, 30 Jan 2011 00:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5F44F8FC12 for ; Sun, 30 Jan 2011 00:40:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p0U0e4JV011117 for ; Sun, 30 Jan 2011 00:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p0U0e4Ld011116; Sun, 30 Jan 2011 00:40:04 GMT (envelope-from gnats) Resent-Date: Sun, 30 Jan 2011 00:40:04 GMT Resent-Message-Id: <201101300040.p0U0e4Ld011116@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Pedro Giffuni Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 193CA106566B for ; Sun, 30 Jan 2011 00:39:37 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 0A40C8FC08 for ; Sun, 30 Jan 2011 00:39:37 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p0U0dapC062166 for ; Sun, 30 Jan 2011 00:39:36 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p0U0daMf062165; Sun, 30 Jan 2011 00:39:36 GMT (envelope-from nobody) Message-Id: <201101300039.p0U0daMf062165@red.freebsd.org> Date: Sun, 30 Jan 2011 00:39:36 GMT From: Pedro Giffuni To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: gnu/154385: Minor fixes to contrib/libstdc++ X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jan 2011 00:40:04 -0000 >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@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::__type __utype; + return result_type(__utype(__urng()) % (__max - __min + 1)) + __min; + } template 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: