gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/gnash.h server/movie_roo...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/gnash.h server/movie_roo...
Date: Sat, 24 May 2008 13:41:11 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/05/24 13:41:11

Modified files:
        .              : ChangeLog 
        server         : gnash.h movie_root.cpp movie_root.h 
                         sprite_instance.cpp sprite_instance.h 
        server/vm      : action.cpp action.h 

Log message:
                * server/vm/action.{cpp,h}: drop unused call_method{1,2,3,4} and
                  va_list call_method_parsed. Drop unused variables. Replace 
snprintf
                  (error message) with boost::format (speed shouldn't be an 
issue
                  here).
                * server/sprite_instance.{cpp,h}: drop virtual call_method_args
                  (va_list method).
                * server/movie_instance.{h,cpp}: drop call_method_args and 
unused
                  call_method (the only caller of call_method_args).
                * server/gnash.h: drop <cstdarg> include.
        
                None of these are used at the moment, are all very old, and the
                possible use (fscommand) mentioned in documents is already
                implemented.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6698&r2=1.6699
http://cvs.savannah.gnu.org/viewcvs/gnash/server/gnash.h?cvsroot=gnash&r1=1.121&r2=1.122
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.195&r2=1.196
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.130&r2=1.131
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.539&r2=1.540
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.197&r2=1.198
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/action.cpp?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/action.h?cvsroot=gnash&r1=1.16&r2=1.17

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6698
retrieving revision 1.6699
diff -u -b -r1.6698 -r1.6699
--- ChangeLog   24 May 2008 10:52:08 -0000      1.6698
+++ ChangeLog   24 May 2008 13:41:09 -0000      1.6699
@@ -1,3 +1,15 @@
+2008-05-24 Benjamin Wolsey <address@hidden>
+
+       * server/vm/action.{cpp,h}: drop unused call_method{1,2,3,4} and
+         va_list call_method_parsed. Drop unused variables. Replace snprintf
+         (error message) with boost::format (speed shouldn't be an issue
+         here).
+       * server/sprite_instance.{cpp,h}: drop virtual call_method_args
+         (va_list method).
+       * server/movie_instance.{h,cpp}: drop call_method_args and unused
+         call_method (the only caller of call_method_args).
+       * server/gnash.h: drop <cstdarg> include.
+
 2008-05-24  Rob Savoye  <address@hidden>
 
        * libnet/rtmp_server.cpp: Use swapBytes() instead of ntohl(), so

Index: server/gnash.h
===================================================================
RCS file: /sources/gnash/gnash/server/gnash.h,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -b -r1.121 -r1.122
--- server/gnash.h      21 May 2008 13:24:05 -0000      1.121
+++ server/gnash.h      24 May 2008 13:41:09 -0000      1.122
@@ -27,7 +27,6 @@
 
 #include <memory> // for auto_ptr
 #include <cctype>   // for poxy wchar_t
-#include <cstdarg>  // for va_list arg to sprite_instance::call_method_args()
 #include <string>   // for movie_definition* 
create_movie(std::auto_ptr<tu_file>
                                        // in, const std::string& url);
 

Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -b -r1.195 -r1.196
--- server/movie_root.cpp       21 May 2008 13:24:05 -0000      1.195
+++ server/movie_root.cpp       24 May 2008 13:41:10 -0000      1.196
@@ -280,7 +280,7 @@
        log_debug("Before swapLevels (source depth %d, target depth %d) levels 
are: ", oldDepth, depth);
        for (Levels::const_iterator i=_movies.begin(), e=_movies.end(); i!=e; 
++i)
        {
-               log_debug(" %d: %p (%s @ depth %d)", i->first, 
(void*)(i->second.get()), i->second->getTarget().c_str(), 
i->second->get_depth());
+               log_debug(" %d: %p (%s @ depth %d)", i->first, 
(void*)(i->second.get()), i->second->getTarget(), i->second->get_depth());
        }
 #endif
 
@@ -288,7 +288,7 @@
        {
                IF_VERBOSE_ASCODING_ERRORS(
                log_aserror(_("%s.swapDepth(%d): movie has a depth (%d) below 
static depth zone (%d), won't swap it's depth"),
-                       movie->getTarget().c_str(), depth, oldDepth, 
character::staticDepthOffset);
+                       movie->getTarget(), depth, oldDepth, 
character::staticDepthOffset);
                );
                return;
        }
@@ -297,7 +297,7 @@
        {
                IF_VERBOSE_ASCODING_ERRORS(
                log_aserror(_("%s.swapDepth(%d): movie has a depth (%d) below 
static depth zone (%d), won't swap it's depth"),
-                       movie->getTarget().c_str(), depth, oldDepth, 
character::staticDepthOffset);
+                       movie->getTarget(), depth, oldDepth, 
character::staticDepthOffset);
                );
                return;
        }
@@ -307,7 +307,7 @@
        if ( oldIt == _movies.end() )
        {
                log_debug("%s.swapDepth(%d): target depth (%d) contains no 
movie",
-                       movie->getTarget().c_str(), depth, oldNum);
+                       movie->getTarget(), depth, oldNum);
                return;
        }
 
@@ -331,7 +331,7 @@
        log_debug("After swapLevels levels are: ");
        for (Levels::const_iterator i=_movies.begin(), e=_movies.end(); i!=e; 
++i)
        {
-               log_debug(" %d: %p (%s @ depth %d)", i->first, 
(void*)(i->second.get()), i->second->getTarget().c_str(), 
i->second->get_depth());
+               log_debug(" %d: %p (%s @ depth %d)", i->first, 
(void*)(i->second.get()), i->second->getTarget(), i->second->get_depth());
        }
 #endif
        
@@ -378,7 +378,7 @@
        if (md == NULL)
        {
                log_error(_("can't create movie_definition for %s"),
-                       url.str().c_str());
+                       url.str());
                return false;
        }
 
@@ -387,7 +387,7 @@
        if (extern_movie == NULL)
        {
                log_error(_("can't create extern movie_instance "
-                       "for %s"), url.str().c_str());
+                       "for %s"), url.str());
                return false;
        }
 
@@ -546,7 +546,7 @@
                std::string objName = PROPNAME("Mouse");
                if (global->get_member(vm.getStringTable().find(objName), &val) 
)
                {
-                       //log_debug("Found member 'Mouse' in _global: %s", 
val.to_debug_string().c_str());
+                       //log_debug("Found member 'Mouse' in _global: %s", 
val.to_debug_string());
                        _mouseobject = val.to_object();
                }
        }
@@ -1126,28 +1126,6 @@
 }
 
 
-const char*
-movie_root::call_method(const char* method_name,
-               const char* method_arg_fmt, ...)
-{
-       assert(testInvariant());
-
-       va_list args;
-       va_start(args, method_arg_fmt);
-       const char* result = getRootMovie()->call_method_args(method_name,
-               method_arg_fmt, args);
-       va_end(args);
-
-       return result;
-}
-
-const
-char* movie_root::call_method_args(const char* method_name,
-               const char* method_arg_fmt, va_list args)
-{
-       assert(testInvariant());
-       return getRootMovie()->call_method_args(method_name, method_arg_fmt, 
args);
-}
 
 void movie_root::cleanupUnloadedListeners(CharacterList& ll)
 {
@@ -1262,7 +1240,7 @@
 movie_root::notify_mouse_listeners(const event_id& event)
 {
        //log_debug("Notifying %d listeners about %s",
-       //              m_mouse_listeners.size(), 
event.get_function_name().c_str());
+       //              m_mouse_listeners.size(), event.get_function_name());
 
        CharacterList copy = m_mouse_listeners;
        for (CharacterList::iterator iter = copy.begin(), itEnd=copy.end();
@@ -1620,7 +1598,7 @@
 {
        assert(lvl >= 0 && lvl < apSIZE);
 #ifdef GNASH_DEBUG
-       log_debug("Pushed action buffer for target %s", 
target->getTargetPath().c_str());
+       log_debug("Pushed action buffer for target %s", 
target->getTargetPath());
 #endif
 
        std::auto_ptr<ExecutableCode> code ( new GlobalCode(buf, target) );
@@ -1644,7 +1622,7 @@
 {
        assert(lvl >= 0 && lvl < apSIZE);
 #ifdef GNASH_DEBUG
-       log_debug("Pushed function (event hanlder?) with target %s", 
target->getTargetPath().c_str());
+       log_debug("Pushed function (event hanlder?) with target %s", 
target->getTargetPath());
 #endif
 
        std::auto_ptr<ExecutableCode> code ( new FunctionCode(func, target) );
@@ -1938,13 +1916,13 @@
        if ( ! ch->isUnloaded() )
        {
 #ifdef GNASH_DEBUG
-               log_debug("    advancing character %s", 
ch->getTarget().c_str());
+               log_debug("    advancing character %s", ch->getTarget());
 #endif
                ch->advance();
        }
 #ifdef GNASH_DEBUG
        else {
-               log_debug("    character %s is unloaded, not advancing it", 
ch->getTarget().c_str());
+               log_debug("    character %s is unloaded, not advancing it", 
ch->getTarget());
        }
 #endif
 }
@@ -2013,7 +1991,7 @@
                if ( ! o ) {
 #ifdef GNASH_DEBUG_TARGET_RESOLUTION
                        log_debug("Evaluating character target path: element 
'%s' of path '%s' not found",
-                               part.c_str(), tgtstr.c_str());
+                               part, tgtstr);
 #endif
                        return NULL;
                }
@@ -2026,7 +2004,7 @@
 void
 movie_root::loadMovie(const URL& url, const std::string& target, const 
std::string* postdata)
 {
-    log_debug("movie_root::loadMovie(%s, %s)", url.str().c_str(), 
target.c_str());
+    log_debug("movie_root::loadMovie(%s, %s)", url.str(), target);
     _loadMovieRequests.push_front(LoadMovieRequest(url, target, postdata));
 }
 
@@ -2049,14 +2027,14 @@
     character* ch = findCharacterByTarget(target);
     if ( ! ch )
     {
-        log_debug("Target %s of a loadMovie request doesn't exist at 
processing time", target.c_str());
+        log_debug("Target %s of a loadMovie request doesn't exist at 
processing time", target);
         return;
     }
 
     sprite_instance* sp = ch->to_movie();
     if ( ! sp )
     {
-        log_unimpl("loadMovie against a %s character", typeName(*ch).c_str());
+        log_unimpl("loadMovie against a %s character", typeName(*ch));
         return;
     }
 

Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -b -r1.130 -r1.131
--- server/movie_root.h 21 May 2008 13:24:05 -0000      1.130
+++ server/movie_root.h 24 May 2008 13:41:10 -0000      1.131
@@ -69,6 +69,7 @@
 #include "gnashconfig.h" //USE_SWFTREE
 #endif
 
+
 #include "smart_ptr.h" // GNASH_USE_GC
 #include "dsodefs.h" // DSOEXPORT
 #include "mouse_button_state.h" // for composition
@@ -395,23 +396,6 @@
        getRootMovie()->set_play_state(s);
     }
 
-    /// For ActionScript interfacing convenience.
-    //
-    /// TODO: check if we really  need this. I guess we might
-    ///       need for fscommand:, but we lack documentation
-    ///       about where to find the method (which level?)
-    ///
-    const char* call_method(const char* method_name,
-            const char* method_arg_fmt, ...);
-
-    /// For ActionScript interfacing convenience.
-    //
-    /// TODO: check if we really  need this. I guess we might
-    ///       need for fscommand:, but we lack documentation
-    ///       about where to find the method (which level?)
-    ///
-    const char* call_method_args(const char* method_name,
-            const char* method_arg_fmt, va_list args);
 
     void * get_userdata() { return m_userdata; }
     void set_userdata(void * ud ) { m_userdata = ud;  }

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.539
retrieving revision 1.540
diff -u -b -r1.539 -r1.540
--- server/sprite_instance.cpp  23 May 2008 07:33:26 -0000      1.539
+++ server/sprite_instance.cpp  24 May 2008 13:41:10 -0000      1.540
@@ -4214,16 +4214,6 @@
   m_display_list.dump_character_tree(prefix+" ");
 }
 
-const char*
-sprite_instance::call_method_args(const char* method_name,
-    const char* method_arg_fmt, va_list args)
-{
-    // Keep m_as_environment alive during any method calls!
-    boost::intrusive_ptr<as_object> this_ptr(this);
-
-    return call_method_parsed(&m_as_environment, this,
-    method_name, method_arg_fmt, args);
-}
 
 /// register characters as key listeners if they have clip key events defined.
 /// Don't call twice for the same chracter.

Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -b -r1.197 -r1.198
--- server/sprite_instance.h    16 May 2008 10:22:15 -0000      1.197
+++ server/sprite_instance.h    24 May 2008 13:41:10 -0000      1.198
@@ -608,10 +608,6 @@
            on_event(event_id::LOAD_PROGRESS);
        }
 
-       /// Call a method with a list of arguments
-       virtual const char* call_method_args(const char* method_name,
-               const char* method_arg_fmt, va_list args);
-
        // inherited from character class, see dox in character.h
        as_environment& get_environment() {
                return m_as_environment;

Index: server/vm/action.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/action.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/vm/action.cpp        7 May 2008 09:41:14 -0000       1.37
+++ server/vm/action.cpp        24 May 2008 13:41:10 -0000      1.38
@@ -17,9 +17,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
 
 #include "action.h"
 #include "as_object.h"
@@ -34,17 +31,10 @@
 #include "StringPredicates.h"
 #include "namedStrings.h"
 
-
 #include <typeinfo>
 #include <string>
 #include <algorithm>
-
-using namespace gnash;
-using namespace SWF;
-
-#if defined(_WIN32) || defined(WIN32)
-#define snprintf _snprintf
-#endif // _WIN32
+#include <boost/format.hpp>
 
 
 namespace gnash {
@@ -53,8 +43,6 @@
 // action stuff
 //
 
-// Statics.
-bool   s_inited = false;
 
 void register_component(const std::string& name, as_c_function_ptr handler)
 {
@@ -92,12 +80,10 @@
                }
                else
                {
-                       char buf[256];
-                       snprintf(buf, 256, _("Attempt to call a value which is 
neither a C nor an ActionScript function (%s)"),
-                               method.to_debug_string().c_str());
-                       buf[255] = '\0';
-               
-                       throw ActionTypeError(buf);
+                       boost::format fmt =
+                                   boost::format(_("Attempt to call a value 
which is neither a "
+                                                   "C nor an ActionScript 
function (%s)")) % method;
+                       throw ActionTypeError(fmt.str());
                }
        }
        catch (ActionTypeError& e)
@@ -120,117 +106,6 @@
     return call_method(method, env, this_ptr, 0, env->get_top_index() + 1);
 }
 
-// Printf-like vararg interface for calling ActionScript.
-// Handy for external binding.
-const char*    call_method_parsed(
-    as_environment* env,
-    as_object* this_ptr,
-    const char* method_name,
-    const char* method_arg_fmt,
-    va_list args)
-{
-    log_debug(_("FIXME(%d): %s"), __LINE__, __FUNCTION__);
-
-    // Parse va_list args
-    int        starting_index = env->get_top_index();
-    const char* p = method_arg_fmt;
-    for (;; p++)
-       {
-           char        c = *p;
-           if (c == 0)
-               {
-                   // End of args.
-                   break;
-               }
-           else if (c == '%')
-               {
-                   p++;
-                   c = *p;
-                   // Here's an arg.
-                   if (c == 'd')
-                       {
-                           // Integer.
-                           env->push(va_arg(args, int));
-                       }
-                   else if (c == 'f')
-                       {
-                           // Double
-                           env->push(va_arg(args, double));
-                       }
-                   else if (c == 's')
-                       {
-                           // String
-                           env->push(va_arg(args, const char *));
-                       }
-                   else if (c == 'l')
-                       {
-                           p++;
-                           c = *p;
-                           if (c == 's')
-                               {
-                                   // Wide string.
-                                   env->push(va_arg(args, const wchar_t *));
-                               }
-                           else
-                               {
-                                   log_error(_("call_method_parsed('%s','%s') 
-- invalid fmt '%%l%c'"),
-                                             method_name,
-                                             method_arg_fmt,
-                                             c);
-                               }
-                       }
-                   else
-                       {
-                           // Invalid fmt, warn.
-                           log_error(_("call_method_parsed('%s','%s') -- 
invalid fmt '%%%c'"),
-                                     method_name,
-                                     method_arg_fmt,
-                                     c);
-                       }
-               }
-           else
-               {
-                   // Ignore whitespace and commas.
-                   if (c == ' ' || c == '\t' || c == ',')
-                       {
-                           // OK
-                       }
-                   else
-                       {
-                           // Invalid arg; warn.
-                           log_error(_("call_method_parsed('%s','%s') -- 
invalid char '%c'"),
-                                     method_name,
-                                     method_arg_fmt,
-                                     c);
-                       }
-               }
-       }
-
-    as_value   method = env->get_variable(method_name);
-
-    // check method
-
-    // Reverse the order of pushed args
-    int        nargs = env->get_top_index() - starting_index;
-    for (int i = 0; i < (nargs >> 1); i++)
-       {
-           int i0 = starting_index + 1 + i;
-           int i1 = starting_index + nargs - i;
-           assert(i0 < i1);
-
-           std::swap(env->bottom(i0), env->bottom(i1));
-       }
-
-    // Do the call.
-    as_value   result = call_method(method, env, this_ptr, nargs, 
env->get_top_index());
-    env->drop(nargs);
-
-    // Return pointer to static string for return value.
-    static std::string s_retval;
-    s_retval = result.to_string();
-    return s_retval.c_str();
-}
-
 
 //
 // event_id

Index: server/vm/action.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/action.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- server/vm/action.h  26 Mar 2008 21:34:23 -0000      1.16
+++ server/vm/action.h  24 May 2008 13:41:10 -0000      1.17
@@ -30,9 +30,6 @@
 
 #include <cwchar>
 
-#ifdef __sgi
-       __SGI_LIBC_USING_FROM_STD(va_list) 
-#endif
 
 namespace gnash {
        class sprite_instance;
@@ -42,8 +39,6 @@
        class swf_function;
 
 
-       extern DSOEXPORT boost::intrusive_ptr<as_object> s_global;
-
        class DSOLOCAL as_property_interface
        {
        public:
@@ -57,15 +52,6 @@
 
        // Dispatching methods from C++.
        as_value        call_method0(const as_value& method, as_environment* 
env, as_object* this_ptr);
-       as_value        call_method1(
-               const as_value& method, as_environment* env, as_object* 
this_ptr,
-               const as_value& arg0);
-       as_value        call_method2(
-               const as_value& method, as_environment* env, as_object* 
this_ptr,
-               const as_value& arg0, const as_value& arg1);
-       as_value        call_method3(
-               const as_value& method, as_environment* env, as_object* 
this_ptr,
-               const as_value& arg0, const as_value& arg1, const as_value& 
arg2);
 
        /// Call a method, be it an as_function or a c_function. 
        //
@@ -81,22 +67,6 @@
                as_object* this_ptr, // this is ourself
                int nargs, int first_arg_bottom_index, as_object* super=NULL);
 
-       const char*     call_method_parsed(
-               as_environment* env,
-               as_object* this_ptr,
-               const char* method_name,
-               const char* method_arg_fmt,
-               va_list args);
-
-       // tulrich: don't use this!  To register a class constructor,
-       // just assign the classname to the constructor function.  E.g.:
-       //
-       // my_movie->set_member("MyClass", 
as_value(MyClassConstructorFunction));
-       // 
-       //void register_as_object(const char* object_name, as_c_function_ptr 
handler);
-
-       // deprecated, use sprite_instance::loadMovie
-       //void attach_extern_movie(const char* c_url, const sprite_instance* 
target, const sprite_instance* root_movie);
 
 }      // end namespace gnash
 




reply via email to

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