gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11550: Interface cleanups. Rely les


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11550: Interface cleanups. Rely less on VM singleton.
Date: Wed, 07 Oct 2009 10:40:42 +0200
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11550 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-10-07 10:40:42 +0200
message:
  Interface cleanups. Rely less on VM singleton.
  
  Reduce button get_member override more.
modified:
  libcore/Button.cpp
  libcore/ClassHierarchy.cpp
  libcore/as_value.cpp
  libcore/as_value.h
  libcore/asobj/Array_as.cpp
  libcore/asobj/flash/geom/Matrix_as.cpp
  libcore/asobj/flash/geom/Point_as.cpp
  libcore/asobj/flash/geom/Rectangle_as.cpp
  libcore/debugger.cpp
  libcore/vm/ASHandlers.cpp
  libcore/vm/Machine.cpp
  testsuite/libcore.all/PropertyListTest.cpp
  testsuite/movies.all/gravity_embedded-TestRunner.cpp
=== modified file 'libcore/Button.cpp'
--- a/libcore/Button.cpp        2009-10-04 09:07:01 +0000
+++ b/libcore/Button.cpp        2009-10-06 08:10:12 +0000
@@ -1021,24 +1021,6 @@
         return true;
     }
 
-    // Try items on our display list.
-    DisplayObject* ch = getChildByName(name);
-
-    if (ch) {
-        // Found object.
-
-        // If the object is an ActionScript referenciable one we
-        // return it, otherwise we return ourselves
-        if ( ch->isActionScriptReferenceable() ) {
-            val->set_as_object(ch);
-        }
-        else {
-            val->set_as_object(this);
-        }
-
-        return true;
-    }
-
     return false;
 
 }

=== modified file 'libcore/ClassHierarchy.cpp'
--- a/libcore/ClassHierarchy.cpp        2009-07-16 08:53:33 +0000
+++ b/libcore/ClassHierarchy.cpp        2009-10-04 15:55:41 +0000
@@ -95,7 +95,7 @@
                 super.set_undefined();
                 return super;
             }
-            if (!super.is_as_function())
+            if (!super.is_function())
             {
                 // Error here -- not an object.
                 log_error("%s (Superclass of %s) is not a function (%s)",
@@ -168,7 +168,7 @@
                     super.set_undefined();
                     return super;
                 }
-                if (!super.is_as_function())
+                if (!super.is_function())
                 {
                     // Error here -- not an object.
                     log_error("%s (Superclass of %s) is not a function (%s)",

=== modified file 'libcore/as_value.cpp'
--- a/libcore/as_value.cpp      2009-10-02 08:18:58 +0000
+++ b/libcore/as_value.cpp      2009-10-07 08:40:42 +0000
@@ -977,40 +977,6 @@
     return NULL;
 }
 
-// Force type to number.
-void
-as_value::convert_to_boolean()
-{
-    set_bool(to_bool());
-}
-
-// Force type to number.
-void
-as_value::convert_to_number()
-{
-    set_double(to_number());
-}
-
-// Force type to string.
-void
-as_value::convert_to_string()
-{
-    std::string ns = to_string();
-    m_type = STRING;   // force type.
-    _value = ns;
-}
-
-
-void
-as_value::convert_to_string_versioned(int version)
-    // Force type to string.
-{
-    std::string ns = to_string_versioned(version);
-    m_type = STRING;   // force type.
-    _value = ns;
-}
-
-
 void
 as_value::set_undefined()
 {
@@ -1026,13 +992,6 @@
 }
 
 void
-as_value::set_unsupported()
-{
-       m_type = UNSUPPORTED;
-       _value = boost::blank();
-}
-
-void
 as_value::set_as_object(as_object* obj)
 {
        if ( ! obj )
@@ -1918,7 +1877,6 @@
 #ifdef GNASH_DEBUG_AMF_DESERIALIZE
          log_debug("as_value(Element&) : AMF type UNSUPPORTED");
 #endif
-         set_unsupported();
          break;
       }
       case amf::Element::RECORD_SET_AMF0:
@@ -1940,48 +1898,47 @@
     }
 }
 
-as_value&
-as_value::newAdd(const as_value& op2)
+void
+newAdd(as_value& left, const as_value& right, VM& vm)
 {
-       as_value v2=op2;
-
-       try { convert_to_primitive(); }
+    // We can't change the original value.
+    as_value r(right);
+
+    // The order of the operations is important: right is converted to
+    // primitive before left.
+
+       try { r = r.to_primitive(); }
        catch (ActionTypeError& e)
        {
-               log_debug("%s.to_primitive() threw an error during as_value 
operator+",
-                       *this);
+        log_debug(_("%s.to_primitive() threw an error during "
+                "ActionNewAdd"), r);
        }
-
-       try { v2 = v2.to_primitive(); }
+       
+    try { left = left.to_primitive(); }
        catch (ActionTypeError& e)
        {
-               log_debug("%s.to_primitive() threw an error during as_value 
operator+",
-                       op2);
+        log_debug(_("%s.to_primitive() threw an error during "
+                "ActionNewAdd"), left);
        }
 
 #if GNASH_DEBUG
-       log_debug(_("(%s + %s) [primitive conversion done]"),
-                       *this,
-                       v2);
+       log_debug(_("(%s + %s) [primitive conversion done]"), left, r);
 #endif
 
-       if (is_string() || v2.is_string() )
-       {
+       if (left.is_string() || r.is_string()) {
+
                // use string semantic
-
-               int version = VM::get().getSWFVersion();
-               convert_to_string_versioned(version);
-               string_concat(v2.to_string_versioned(version));
-       }
-       else {
-               // use numeric semantic
-               double v2num = v2.to_number();
-               double v1num = to_number();
-               set_double(v2num + v1num); 
-
-       }
-
-       return *this;
+               const int version = vm.getSWFVersion();
+               convertToString(left, vm);
+               left.string_concat(r.to_string_versioned(version));
+        return;
+       }
+
+    // Otherwise use numeric semantic
+    const double v1num = left.to_number();
+    const double v2num = r.to_number();
+    left.set_double(v2num + v1num); 
+
 }
 
 as_value
@@ -2029,13 +1986,12 @@
     return ret;
 }
 
-as_value&
-as_value::subtract(const as_value& op2)
+void
+subtract(as_value& left, const as_value& right, VM& /*vm*/)
 {
-       double operand1 = to_number();
-       double operand2 = op2.to_number();
-       set_double(operand1 - operand2);
-       return *this;
+       const double operand2 = right.to_number();
+       const double operand1 = left.to_number();
+       left.set_double(operand1 - operand2);
 }
 
 
@@ -2585,6 +2541,29 @@
     }
 }
 
+/// Force type to number.
+as_value&
+convertToNumber(as_value& v, VM& /*vm*/)
+{
+    v.set_double(v.to_number());
+    return v;
+}
+
+/// Force type to string.
+as_value&
+convertToString(as_value& v, VM& vm)
+{
+    v.set_string(v.to_string_versioned(vm.getSWFVersion()));
+    return v;
+}
+
+/// Force type to bool.
+as_value&
+convertToBoolean(as_value& v, VM& /*vm*/)
+{
+    v.set_bool(v.to_bool());
+    return v;
+}
 } // namespace gnash
 
 

=== modified file 'libcore/as_value.h'
--- a/libcore/as_value.h        2009-08-19 12:14:57 +0000
+++ b/libcore/as_value.h        2009-10-04 19:40:47 +0000
@@ -120,10 +120,6 @@
                NULLTYPE,
                NULLTYPE_EXCEPT,
 
-               /// NULL value
-               UNSUPPORTED,
-               UNSUPPORTED_EXCEPT,
-
                /// Boolean value
                BOOLEAN,
                BOOLEAN_EXCEPT,
@@ -309,12 +305,6 @@
                return m_type == AS_FUNCTION;
        }
 
-       /// Return true if this value is a AS function
-       bool is_as_function() const
-       {
-               return m_type == AS_FUNCTION;
-       }
-
        /// Return true if this value is strictly a string
        //
        /// Note that you usually DON'T need to call this
@@ -510,26 +500,6 @@
        ///
        as_value& convert_to_primitive();
 
-       /// Force type to number.
-       void convert_to_number();
-
-       /// Force type to string.
-       void convert_to_string();
-    
-       /// Force type to bool.
-       void convert_to_boolean();
-    
-       /// Force type to string.
-       //
-       /// uses swf-version-aware converter
-    ///
-       /// @param version
-    ///     SWF version for which the operation is desired.
-       ///
-       /// @see to_string_versioned
-       ///
-       void convert_to_string_versioned(int version);
-
        // These set_*()'s are more type-safe; should be used
        // in preference to generic overloaded set().  You are
        // more likely to get a warning/error if misused.
@@ -567,26 +537,6 @@
        /// Set this value to the NULL value
        void set_null();
 
-       /// Set this value to the Unsupported value
-       void set_unsupported();
-
-       /// Equality operator, follows strict equality semantic
-       //
-       /// See strictly_equals
-       ///
-       bool operator==(const as_value& v) const
-       {
-               return strictly_equals(v);
-       }
-
-       /// Inequality operator, follows strict inequality semantic
-       //
-       /// See strictly_equals
-       ///
-       bool operator!=(const as_value& v) const {
-               return ! ( *this  == v );
-       }
-
        void operator=(const as_value& v);
 
        bool is_undefined() const { return (m_type == UNDEFINED); }
@@ -595,14 +545,11 @@
 
        bool is_bool() const { return (m_type == BOOLEAN); }
 
-       bool is_unsupported() const { return (m_type == UNSUPPORTED); }
-
         bool is_exception() const
        { return (m_type == UNDEFINED_EXCEPT || m_type == NULLTYPE_EXCEPT
                || m_type == BOOLEAN_EXCEPT || m_type == NUMBER_EXCEPT
                || m_type == OBJECT_EXCEPT || m_type == AS_FUNCTION_EXCEPT
-               || m_type == MOVIECLIP_EXCEPT || m_type == STRING_EXCEPT
-               || m_type == UNSUPPORTED_EXCEPT);
+               || m_type == MOVIECLIP_EXCEPT || m_type == STRING_EXCEPT);
        }
 
        // Flag or unflag an as_value as an exception -- this gets flagged
@@ -635,16 +582,11 @@
        bool equals(const as_value& v) const;
 
        /// Sets this value to this string plus the given string.
-       void    string_concat(const std::string& str);
-
-       /// Equivalent of ActionNewAdd
-       as_value& newAdd(const as_value& v1);
+       void string_concat(const std::string& str);
 
        /// Equivalent of ActionNewLessThan
        as_value newLessThan(const as_value& op2_in) const;
 
-       // Equivalent of ActionSubtract
-       as_value& subtract(const as_value& o);
 
        /// Set any object value as reachable (for the GC)
        //
@@ -654,6 +596,12 @@
 
 private:
 
+    /// Use the relevant equality function, not operator==
+    bool operator==(const as_value& v) const;
+
+    /// Use the relevant inequality function, not operator!=
+    bool operator!=(const as_value& v) const;
+
        /// Compare values of the same type
        //
        /// NOTE: will abort if values are not of the same type!
@@ -726,7 +674,33 @@
 
 };
 
-typedef as_value (*as_c_function_ptr)(const fn_call& fn);
+
+/// Carry out ActionNewAdd
+//
+/// @param left     The as_value to add to.
+/// @param right    The as_value to add.
+/// @param vm       The VM executing the operation.
+//
+/// TODO:           Consider whether it would be better to pass something
+///                 other than the VM. But it is a VM operation, so it
+///                 is logically sound.
+void newAdd(as_value& left, const as_value& right, VM& vm);
+
+/// Force type to number.
+as_value& convertToNumber(as_value& v, VM& vm);
+
+/// Force type to string.
+as_value& convertToString(as_value& v, VM& vm);
+
+/// Force type to bool.
+as_value& convertToBoolean(as_value& v, VM& vm);
+
+/// Carry out ActionSubtract
+//
+/// @param left     The as_value to subtract from.
+/// @param right    The as_value to subtract.
+/// @param vm       The VM executing the operation.
+void subtract(as_value& left, const as_value& right, VM& vm);
 
 inline std::ostream& operator<< (std::ostream& os, const as_value& v) {
        return os << v.toDebugString();

=== modified file 'libcore/asobj/Array_as.cpp'
--- a/libcore/asobj/Array_as.cpp        2009-09-29 13:50:03 +0000
+++ b/libcore/asobj/Array_as.cpp        2009-10-04 15:55:41 +0000
@@ -985,7 +985,7 @@
     {
         flags=static_cast<boost::uint8_t>(fn.arg(0).to_number());
     }
-    else if (fn.arg(0).is_as_function())
+    else if (fn.arg(0).is_function())
     {
 
         // Get comparison function

=== modified file 'libcore/asobj/flash/geom/Matrix_as.cpp'
--- a/libcore/asobj/flash/geom/Matrix_as.cpp    2009-09-29 10:06:20 +0000
+++ b/libcore/asobj/flash/geom/Matrix_as.cpp    2009-10-04 11:00:36 +0000
@@ -348,23 +348,22 @@
     const double c = -std::sin(rotation) * widthX * 10 / gradientSquareMax;
     const double d = std::cos(rotation) * widthY * 10 / gradientSquareMax;
     
-    ptr->set_member(NSV::PROP_A, as_value(a));
-    ptr->set_member(NSV::PROP_B, as_value(b));
-    ptr->set_member(NSV::PROP_C, as_value(c));
-    ptr->set_member(NSV::PROP_D, as_value(d));
+    ptr->set_member(NSV::PROP_A, a);
+    ptr->set_member(NSV::PROP_B, b);
+    ptr->set_member(NSV::PROP_C, c);
+    ptr->set_member(NSV::PROP_D, d);
     
     // The translation is offset by half the size of the corresponding
     // dimension. Or rather, half the dimension is added to the translation,
     // whether it's a number or not.
-    tx.newAdd(widthX / 2.0);
-    ty.newAdd(widthY / 2.0);
+    VM& vm = getVM(fn);
+    newAdd(tx, widthX / 2.0, vm);
+    newAdd(ty, widthY / 2.0, vm);
 
     ptr->set_member(NSV::PROP_TX, tx);
     ptr->set_member(NSV::PROP_TY, ty);
     
     return as_value();
-
-    return as_value();
 }
 
 

=== modified file 'libcore/asobj/flash/geom/Point_as.cpp'
--- a/libcore/asobj/flash/geom/Point_as.cpp     2009-09-29 10:06:30 +0000
+++ b/libcore/asobj/flash/geom/Point_as.cpp     2009-10-04 11:00:36 +0000
@@ -157,8 +157,9 @@
         }
     }
 
-    x.newAdd(x1);
-    y.newAdd(y1);
+    VM& vm = getVM(fn);
+    newAdd(x, x1, vm);
+    newAdd(y, y1, vm);
 
     return constructPoint(fn, x, y);
 }
@@ -291,8 +292,9 @@
         if ( fn.nargs > 1 ) yoff = fn.arg(1);
     }
 
-    x.newAdd(xoff);
-    y.newAdd(yoff);
+    VM& vm = getVM(fn);
+    newAdd(x, xoff, vm);
+    newAdd(y, yoff, vm);
 
     ptr->set_member(NSV::PROP_X, x);
     ptr->set_member(NSV::PROP_Y, y);
@@ -550,10 +552,11 @@
     as_value xoff = mu * (x0 - x1);
     as_value yoff = mu * (y0 - y1);
 
+    VM& vm = getVM(fn);
     as_value x = x1val; // copy to avoid changing stack value
-    x.newAdd(xoff);
+    newAdd(x, xoff, vm);
     as_value y = y1val; // copy to avoid changing stack value
-    y.newAdd(yoff);
+    newAdd(y, yoff, vm);
 
     return constructPoint(fn, x, y);
 }

=== modified file 'libcore/asobj/flash/geom/Rectangle_as.cpp'
--- a/libcore/asobj/flash/geom/Rectangle_as.cpp 2009-09-29 10:29:08 +0000
+++ b/libcore/asobj/flash/geom/Rectangle_as.cpp 2009-10-04 12:19:33 +0000
@@ -181,11 +181,13 @@
         return as_value();
     }
 
+    VM& vm = getVM(fn);
+    
     as_value rect_x1_as = rect_x_as;
-    rect_x1_as.newAdd(rect_width_as);
+    newAdd(rect_x1_as, rect_width_as, vm);
 
     as_value rect_y1_as = rect_y_as;
-    rect_y1_as.newAdd(rect_height_as);
+    newAdd(rect_y1_as, rect_height_as, vm);
 
     if ( rect_x_as.is_null() || rect_x_as.is_undefined() ||
          rect_y_as.is_null() || rect_y_as.is_undefined() ||
@@ -383,16 +385,18 @@
         as_value height;
         ptr->get_member(NSV::PROP_Y, &ret);
         ptr->get_member(NSV::PROP_HEIGHT, &height);
-        ret.newAdd(height);
+        VM& vm = getVM(fn);
+        newAdd(ret, height, vm);
     }
     else // setter
     {
         as_value y;
         ptr->get_member(NSV::PROP_Y, &y);
 
-        as_value bottom = fn.arg(0);
-        as_value newh = bottom.subtract(y);
-        ptr->set_member(NSV::PROP_HEIGHT, newh);
+        as_value height = fn.arg(0);
+        VM& vm = getVM(fn);
+        subtract(height, y, vm);
+        ptr->set_member(NSV::PROP_HEIGHT, height);
     }
 
     return ret;
@@ -406,14 +410,15 @@
 
     if (!fn.nargs) {
 
-        as_value x,y,w,h;
+        as_value x, y, w, h;
         ptr->get_member(NSV::PROP_X, &x);
         ptr->get_member(NSV::PROP_Y, &y);
         ptr->get_member(NSV::PROP_WIDTH, &w);
         ptr->get_member(NSV::PROP_HEIGHT, &h);
 
-        as_value right = x.newAdd(w);
-        as_value bottom = y.newAdd(h);
+        VM& vm = getVM(fn);
+        newAdd(x, w, vm);
+        newAdd(y, h, vm);
 
         as_value point(fn.env().find_object("flash.geom.Point"));
 
@@ -425,7 +430,7 @@
         }
 
         fn_call::Args args;
-        args += right, bottom;
+        args += x, y;
 
         as_value ret = pointCtor->constructInstance(fn.env(), args);
         return ret;
@@ -461,7 +466,9 @@
         as_value w;
         ptr->get_member(NSV::PROP_WIDTH, &w);
 
-        w.newAdd(oldx.subtract(newx));
+        VM& vm = getVM(fn);
+        subtract(oldx, newx, vm);
+        newAdd(w, oldx, vm);
         ptr->set_member(NSV::PROP_WIDTH, w);
     }
 
@@ -480,16 +487,18 @@
         as_value width;
         ptr->get_member(NSV::PROP_X, &ret);
         ptr->get_member(NSV::PROP_WIDTH, &width);
-        ret.newAdd(width);
+        VM& vm = getVM(fn);
+        newAdd(ret, width, vm);
     }
     else // setter
     {
         as_value x;
         ptr->get_member(NSV::PROP_X, &x);
 
-        as_value right = fn.arg(0);
-        as_value neww = right.subtract(x);
-        ptr->set_member(NSV::PROP_WIDTH, neww);
+        VM& vm = getVM(fn);
+        as_value width = fn.arg(0);
+        subtract(width, x, vm);
+        ptr->set_member(NSV::PROP_WIDTH, width);
     }
 
     return ret;
@@ -551,7 +560,9 @@
         as_value h;
         ptr->get_member(NSV::PROP_HEIGHT, &h);
 
-        h.newAdd(oldy.subtract(newy));
+        VM& vm = getVM(fn);
+        subtract(oldy, newy, vm);
+        newAdd(h, oldy, vm);
         ptr->set_member(NSV::PROP_HEIGHT, h);
     }
 

=== modified file 'libcore/debugger.cpp'
--- a/libcore/debugger.cpp      2009-09-21 02:56:49 +0000
+++ b/libcore/debugger.cpp      2009-10-04 15:55:41 +0000
@@ -569,7 +569,7 @@
             cerr << "\t" << i << ": ";
            as_value val = env.bottom(i);
 // FIXME: we want to print the name of the function
-//         if (val.is_as_function()) {
+//         if (val.is_function()) {
 // //          cerr << val.get_symbol_handle() << endl;
 //             string name = this->lookupSymbol(val.to_object(*getGlobal(fn)));
 //             if (name.size()) {

=== modified file 'libcore/vm/ASHandlers.cpp'
--- a/libcore/vm/ASHandlers.cpp 2009-10-06 07:45:26 +0000
+++ b/libcore/vm/ASHandlers.cpp 2009-10-07 08:40:42 +0000
@@ -708,12 +708,8 @@
 void
 SWFHandlers::ActionSubtract(ActionExec& thread)
 {
-
     as_environment& env = thread.env;
-    
-    const double operand2 = env.top(0).to_number();
-    const double operand1 = env.top(1).to_number();
-    env.top(1) = operand1 - operand2;
+    subtract(env.top(1), env.top(0), getVM(env));
     env.drop(1);
 }
 
@@ -785,7 +781,7 @@
     env.top(1).set_bool(op1.to_number() == op2.to_number());
 
     // Flash4 used 1 and 0 as return from this tag
-    if ( env.get_version() < 5 ) env.top(1).convert_to_number();
+    if ( env.get_version() < 5 ) convertToNumber(env.top(1), getVM(env));
 
     env.drop(1);
 }
@@ -799,7 +795,7 @@
     env.top(1).set_bool(env.top(1).to_number() < env.top(0).to_number());
 
     // Flash4 used 1 and 0 as return from this tag
-    if ( env.get_version() < 5 ) env.top(1).convert_to_number();
+    if ( env.get_version() < 5 ) convertToNumber(env.top(1), getVM(env));
 
     env.drop(1);
 }
@@ -833,7 +829,7 @@
     env.top(0).set_bool(! env.top(0).to_bool());
 
     // Flash4 used 1 and 0 as return from this tag
-    if ( env.get_version() < 5 ) env.top(0).convert_to_number();
+    if (env.get_version() < 5) convertToNumber(env.top(0), getVM(env));
 }
 
 void
@@ -1069,7 +1065,7 @@
     as_environment& env = thread.env;
 
     const int version = env.get_version();
-    env.top(1).convert_to_string_versioned(version);
+    convertToString(env.top(1), getVM(env));
     env.top(1).string_concat(env.top(0).to_string_versioned(version));
     env.drop(1);
 }
@@ -3008,52 +3004,10 @@
 void
 SWFHandlers::ActionNewAdd(ActionExec& thread)
 {
-    //GNASH_REPORT_FUNCTION;
     as_environment& env = thread.env;
 
-    as_value v1 = env.top(0);
-    as_value v2 = env.top(1);
-
-    try { v1 = v1.to_primitive(); }
-    catch (ActionTypeError& e)
-    {
-        log_debug(_("%s.to_primitive() threw an error during ActionNewAdd"),
-            env.top(0));
-    }
-
-    try { v2 = v2.to_primitive(); }
-    catch (ActionTypeError& e)
-    {
-        log_debug(_("%s.to_primitive() threw an error during ActionNewAdd"),
-            env.top(1));
-    }
-
-#if GNASH_DEBUG
-    log_debug(_("ActionNewAdd(%s, %s) [primitive conversion done]"),
-                v1, v2);
-#endif
-
-    if (v1.is_string() || v2.is_string())
-    {
-        // NOTE: I've tested that we should change behaviour
-        //       based on code definition version, not top-level
-        //       SWF version. Just not automated yet.
-        //
-        const int version = thread.code.getDefinitionVersion();
-        v2.convert_to_string_versioned(version);
-        v2.string_concat(v1.to_string_versioned(version));
-        env.top(1) = v2;
-    }
-    else
-    {
-        // use numeric semantic
-        const double v2num = v2.to_number();
-        const double v1num = v1.to_number();
-
-        v2.set_double(v2num + v1num); 
-
-        env.top(1) = v2;
-    }
+    newAdd(env.top(1), env.top(0), getVM(env));
+
     env.drop(1);
 }
 
@@ -3167,16 +3121,14 @@
 SWFHandlers::ActionToNumber(ActionExec& thread)
 {
     as_environment& env = thread.env;
-    env.top(0).convert_to_number();
+    convertToNumber(env.top(0), getVM(env));
 }
 
 void
 SWFHandlers::ActionToString(ActionExec& thread)
 {
     as_environment& env = thread.env;
-    
-    const int version = env.get_version();
-    env.top(0).convert_to_string_versioned(version);
+    convertToString(env.top(0), getVM(env));
 }
 
 void

=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp    2009-08-27 06:30:46 +0000
+++ b/libcore/vm/Machine.cpp    2009-10-04 12:19:33 +0000
@@ -2444,7 +2444,7 @@
                 /// Stack Out:
                 /// a + b (double if numeric)
                 case SWF::ABC_ACTION_ADD:
-                    _stack.top(1) = _stack.top(1).newAdd(_stack.top(0));
+                    newAdd(_stack.top(1), _stack.top(0), _vm);
                     _stack.drop(1);
                     break;
                 
@@ -2455,7 +2455,7 @@
                 /// Stack Out:
                 ///  a - b (double)
                 case SWF::ABC_ACTION_SUBTRACT:
-                    _stack.top(1) = _stack.top(1).subtract(_stack.top(0));
+                    subtract(_stack.top(1), _stack.top(0), _vm);
                     _stack.drop(1);
                     break;
 

=== modified file 'testsuite/libcore.all/PropertyListTest.cpp'
--- a/testsuite/libcore.all/PropertyListTest.cpp        2009-07-16 08:53:33 
+0000
+++ b/testsuite/libcore.all/PropertyListTest.cpp        2009-10-04 16:01:21 
+0000
@@ -39,6 +39,8 @@
 
 #include "check.h"
 
+#define check_strictly_equals(a, b) check(a.strictly_equals(b))
+
 using namespace std;
 using namespace gnash;
 
@@ -91,7 +93,7 @@
                check_equals(props.size(), 1);
 
                check ( props.getValue(st.find("Var0"), ret, obj) );
-               check_equals ( ret, val );
+               check_strictly_equals ( ret, val );
 
                // search should be case-sensitive
                check ( ! props.getValue(st.find("var0"), ret, obj) );
@@ -100,7 +102,7 @@
                check ( props.setValue(st.find("Var0"), val2, obj) );
                check_equals(props.size(), 1);
                check ( props.getValue(st.find("Var0"), ret, obj) );
-               check_equals ( ret, val2 );
+               check_strictly_equals ( ret, val2 );
 
                // case-sensitive setting value doesn't overrides existing value
                check ( props.setValue(st.find("var0"), val3, obj) );
@@ -153,23 +155,23 @@
                check_equals(props.size(), 1);
 
                check ( props.getValue(st.find("Var0"), ret, obj) );
-               check_equals ( ret, val );
+               check_strictly_equals ( ret, val );
 
                // search should be case-insensitive
                check ( props.getValue(st.find("var0"), ret, obj) );
-               check_equals ( ret, val );
+               check_strictly_equals ( ret, val );
 
                // new value overrides existing value
                check ( props.setValue(st.find("Var0"), val2, obj) );
                check_equals(props.size(), 1);
                check ( props.getValue(st.find("Var0"), ret, obj) );
-               check_equals ( ret, val2 );
+               check_strictly_equals ( ret, val2 );
 
                // case-insensitive setting value should override existing value
                check ( props.setValue(st.find("var0"), val3, obj) );
                check_equals(props.size(), 1);
                check ( props.getValue(st.find("vAr0"), ret, obj) );
-               check_equals ( ret, val3 );
+               check_strictly_equals ( ret, val3 );
 
                // Now add some new labels
                check ( props.setValue(st.find("var1"), val, obj) );

=== modified file 'testsuite/movies.all/gravity_embedded-TestRunner.cpp'
--- a/testsuite/movies.all/gravity_embedded-TestRunner.cpp      2009-10-01 
09:32:43 +0000
+++ b/testsuite/movies.all/gravity_embedded-TestRunner.cpp      2009-10-04 
19:40:33 +0000
@@ -72,7 +72,7 @@
        // we need a const_cast as get_member *might* eventually
        // change the DisplayObject (fetching _x shouldn't change it though)
        check(const_cast<DisplayObject*>(loaded)->get_member(xscale, &tmp));
-       check_equals(tmp, as_value(50));
+       check(tmp.strictly_equals(50));
 
        check_equals(loaded->getBounds().height(), 2056);
        check_equals(loaded->getBounds().width(), 2056);


reply via email to

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