Reviewers: Sven Panne,
Description:
Don't duplicate ceiling() for every POSIX platform.
[email protected]
Please review this at https://codereview.chromium.org/20274002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/platform-cygwin.cc
M src/platform-freebsd.cc
M src/platform-linux.cc
M src/platform-macos.cc
M src/platform-openbsd.cc
M src/platform-posix.cc
M src/platform-solaris.cc
Index: src/platform-cygwin.cc
diff --git a/src/platform-cygwin.cc b/src/platform-cygwin.cc
index
c34330b3fb7210a169b1b17f703f86435c01d1a1..6be908e22454fc1f8551e253d91ca17ba8142479
100644
--- a/src/platform-cygwin.cc
+++ b/src/platform-cygwin.cc
@@ -52,11 +52,6 @@ namespace v8 {
namespace internal {
-double ceiling(double x) {
- return ceil(x);
-}
-
-
static Mutex* limit_mutex = NULL;
Index: src/platform-freebsd.cc
diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc
index
d7544db1ca153cf53e0acf413f7ade42f627b748..e403d6d1a03ed68e249a5638cc9dbd9ccb7f5ef5
100644
--- a/src/platform-freebsd.cc
+++ b/src/platform-freebsd.cc
@@ -63,16 +63,6 @@ namespace v8 {
namespace internal {
-double ceiling(double x) {
- // Correct as on OS X
- if (-1.0 < x && x < 0.0) {
- return -0.0;
- } else {
- return ceil(x);
- }
-}
-
-
static Mutex* limit_mutex = NULL;
Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index
245dae4ace59025f855f0a65b2d6dfd29e194857..febd668f319396fdc25066eb047584fb70ad1c27
100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -76,11 +76,6 @@ namespace v8 {
namespace internal {
-double ceiling(double x) {
- return ceil(x);
-}
-
-
static Mutex* limit_mutex = NULL;
Index: src/platform-macos.cc
diff --git a/src/platform-macos.cc b/src/platform-macos.cc
index
12a3e663f0c5d2d6bb31c910d63869ec162cbccd..8ec4c510403899ee7ac39ad4cf3e7435f59ba074
100644
--- a/src/platform-macos.cc
+++ b/src/platform-macos.cc
@@ -79,16 +79,6 @@ namespace v8 {
namespace internal {
-double ceiling(double x) {
- // Correct Mac OS X Leopard 'ceil' behavior.
- if (-1.0 < x && x < 0.0) {
- return -0.0;
- } else {
- return ceil(x);
- }
-}
-
-
static Mutex* limit_mutex = NULL;
Index: src/platform-openbsd.cc
diff --git a/src/platform-openbsd.cc b/src/platform-openbsd.cc
index
df08a7a2360eccc5307d4bfd7602fe8aafcfbead..a94bfe8aa46b6a3cd117da6c5c5f8696ed5b5b56
100644
--- a/src/platform-openbsd.cc
+++ b/src/platform-openbsd.cc
@@ -61,11 +61,6 @@ namespace v8 {
namespace internal {
-double ceiling(double x) {
- return ceil(x);
-}
-
-
static Mutex* limit_mutex = NULL;
Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index
864e94c7e4f6896d61da24714332f3e2d55b35c8..6ac507204f966e4ea21610ca73d4dab0aa1f7e3e
100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -210,6 +210,16 @@ void OS::DebugBreak() {
//
----------------------------------------------------------------------------
// Math functions
+double ceiling(double x) {
+ // Correct buggy 'ceil' on some systems (i.e. FreeBSD, OS X)
+ if (-1.0 < x && x < 0.0) {
+ return -0.0;
+ } else {
+ return ceil(x);
+ }
+}
+
+
double modulo(double x, double y) {
return fmod(x, y);
}
Index: src/platform-solaris.cc
diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc
index
1ecca16507a1ceb5a51ac8a0ac9e291d043cd4e9..cb9ba18f97289044f5ea5d15fa531b9735e01e93
100644
--- a/src/platform-solaris.cc
+++ b/src/platform-solaris.cc
@@ -81,11 +81,6 @@ namespace v8 {
namespace internal {
-double ceiling(double x) {
- return ceil(x);
-}
-
-
static Mutex* limit_mutex = NULL;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.