gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/asobj/Math.cpp


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/asobj/Math.cpp
Date: Thu, 15 May 2008 07:02:54 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/05/15 07:02:53

Modified files:
        .              : ChangeLog 
        server/asobj   : Math.cpp 

Log message:
                * server/asobj/Math.cpp: drop the hack, drop using namespace 
std,
                  qualify all cmath functions with std::, and see if that causes
                  problems on any platforms. As all the functions are from C89 
and
                  in the C++ standard, the hackery ought to be unnecessary.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6601&r2=1.6602
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Math.cpp?cvsroot=gnash&r1=1.32&r2=1.33

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6601
retrieving revision 1.6602
diff -u -b -r1.6601 -r1.6602
--- ChangeLog   15 May 2008 06:58:58 -0000      1.6601
+++ ChangeLog   15 May 2008 07:02:51 -0000      1.6602
@@ -1,3 +1,10 @@
+2008-05-15 Benjamin Wolsey <address@hidden>
+
+       * server/asobj/Math.cpp: drop the hack, drop using namespace std,
+         qualify all cmath functions with std::, and see if that causes
+         problems on any platforms. As all the functions are from C89 and
+         in the C++ standard, the hackery ought to be unnecessary.
+
 2008-05-15 Zou Lunkai <address@hidden>
        
        * server/dlist.{h,cpp}: mergeDisplayList(), don't forget to merge 
characters

Index: server/asobj/Math.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Math.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- server/asobj/Math.cpp       16 Apr 2008 09:26:28 -0000      1.32
+++ server/asobj/Math.cpp       15 May 2008 07:02:52 -0000      1.33
@@ -28,10 +28,6 @@
 //
 
 
-#ifdef HAVE_CONFIG_H
-# include "gnashconfig.h"
-#endif
-
 #include <cmath>
 #include <string>
 #include <boost/random.hpp>
@@ -43,8 +39,6 @@
 #include "builtin_function.h" 
 #include "Object.h" // for getObjectInterface
 
-using namespace std;
-
 namespace gnash {
 
 // Forward declarations
@@ -95,15 +89,18 @@
                if (fn.nargs < 1) result = NAN;                 \
                else {                                          \
                        double  arg = fn.arg(0).to_number();    \
-                       result = funcname(arg);                 \
+                       result = std::funcname(arg);                    \
                }                                               \
                return as_value(result);                        \
        }
 
-#ifndef __GNUC__  //Some hacks are ugly and dirty, we call them 'fulhack'.
-#      undef TU_MATH_H
-#      include "tu_math.h"
-#endif
+// Dirty it is, but what's it for? All the functions used here are
+// in the standard cmath header, so there *ought* to be no need for
+// a hack.
+//#ifndef __GNUC__  //Some hacks are ugly and dirty, we call them 'fulhack'.
+//#    undef TU_MATH_H
+//#    include "tu_math.h"
+//#endif
 
 MATH_WRAP_FUNC1(fabs)
 MATH_WRAP_FUNC1(acos)
@@ -142,10 +139,10 @@
                return as_value(result);                        \
        }
 
-MATH_WRAP_FUNC2_EXP(atan2, (atan2(arg0, arg1)))
+MATH_WRAP_FUNC2_EXP(atan2, (std::atan2(arg0, arg1)))
 MATH_WRAP_FUNC2_EXP(max, (arg0 > arg1 ? arg0 : arg1))
 MATH_WRAP_FUNC2_EXP(min, (arg0 < arg1 ? arg0 : arg1))
-MATH_WRAP_FUNC2_EXP(pow, (pow(arg0, arg1)))
+MATH_WRAP_FUNC2_EXP(pow, (std::pow(arg0, arg1)))
 
 
 // A couple of oddballs.
@@ -173,7 +170,7 @@
        if (fn.nargs < 1) result = NAN;
        else {
                double arg0 = fn.arg(0).to_number();
-               result = floor(arg0 + 0.5);
+               result = std::floor(arg0 + 0.5);
        }
        return as_value(result);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]