[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10281: Stop redeclaring isinf by re
From: |
Bastiaan Jacques |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10281: Stop redeclaring isinf by renaming it to isInf (like we do for isnan). |
Date: |
Sat, 15 Nov 2008 00:40:55 +0100 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10281
committer: Bastiaan Jacques <address@hidden>
branch nick: trunk
timestamp: Sat 2008-11-15 00:40:55 +0100
message:
Stop redeclaring isinf by renaming it to isInf (like we do for isnan).
modified:
libcore/as_value.cpp
libcore/as_value.h
libcore/asobj/Date.cpp
libcore/vm/Machine.cpp
=== modified file 'libcore/as_value.cpp'
--- a/libcore/as_value.cpp 2008-10-30 16:46:00 +0000
+++ b/libcore/as_value.cpp 2008-11-14 23:40:55 +0000
@@ -1587,7 +1587,7 @@
{
return "NaN";
}
- else if (isinf(val))
+ else if (isInf(val))
{
return val < 0 ? "-Infinity" : "Infinity";
}
=== modified file 'libcore/as_value.h'
--- a/libcore/as_value.h 2008-10-27 20:00:30 +0000
+++ b/libcore/as_value.h 2008-11-14 23:40:55 +0000
@@ -72,7 +72,13 @@
return num != num;
}
-#define isinf(x) (isNaN(x - x))
+template <typename T>
+inline bool
+isInf(const T& num)
+{
+ return isNaN(num - num);
+}
+
/// Use this methods to obtain a properly-formatted property name
/// The methods will convert the name to lowercase if the current VM target
=== modified file 'libcore/asobj/Date.cpp'
--- a/libcore/asobj/Date.cpp 2008-10-04 12:25:36 +0000
+++ b/libcore/asobj/Date.cpp 2008-11-14 23:40:55 +0000
@@ -360,7 +360,7 @@
"Thu", "Fri", "Sat" };
/// NaN and infinities all print as "Invalid Date"
- if (isNaN(_value) || isinf(_value)) {
+ if (isNaN(_value) || isInf(_value)) {
return as_value("Invalid Date");
}
@@ -490,7 +490,7 @@
inline
bool invalidDate(double timeValue)
{
- return (isNaN(timeValue) || isinf(timeValue));
+ return (isNaN(timeValue) || isInf(timeValue));
}
/// Returns an element of the Date object as an as_value
@@ -919,13 +919,13 @@
// It seems odd, but FlashPlayer takes all bad month values to mean
// January
double monthvalue = fn.arg(0).to_number();
- if (isNaN(monthvalue) || isinf(monthvalue)) monthvalue = 0.0;
+ if (isNaN(monthvalue) || isInf(monthvalue)) monthvalue = 0.0;
truncateDouble(gt.month, monthvalue);
// If the day-of-month value is invalid instead, the result is NaN.
if (fn.nargs >= 2) {
double mdayvalue = fn.arg(1).to_number();
- if (isNaN(mdayvalue) || isinf(mdayvalue)) {
+ if (isNaN(mdayvalue) || isInf(mdayvalue)) {
date->setTimeValue(NaN);
return as_value(date->getTimeValue());
}
@@ -1275,7 +1275,7 @@
if (isNaN(arg)) return(NaN);
- if (isinf(arg)) {
+ if (isInf(arg)) {
if (arg > 0) { // Plus infinity
plusinf = true;
}
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp 2008-09-19 10:24:02 +0000
+++ b/libcore/vm/Machine.cpp 2008-11-14 23:40:55 +0000
@@ -176,13 +176,13 @@
double ad = a.to_number(); double bd = b.to_number();
\
if (isNaN(ad) || isNaN(bd))
\
store = truth_of_undefined;
\
- else if (isinf(ad) && ad > 0)
\
+ else if (isInf(ad) && ad > 0)
\
store = false;
\
- else if (isinf(bd) && bd > 0)
\
+ else if (isInf(bd) && bd > 0)
\
store = true;
\
- else if (isinf(bd) && bd < 0)
\
+ else if (isInf(bd) && bd < 0)
\
store = false;
\
- else if (isinf(ad) && ad < 0)
\
+ else if (isInf(ad) && ad < 0)
\
store = true;
\
else
\
store = ad < bd;
\
@@ -211,10 +211,10 @@
double ad = a.to_number(); double bd = b.to_number();
\
if (isNaN(ad) || isNaN(bd))
\
*store = false;
\
- else if (isinf(ad) && ad > 0)
\
- *store = (isinf(bd) && bd > 0);
\
- else if (isinf(ad) && ad < 0)
\
- *store = (isinf(bd) && bd < 0);
\
+ else if (isInf(ad) && ad > 0)
\
+ *store = (isInf(bd) && bd > 0);
\
+ else if (isInf(ad) && ad < 0)
\
+ *store = (isInf(bd) && bd < 0);
\
else
\
*store = (ad == bd);
\
}
\
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10281: Stop redeclaring isinf by renaming it to isInf (like we do for isnan).,
Bastiaan Jacques <=