gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ASna...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ASna...
Date: Tue, 15 Apr 2008 15:18:03 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/04/15 15:18:02

Modified files:
        .              : ChangeLog 
        testsuite/actionscript.all: ASnative.as 
        server/asobj   : Global.cpp 
        server/vm      : VM.cpp VM.h 

Log message:
                * server/vm/VM.{h,cpp}: move implementation of registerNative
                  (makes debugging friendlier).
                * server/asobj/Global.cpp: don't only load Math class on demand
                  or its ASnative functions may not be registered when needed!
                * testsuite/actionscript.all/ASnative.as: Math tests now pass.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6286&r2=1.6287
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/ASnative.as?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.109&r2=1.110
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/VM.cpp?cvsroot=gnash&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/VM.h?cvsroot=gnash&r1=1.26&r2=1.27

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6286
retrieving revision 1.6287
diff -u -b -r1.6286 -r1.6287
--- ChangeLog   15 Apr 2008 11:41:48 -0000      1.6286
+++ ChangeLog   15 Apr 2008 15:18:00 -0000      1.6287
@@ -1,5 +1,13 @@
 2008-04-15 Benjamin Wolsey <address@hidden>
        
+       * server/vm/VM.{h,cpp}: move implementation of registerNative
+         (makes debugging friendlier).
+       * server/asobj/Global.cpp: don't only load Math class on demand
+         or its ASnative functions may not be registered when needed!
+       * testsuite/actionscript.all/ASnative.as: Math tests now pass.
+
+2008-04-15 Benjamin Wolsey <address@hidden>
+       
        * testsuite/actionscript.all/ASnative.as: 36 tests for ASnative.
          All of them fail :-(
        * testsuite/actionscript.all/Makefile.am: new test.

Index: testsuite/actionscript.all/ASnative.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/ASnative.as,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- testsuite/actionscript.all/ASnative.as      15 Apr 2008 11:41:49 -0000      
1.1
+++ testsuite/actionscript.all/ASnative.as      15 Apr 2008 15:18:01 -0000      
1.2
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-rcsid="$Id: ASnative.as,v 1.1 2008/04/15 11:41:49 bwy Exp $";
+rcsid="$Id: ASnative.as,v 1.2 2008/04/15 15:18:01 bwy Exp $";
 #include "check.as"
 
 countVO = 0;
@@ -37,53 +37,53 @@
 };
 
 a = ASnative(200, 0);
-xcheck_equals(a(func), 0.3); // abs
-xcheck_equals(a(0.3), 0.3); // abs
+check_equals(a(func), 0.3); // abs
+check_equals(a(0.3), 0.3); // abs
 
 a = ASnative(200, 1);
-xcheck_equals(a(func, func + 1), 0.3); // min
-xcheck_equals(a(0.3, 1.3), 0.3); // min
+check_equals(a(func, func + 1), 0.3); // min
+check_equals(a(0.3, 1.3), 0.3); // min
 
 a = ASnative(200, 2);
-xcheck_equals(a(func, func + 1), 1.3); // max
-xcheck_equals(a(0.3, 1.3), 1.3); // max
+check_equals(a(func, func + 1), 1.3); // max
+check_equals(a(0.3, 1.3), 1.3); // max
 
 a = ASnative(200, 3);
-xcheck_equals(a(func).toString(), "0.29552020666134"); // sin
-xcheck_equals(a(0.3).toString(), "0.29552020666134"); // sin
+check_equals(a(func).toString(), "0.29552020666134"); // sin
+check_equals(a(0.3).toString(), "0.29552020666134"); // sin
 
 a = ASnative(200, 4);
-xcheck_equals(a(func).toString(), "0.955336489125606"); // cos
-xcheck_equals(a(0.3).toString(), "0.955336489125606"); // cos
+check_equals(a(func).toString(), "0.955336489125606"); // cos
+check_equals(a(0.3).toString(), "0.955336489125606"); // cos
 
 a = ASnative(200, 5);
-xcheck_equals(a(func, func + 1).toString(), "0.226798848053886"); // atan2
-xcheck_equals(a(0.3, 1.3).toString(), "0.226798848053886"); // atan2
+check_equals(a(func, func + 1).toString(), "0.226798848053886"); // atan2
+check_equals(a(0.3, 1.3).toString(), "0.226798848053886"); // atan2
 
 a = ASnative(200, 6);
-xcheck_equals(a(func).toString(), "0.309336249609623"); // tan
+check_equals(a(func).toString(), "0.309336249609623"); // tan
 a = ASnative(200, 7);
-xcheck_equals(a(func).toString(), "1.349858807576"); // exp
+check_equals(a(func).toString(), "1.349858807576"); // exp
 a = ASnative(200, 8);
-xcheck_equals(a(func).toString(), "-1.20397280432594"); // log
+check_equals(a(func).toString(), "-1.20397280432594"); // log
 a = ASnative(200, 9);
-xcheck_equals(a(func).toString(), "0.547722557505166"); // sqrt
+check_equals(a(func).toString(), "0.547722557505166"); // sqrt
 a = ASnative(200, 10);
-xcheck_equals(a(func), 0); // round
+check_equals(a(func), 0); // round
 a = ASnative(200, 11);
-xcheck(a(func) >= 0 && a(func < 1)); // random
+check(a(func) >= 0 && a(func < 1)); // random
 a = ASnative(200, 12);
-xcheck_equals(a(func), 0); // floor
+check_equals(a(func), 0); // floor
 a = ASnative(200, 13);
-xcheck_equals(a(func), 1); // ceil
+check_equals(a(func), 1); // ceil
 a = ASnative(200, 14);
-xcheck_equals(a(func).toString(), "0.291456794477867"); // atan
+check_equals(a(func).toString(), "0.291456794477867"); // atan
 a = ASnative(200, 15);
-xcheck_equals(a(func).toString(), "0.304692654015398"); // asin
+check_equals(a(func).toString(), "0.304692654015398"); // asin
 a = ASnative(200, 16);
-xcheck_equals(a(func).toString(), "1.2661036727795"); // acos
+check_equals(a(func).toString(), "1.2661036727795"); // acos
 a = ASnative(200, 17);
-xcheck_equals(a(func, func + 1).toString(), "0.209053590580785"); // pow
+check_equals(a(func, func + 1).toString(), "0.209053590580785"); // pow
 a = ASnative(200, 18);
 xcheck_equals(a(func), false); // isNan
 a = ASnative(200, 19);

Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -b -r1.109 -r1.110
--- server/asobj/Global.cpp     10 Apr 2008 09:26:12 -0000      1.109
+++ server/asobj/Global.cpp     15 Apr 2008 15:18:02 -0000      1.110
@@ -425,8 +425,8 @@
                return ret;
        }
 
-       int sx = fn.arg(0).to_int();
-       int sy = fn.arg(1).to_int();
+       const int sx = fn.arg(0).to_int();
+       const int sy = fn.arg(1).to_int();
 
        if ( sx < 0 )
        {
@@ -443,12 +443,15 @@
                return ret;
        }
 
-       unsigned x = (unsigned)sx;
-       unsigned y = (unsigned)sy;
+       const unsigned int x = static_cast<unsigned int>(sx);
+       const unsigned int y = static_cast<unsigned int>(sy);
 
        VM& vm = VM::get();
        as_function* fun = vm.getNative(x, y);
-       if ( ! fun ) return ret;
+       if ( ! fun ) {
+           log_debug(_("No ASnative(%d, %d) registered with the VM"), x, y);
+           return ret;
+       }
        ret.set_as_function(fun);
        return ret;
                
@@ -605,6 +608,7 @@
 
        color_class_init(*this);
        textformat_class_init(*this);
+       math_class_init(*this);
 
        if ( vm.getSWFVersion() < 6 ) goto extscan;
        //-----------------------

Index: server/vm/VM.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/VM.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- server/vm/VM.cpp    5 Mar 2008 03:56:04 -0000       1.33
+++ server/vm/VM.cpp    15 Apr 2008 15:18:02 -0000      1.34
@@ -250,6 +250,15 @@
        _vm.markReachableResources();
 }
 
+void
+VM::registerNative(as_c_function_ptr fun, unsigned int x, unsigned int y)
+{
+    //log_debug("Registering function %p as ASnative(%d, %d) ", (void*)fun, x, 
y);
+    assert(fun);
+    assert(!_asNativeTable[x][y]);
+    _asNativeTable[x][y]=fun;
+}
+
 builtin_function*
 VM::getNative(unsigned int x, unsigned int y)
 {

Index: server/vm/VM.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/VM.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- server/vm/VM.h      21 Jan 2008 20:56:04 -0000      1.26
+++ server/vm/VM.h      15 Apr 2008 15:18:02 -0000      1.27
@@ -274,12 +274,7 @@
        ///
        void markReachableResources() const;
 
-       void registerNative(as_c_function_ptr fun, unsigned int x, unsigned int 
y)
-       {
-               assert(fun);
-               assert(!_asNativeTable[x][y]);
-               _asNativeTable[x][y]=fun;
-       }
+       void registerNative(as_c_function_ptr fun, unsigned int x, unsigned int 
y);
 
        /// Return a newly created builtin_function or null
        builtin_function* getNative(unsigned int x, unsigned int y);




reply via email to

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