gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/swf_function.cpp server/...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/swf_function.cpp server/...
Date: Tue, 09 Jan 2007 11:02:52 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/01/09 11:02:51

Modified files:
        .              : ChangeLog 
        server         : swf_function.cpp swf_function.h 

Log message:
                * server/swf_function.{cpp,h}: use symbolic
                  names for Function2 flags.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2061&r2=1.2062
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf_function.cpp?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf_function.h?cvsroot=gnash&r1=1.6&r2=1.7

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2061
retrieving revision 1.2062
diff -u -b -r1.2061 -r1.2062
--- ChangeLog   9 Jan 2007 10:37:01 -0000       1.2061
+++ ChangeLog   9 Jan 2007 11:02:51 -0000       1.2062
@@ -1,5 +1,10 @@
 2007-01-09 Sandro Santilli <address@hidden>
 
+       * server/swf_function.{cpp,h}: use symbolic
+         names for Function2 flags.
+
+2007-01-09 Sandro Santilli <address@hidden>
+
        * server/swf_function.cpp (operator()):
          Fix 'this' reference in function2 (both register and local var,
          only the latter tested but I'd assume the former would also work).

Index: server/swf_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf_function.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/swf_function.cpp     9 Jan 2007 10:37:02 -0000       1.15
+++ server/swf_function.cpp     9 Jan 2007 11:02:51 -0000       1.16
@@ -211,14 +211,14 @@
                // @@ why start at 1 ? Note that starting at 0 makes    
                // intro.swf movie fail to play correctly.
                uint8_t current_reg = 1;
-               if (m_function2_flags & 0x01)
+               if (m_function2_flags & PRELOAD_THIS)
                {
                        // preload 'this' into a register.
                        
our_env->local_register(current_reg).set_as_object(fn.this_ptr); 
                        current_reg++;
                }
 
-               if (m_function2_flags & 0x02)
+               if (m_function2_flags & SUPPRESS_THIS)
                {
                        // Don't put 'this' into a local var.
                }
@@ -230,7 +230,7 @@
 
                // Init arguments array, if it's going to be needed.
                boost::intrusive_ptr<as_array_object>   arg_array;
-               if ((m_function2_flags & 0x04) || ! (m_function2_flags & 0x08))
+               if ((m_function2_flags & PRELOAD_ARGUMENTS) || ! 
(m_function2_flags & SUPPRESS_ARGUMENTS))
                {
                        arg_array = new as_array_object;
 
@@ -242,14 +242,14 @@
                        }
                }
 
-               if (m_function2_flags & 0x04)
+               if (m_function2_flags & PRELOAD_ARGUMENTS)
                {
                        // preload 'arguments' into a register.
                        
our_env->local_register(current_reg).set_as_object(arg_array.get());
                        current_reg++;
                }
 
-               if (m_function2_flags & 0x08)
+               if (m_function2_flags & SUPPRESS_ARGUMENTS)
                {
                        // Don't put 'arguments' in a local var.
                }
@@ -259,7 +259,7 @@
                        our_env->add_local("arguments", 
as_value(arg_array.get()));
                }
 
-               if (m_function2_flags & 0x10)
+               if (m_function2_flags & PRELOAD_SUPER)
                {
                        // Put 'super' in a register.
                        
our_env->local_register(current_reg).set_as_object(getSuper(*(fn.this_ptr)));
@@ -268,7 +268,7 @@
                        current_reg++;
                }
 
-               if (m_function2_flags & 0x20)
+               if (m_function2_flags & SUPPRESS_SUPER)
                {
                        // Don't put 'super' in a local var.
                }
@@ -278,7 +278,7 @@
                        our_env->add_local("super", 
as_value(getSuper(*(fn.this_ptr))));
                }
 
-               if (m_function2_flags & 0x40)
+               if (m_function2_flags & PRELOAD_ROOT) 
                {
                        // Put '_root' in a register.
                        our_env->local_register(current_reg).set_as_object(
@@ -286,7 +286,7 @@
                        current_reg++;
                }
 
-               if (m_function2_flags & 0x80)
+               if (m_function2_flags & PRELOAD_PARENT)
                {
                        // Put '_parent' in a register.
                        as_value parent = our_env->get_variable("_parent");
@@ -294,7 +294,7 @@
                        current_reg++;
                }
 
-               if (m_function2_flags & 0x100)
+               if (m_function2_flags & PRELOAD_GLOBAL)
                {
                        // Put '_global' in a register.
                        as_object* global = VM::get().getGlobal();

Index: server/swf_function.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf_function.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/swf_function.h       2 Jan 2007 01:50:56 -0000       1.6
+++ server/swf_function.h       9 Jan 2007 11:02:51 -0000       1.7
@@ -76,8 +76,9 @@
        bool    m_is_function2;
        uint8   m_local_register_count;
 
-       /// used by function2 to control implicit
-       /// arg register assignments
+       /// used by function2 to control implicit arg register assignments
+       // 
+       /// See 
http://sswf.sourceforge.net/SWFalexref.html#action_declare_function2
        uint16  m_function2_flags;
 
        /// Return a pointer to the given object's superclass interface
@@ -93,6 +94,41 @@
 
 public:
 
+       enum SWFDefineFunction2Flags
+       {
+               /// Bind one register to "this" 
+               PRELOAD_THIS = 0x01, // 1
+
+               /// No "this" variable accessible by-name 
+               SUPPRESS_THIS = 0x02, // 2
+
+               /// Bind one register to "arguments" 
+               PRELOAD_ARGUMENTS = 0x04, // 4
+
+               /// No "argument" variable accessible by-name 
+               SUPPRESS_ARGUMENTS = 0x08, // 8
+
+               /// Bind one register to "super" 
+               PRELOAD_SUPER = 0x10, // 16
+
+               /// No "super" variable accessible by-name 
+               SUPPRESS_SUPER = 0x20, // 32
+
+               /// Bind one register to "_root" 
+               PRELOAD_ROOT = 0x40, // 64
+
+               /// Bind one register to "_parent" 
+               PRELOAD_PARENT = 0x80, // 128
+
+               /// Bind one register to "_global" 
+               //
+               /// TODO: check this. See 
http://sswf.sourceforge.net/SWFalexref.html#action_declare_function2
+               ///       Looks like flags would look swapped
+               PRELOAD_GLOBAL = 256 // 0x100
+
+       };
+
+
        ~swf_function();
 
        /// Default constructor




reply via email to

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