gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/as_environment.cpp serve...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/as_environment.cpp serve...
Date: Thu, 07 Dec 2006 14:16:46 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/12/07 14:16:46

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

Log message:
                * server/as_environment.{cpp,h}: registers
                  debugging functions moved to implementation
                  file, don't print local registers if empty.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1877&r2=1.1878
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.h?cvsroot=gnash&r1=1.28&r2=1.29

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1877
retrieving revision 1.1878
diff -u -b -r1.1877 -r1.1878
--- ChangeLog   7 Dec 2006 13:11:53 -0000       1.1877
+++ ChangeLog   7 Dec 2006 14:16:46 -0000       1.1878
@@ -1,5 +1,8 @@
 2006-12-07 Sandro Santilli <address@hidden>
 
+       * server/as_environment.{cpp,h}: registers 
+         debugging functions moved to implementation
+         file, don't print local registers if empty.
        * server/asobj/NetStream.cpp (ctor): don't
          abort on ActionScript coding errors.
 

Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- server/as_environment.cpp   24 Nov 2006 14:50:30 -0000      1.32
+++ server/as_environment.cpp   7 Dec 2006 14:16:46 -0000       1.33
@@ -16,7 +16,7 @@
 
 //
 
-/* $Id: as_environment.cpp,v 1.32 2006/11/24 14:50:30 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.33 2006/12/07 14:16:46 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -294,27 +294,6 @@
 }
 
 
-#if 0
-as_value*
-as_environment::local_register_ptr(unsigned int reg)
-{
-       // We index the registers from the end of the register
-       // array, so we don't have to keep base/frame
-       // pointers.
-
-       if (reg > m_local_register.size())
-       {
-               log_error("Invalid local register %d, stack only has "
-                       "%ld entries",
-                       reg, m_local_register.size());
-       
-               return &m_global_register[0];
-       }
-    
-       return &m_local_register[m_local_register.size() - reg];
-}
-#endif
-
 // Search the active frame for the named var; return its index
 // in the m_local_frames stack if found.
 // 
@@ -497,6 +476,32 @@
        return md->get_version();
 }
 
+void
+as_environment::dump_local_registers(std::ostream& out) const
+{
+       size_t n=m_local_register.size();
+       if ( ! n ) return;
+       out << "Local registers: ";
+       for (unsigned int i=0; i<n; i++)
+       {
+               if (i) out << " | ";
+               out << '"' << m_local_register[i].to_string() << '"';
+       }
+       out << std::endl;
+}
+
+void
+as_environment::dump_global_registers(std::ostream& out) const
+{
+       out << "Global registers: ";
+       for (unsigned int i=0; i<4; ++i)
+       {
+               if (i) out << " | ";
+               out << '"' << m_global_register[i].to_string() << '"';
+       }
+       out << std::endl;
+}
+
 }
 
 

Index: server/as_environment.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- server/as_environment.h     3 Nov 2006 14:03:37 -0000       1.28
+++ server/as_environment.h     7 Dec 2006 14:16:46 -0000       1.29
@@ -18,7 +18,7 @@
 //
 //
 
-/* $Id: as_environment.h,v 1.28 2006/11/03 14:03:37 strk Exp $ */
+/* $Id: as_environment.h,v 1.29 2006/12/07 14:16:46 strk Exp $ */
 
 #ifndef GNASH_AS_ENVIRONMENT_H
 #define GNASH_AS_ENVIRONMENT_H
@@ -209,16 +209,6 @@
        void    drop_local_registers(unsigned int register_count);
 
        /// \brief
-       /// Return a pointer to the specified local register.
-       /// Local registers are numbered starting with 1.
-       //
-       /// Return value will never be NULL.  If reg is out of bounds,
-       /// we log an error, but still return a valid pointer (to
-       /// global reg[0]).  So the behavior is a bit undefined, but
-       /// not dangerous.
-       //as_value* local_register_ptr(unsigned int reg);
-
-       /// \brief
        /// Return a reference to the Nth local register.
        as_value& local_register(uint8_t n);
 
@@ -255,28 +245,14 @@
        }
 
        /// Dump the local registers to a std::ostream
-       void dump_local_registers(std::ostream& out=std::cerr)
-       {
-               out << "Local registers: ";
-               for (unsigned int i=0, n=m_local_register.size(); i<n; i++)
-               {
-                       if (i) out << " | ";
-                       out << '"' << m_local_register[i].to_string() << '"';
-               }
-               out << std::endl;
-       }
+       //
+       /// NOTE that nothing will be written to the stream if NO local 
registers
+       ///      are set
+       ///
+       void dump_local_registers(std::ostream& out=std::cerr) const;
 
        /// Dump the global registers to a std::ostream
-       void dump_global_registers(std::ostream& out=std::cerr)
-       {
-               out << "Global registers: ";
-               for (unsigned int i=0; i<4; ++i)
-               {
-                       if (i) out << " | ";
-                       out << '"' << m_global_register[i].to_string() << '"';
-               }
-               out << std::endl;
-       }
+       void dump_global_registers(std::ostream& out=std::cerr) const;
 
        /// Return the SWF version we're running for.
        //




reply via email to

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