From owner-svn-src-stable@freebsd.org Sun Jun 5 18:11:53 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF37FB6AE7F; Sun, 5 Jun 2016 18:11:53 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77CDE1AA5; Sun, 5 Jun 2016 18:11:53 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55IBqxg010821; Sun, 5 Jun 2016 18:11:52 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55IBqv2010817; Sun, 5 Jun 2016 18:11:52 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051811.u55IBqv2010817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 18:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301459 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 18:11:53 -0000 Author: ache Date: Sun Jun 5 18:11:52 2016 New Revision: 301459 URL: https://svnweb.freebsd.org/changeset/base/301459 Log: MFC: r301115 Don't use fixup for C99 and up, the compiler result is already correct. Suggested by: bde Modified: stable/10/lib/libc/stdlib/div.c stable/10/lib/libc/stdlib/imaxdiv.c stable/10/lib/libc/stdlib/ldiv.c stable/10/lib/libc/stdlib/lldiv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/div.c ============================================================================== --- stable/10/lib/libc/stdlib/div.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/div.c Sun Jun 5 18:11:52 2016 (r301459) @@ -46,6 +46,7 @@ div(num, denom) r.quot = num / denom; r.rem = num % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) /* * The ANSI standard says that |r.quot| <= |n/d|, where * n/d is to be computed in infinite precision. In other @@ -73,5 +74,6 @@ div(num, denom) r.quot++; r.rem -= denom; } +#endif return (r); } Modified: stable/10/lib/libc/stdlib/imaxdiv.c ============================================================================== --- stable/10/lib/libc/stdlib/imaxdiv.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/imaxdiv.c Sun Jun 5 18:11:52 2016 (r301459) @@ -37,9 +37,11 @@ imaxdiv(intmax_t numer, intmax_t denom) retval.quot = numer / denom; retval.rem = numer % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (numer >= 0 && retval.rem < 0) { retval.quot++; retval.rem -= denom; } +#endif return (retval); } Modified: stable/10/lib/libc/stdlib/ldiv.c ============================================================================== --- stable/10/lib/libc/stdlib/ldiv.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/ldiv.c Sun Jun 5 18:11:52 2016 (r301459) @@ -48,9 +48,11 @@ ldiv(num, denom) r.quot = num / denom; r.rem = num % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (num >= 0 && r.rem < 0) { r.quot++; r.rem -= denom; } +#endif return (r); } Modified: stable/10/lib/libc/stdlib/lldiv.c ============================================================================== --- stable/10/lib/libc/stdlib/lldiv.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/lldiv.c Sun Jun 5 18:11:52 2016 (r301459) @@ -37,9 +37,11 @@ lldiv(long long numer, long long denom) retval.quot = numer / denom; retval.rem = numer % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (numer >= 0 && retval.rem < 0) { retval.quot++; retval.rem -= denom; } +#endif return (retval); }