summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2016-06-05 18:11:52 +0000
committerache <ache@FreeBSD.org>2016-06-05 18:11:52 +0000
commit704e666406f9401fa4d34ab536981c2f7837ddf7 (patch)
treee8f256f6c8e7bf97fa6de734594702873a326cd6 /lib
parent1040e2abb6d69c17df9ac2b20ed5a6615e11d6f9 (diff)
downloadFreeBSD-src-704e666406f9401fa4d34ab536981c2f7837ddf7.zip
FreeBSD-src-704e666406f9401fa4d34ab536981c2f7837ddf7.tar.gz
MFC: r301115
Don't use fixup for C99 and up, the compiler result is already correct. Suggested by: bde
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/div.c2
-rw-r--r--lib/libc/stdlib/imaxdiv.c2
-rw-r--r--lib/libc/stdlib/ldiv.c2
-rw-r--r--lib/libc/stdlib/lldiv.c2
4 files changed, 8 insertions, 0 deletions
diff --git a/lib/libc/stdlib/div.c b/lib/libc/stdlib/div.c
index 7dfe553..0bafbe6 100644
--- a/lib/libc/stdlib/div.c
+++ b/lib/libc/stdlib/div.c
@@ -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);
}
diff --git a/lib/libc/stdlib/imaxdiv.c b/lib/libc/stdlib/imaxdiv.c
index 7dae467..adcab0b 100644
--- a/lib/libc/stdlib/imaxdiv.c
+++ b/lib/libc/stdlib/imaxdiv.c
@@ -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);
}
diff --git a/lib/libc/stdlib/ldiv.c b/lib/libc/stdlib/ldiv.c
index 0ec98e6..745c566 100644
--- a/lib/libc/stdlib/ldiv.c
+++ b/lib/libc/stdlib/ldiv.c
@@ -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);
}
diff --git a/lib/libc/stdlib/lldiv.c b/lib/libc/stdlib/lldiv.c
index b34b65e..197b48f 100644
--- a/lib/libc/stdlib/lldiv.c
+++ b/lib/libc/stdlib/lldiv.c
@@ -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);
}
OpenPOWER on IntegriCloud