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: Mon, 16 Apr 2007 18:23:06 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/04/16 18:23:06

Modified files:
        .              : ChangeLog 
        server         : as_environment.cpp as_value.cpp as_value.h 
                         debugger.cpp debugger.h edit_text_character.cpp 
                         movie_root.h sprite_instance.cpp 
                         sprite_instance.h timers.cpp 
        server/asobj   : LoadVars.cpp Object.cpp Sound.cpp Sound.h 
                         Stage.cpp string.cpp xml.cpp xmlnode.cpp 
                         xmlsocket.cpp 
        server/vm      : ASHandlers.cpp 
        testsuite/server: GetterSetterTest.cpp 

Log message:
                 Drop as_value::to_std_string() - update all callers.
                 Deprecated sprite_instance::get_variable.
                 Cost-corrected debugger interfaces.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2890&r2=1.2891
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.cpp?cvsroot=gnash&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.h?cvsroot=gnash&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/gnash/server/debugger.cpp?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/debugger.h?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.244&r2=1.245
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.97&r2=1.98
http://cvs.savannah.gnu.org/viewcvs/gnash/server/timers.cpp?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/LoadVars.cpp?cvsroot=gnash&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Object.cpp?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Sound.cpp?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Sound.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Stage.cpp?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/string.cpp?cvsroot=gnash&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xml.cpp?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xmlnode.cpp?cvsroot=gnash&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xmlsocket.cpp?cvsroot=gnash&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/server/GetterSetterTest.cpp?cvsroot=gnash&r1=1.9&r2=1.10

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2890
retrieving revision 1.2891
diff -u -b -r1.2890 -r1.2891
--- ChangeLog   16 Apr 2007 16:47:29 -0000      1.2890
+++ ChangeLog   16 Apr 2007 18:23:05 -0000      1.2891
@@ -1,5 +1,21 @@
 2007-04-16 Sandro Santilli <address@hidden>
 
+       * server/as_environment.cpp, server/as_value.cpp,
+       server/as_value.h, server/debugger.cpp, server/debugger.h,
+       server/edit_text_character.cpp, server/movie_root.h,
+       server/sprite_instance.cpp, server/sprite_instance.h,
+       server/timers.cpp, server/asobj/LoadVars.cpp,
+       server/asobj/Object.cpp, server/asobj/Sound.cpp,
+       server/asobj/Sound.h, server/asobj/Stage.cpp,
+       server/asobj/string.cpp, server/asobj/xml.cpp,
+       server/asobj/xmlnode.cpp, server/asobj/xmlsocket.cpp,
+       server/vm/ASHandlers.cpp, testsuite/server/GetterSetterTest.cpp:
+        Drop as_value::to_std_string() - update all callers.
+        Deprecated sprite_instance::get_variable.
+        Cost-corrected debugger interfaces.
+
+2007-04-16 Sandro Santilli <address@hidden>
+
        * server/as_environment.{cpp,h}: add a parse_path method to
          return an actual object when the given parameter is actually
          a path.

Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- server/as_environment.cpp   16 Apr 2007 16:47:29 -0000      1.68
+++ server/as_environment.cpp   16 Apr 2007 18:23:05 -0000      1.69
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
 
 //
 
-/* $Id: as_environment.cpp,v 1.68 2007/04/16 16:47:29 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.69 2007/04/16 18:23:05 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -444,7 +444,7 @@
        }
        else if ( val.is_string() )
        {
-               return find_target(val.to_std_string());
+               return find_target(val.to_string());
        }
        else
        {

Index: server/as_value.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_value.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- server/as_value.cpp 15 Apr 2007 10:52:09 -0000      1.36
+++ server/as_value.cpp 16 Apr 2007 18:23:05 -0000      1.37
@@ -66,11 +66,13 @@
     }
 }
 
+#if 0
 std::string
 as_value::to_std_string(as_environment* env) const
 {
     return to_string(env);
 }
+#endif
 
 // Conversion to const std::string&.
 const std::string&

Index: server/as_value.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_value.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- server/as_value.h   15 Apr 2007 10:52:09 -0000      1.43
+++ server/as_value.h   16 Apr 2007 18:23:05 -0000      1.44
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: as_value.h,v 1.43 2007/04/15 10:52:09 bjacques Exp $ */
+/* $Id: as_value.h,v 1.44 2007/04/16 18:23:05 strk Exp $ */
 
 #ifndef GNASH_AS_VALUE_H
 #define GNASH_AS_VALUE_H
@@ -282,7 +282,7 @@
        ///     for object values. If NULL, toString() won't be run.
        ///
        const std::string& to_string(as_environment* env=NULL) const;
-       std::string to_std_string(as_environment* env=NULL) const;
+       //std::string to_std_string(as_environment* env=NULL) const;
 
        std::string to_debug_string() const;
 

Index: server/debugger.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/debugger.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/debugger.cpp 16 Apr 2007 07:37:08 -0000      1.15
+++ server/debugger.cpp 16 Apr 2007 18:23:05 -0000      1.16
@@ -464,7 +464,7 @@
 }
 
 void
-Debugger::setWatchPoint(std::string &var, watch_state_e state)
+Debugger::setWatchPoint(const std::string &var, watch_state_e state)
 {
 //    GNASH_REPORT_FUNCTION;
     _watchpoints[var] = state;
@@ -472,7 +472,7 @@
 }
 
 void
-Debugger::removeWatchPoint(std::string &var)
+Debugger::removeWatchPoint(const std::string &var)
 {
 //    GNASH_REPORT_FUNCTION;
     
@@ -578,7 +578,7 @@
 //                 cerr << name << " ";
 //             }
 //         }
-            cerr << env.m_stack[i].to_string();
+            cerr << env.m_stack[i].to_debug_string();
            if (val.is_object()) {
                boost::intrusive_ptr<as_object> o = val.to_object();
                string name = lookupSymbol(o.get());
@@ -629,21 +629,21 @@
     dbglogfile << "Global Registers Dump:" << endl;
     for (unsigned int i=0; i<4; ++i) {
        ss << "\treg #" << i << ": \"";
-       ss << env.global_register(i).to_std_string() << "\"" << endl;
+       ss << env.global_register(i).to_debug_string() << "\"" << endl;
     }
     cerr << ss.str().c_str() << endl;
 }
 
     // Change the value of a local variable
 void
-Debugger::changeLocalVariable(std::string &var, as_value &val)
+Debugger::changeLocalVariable(const std::string &var, as_value &val)
 {
 //    GNASH_REPORT_FUNCTION;
     changeLocalVariable(*_env, var, val);
 }
 
 void
-Debugger::changeLocalVariable(as_environment &env, std::string &var, as_value 
&val)
+Debugger::changeLocalVariable(as_environment &env, const std::string &var, 
as_value &val)
 {
 //    GNASH_REPORT_FUNCTION;
     env.set_local(var, val);

Index: server/debugger.h
===================================================================
RCS file: /sources/gnash/gnash/server/debugger.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- server/debugger.h   16 Apr 2007 07:37:08 -0000      1.10
+++ server/debugger.h   16 Apr 2007 18:23:05 -0000      1.11
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: debugger.h,v 1.10 2007/04/16 07:37:08 strk Exp $ */
+/* $Id: debugger.h,v 1.11 2007/04/16 18:23:05 strk Exp $ */
 
 #ifndef __DEBUGGER_H__
 #define __DEBUGGER_H__
@@ -58,8 +58,8 @@
 
     /// Set a watchpoint of a variable. Gnash stops and generates a
     /// command prompt when there is a match.
-    void setWatchPoint(std::string &var, watch_state_e state);
-    void removeWatchPoint(std::string &var);
+    void setWatchPoint(const std::string &var, watch_state_e state);
+    void removeWatchPoint(const std::string &var);
     void dumpWatchPoints();
 
     /// What to do when we've hit a breakpoint
@@ -118,8 +118,8 @@
     void changeStackValue(as_environment &env, int index, as_value &val);
     
     // Change the value of a local variable
-    void changeLocalVariable(std::string &var, as_value &val);
-    void changeLocalVariable(as_environment &env, std::string &var, as_value 
&val);
+    void changeLocalVariable(const std::string &var, as_value &val);
+    void changeLocalVariable(as_environment &env, const std::string &var, 
as_value &val);
     
     // Change the value of a local variable
     void changeLocalRegister(unsigned index, as_value &val);

Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- server/edit_text_character.cpp      15 Apr 2007 18:50:29 -0000      1.55
+++ server/edit_text_character.cpp      16 Apr 2007 18:23:05 -0000      1.56
@@ -15,7 +15,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 
-/* $Id: edit_text_character.cpp,v 1.55 2007/04/15 18:50:29 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.56 2007/04/16 18:23:05 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -79,7 +79,7 @@
        boost::intrusive_ptr<edit_text_character> text = 
ensureType<edit_text_character>(fn.this_ptr);
 
        assert ( fn.nargs > 0 );
-       std::string newname = fn.arg(0).to_std_string();
+       const std::string& newname = fn.arg(0).to_string(&fn.env());
 
        text->set_variable_name(newname);
 

Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- server/movie_root.h 11 Apr 2007 14:20:20 -0000      1.47
+++ server/movie_root.h 16 Apr 2007 18:23:05 -0000      1.48
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: movie_root.h,v 1.47 2007/04/11 14:20:20 strk Exp $ */
+/* $Id: movie_root.h,v 1.48 2007/04/16 18:23:05 strk Exp $ */
 
 /// \page events_handling Handling of user events
 ///
@@ -348,12 +348,6 @@
                _movie->set_variable(path_to_var, new_value);
        }
 
-       /// Delegate to wrapped movie_instance
-       const char* get_variable(const char* path_to_var) const
-       {
-               return _movie->get_variable(path_to_var);
-       }
-
        /// For ActionScript interfacing convenience.
        const char* call_method(const char* method_name,
                        const char* method_arg_fmt, ...);

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.244
retrieving revision 1.245
diff -u -b -r1.244 -r1.245
--- server/sprite_instance.cpp  16 Apr 2007 11:19:48 -0000      1.244
+++ server/sprite_instance.cpp  16 Apr 2007 18:23:05 -0000      1.245
@@ -145,7 +145,7 @@
        }
 
        // Get exported resource 
-       std::string id_name = fn.arg(0).to_std_string();
+       const std::string& id_name = fn.arg(0).to_string(&fn.env());
 
        boost::intrusive_ptr<resource> exported = 
sprite->get_movie_definition()->get_exported_resource(id_name.c_str());
        if ( exported == NULL )
@@ -170,7 +170,7 @@
                return rv;
        }
 
-       std::string newname = fn.arg(1).to_std_string();
+       const std::string& newname = fn.arg(1).to_string(&fn.env());
 
        // should we support negative depths ? YES !
        int depth_val = uint16_t(fn.arg(2).to_number());
@@ -394,7 +394,7 @@
                return as_value();
        }
 
-       std::string newname = fn.arg(0).to_std_string(&(fn.env()));
+       const std::string& newname = fn.arg(0).to_string(&fn.env());
        int depth = int(fn.arg(1).to_number());
 
        boost::intrusive_ptr<sprite_instance> ch;
@@ -510,7 +510,7 @@
                return as_value();
        }
 
-       std::string urlstr = fn.arg(0).to_std_string();
+       const std::string& urlstr = fn.arg(0).to_string(&fn.env());
        if (urlstr.empty())
        {
                IF_VERBOSE_ASCODING_ERRORS(
@@ -558,7 +558,7 @@
                return as_value();
        }
 
-       std::string urlstr = fn.arg(0).to_std_string();
+       const std::string& urlstr = fn.arg(0).to_string(&fn.env());
        if (urlstr.empty())
        {
                IF_VERBOSE_ASCODING_ERRORS(
@@ -577,7 +577,7 @@
 
        if (fn.nargs > 1)
        {
-               std::string methodstring = fn.arg(1).to_std_string();
+               const std::string& methodstring = 
fn.arg(1).to_string(&fn.env());
                // Should we be case-insensitive in comparing these ?
                if ( methodstring == "GET" ) method = 1;
                else if ( methodstring == "POST" ) method = 2;
@@ -1687,13 +1687,13 @@
 
        as_environment* env = const_cast<as_environment*>(&m_as_environment);
 
-       as_value str(frame_spec.to_std_string(env));
+       as_value str(frame_spec.to_string(env));
 
        double num =  str.to_number(env);
 
        if ( ! isfinite(num) || int(num) != num )
        {
-               return m_def->get_labeled_frame(frame_spec.to_std_string(env), 
frameno);
+               return m_def->get_labeled_frame(frame_spec.to_string(env), 
frameno);
        }
 
        // TODO: are we sure we shouldn't check for frames labeled with 
negative numbers ?
@@ -1988,7 +1988,7 @@
                const as_value& val)
 {
 #ifdef DEBUG_DYNTEXT_VARIABLES
-log_msg("sprite[%p]::set_member(%s, %s)", (void*)this, name.c_str(), 
val.to_string().c_str());
+log_msg("sprite[%p]::set_member(%s, %s)", (void*)this, name.c_str(), 
val.to_debug_string().c_str());
 #endif
 
        if ( val.is_function() )
@@ -2011,7 +2011,8 @@
 #ifdef DEBUG_DYNTEXT_VARIABLES
                log_msg(" it's a Text Variable!");
 #endif
-               etc->set_text_value(val.to_string().c_str());
+               as_environment* env = 
const_cast<as_environment*>(&m_as_environment);
+               etc->set_text_value(val.to_string(env).c_str());
        }
 #ifdef DEBUG_DYNTEXT_VARIABLES
        else
@@ -2025,23 +2026,6 @@
 
 }
 
-const char* sprite_instance::get_variable(const char* path_to_var) const
-{
-    assert(m_parent == NULL);  // should only be called on the root movie.
-
-    std::string path(path_to_var);
-
-    // NOTE: this is static so that the string
-    // value won't go away after we return!!!
-    // It'll go away during the next call to this
-    // function though!!!  NOT THREAD SAFE!
-    static as_value    val;
-
-    val = m_as_environment.get_variable(path);
-
-    return val.to_string().c_str();    // ack!
-}
-
 void sprite_instance::set_variable(const char* path_to_var,
                const wchar_t* new_value)
 {

Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- server/sprite_instance.h    15 Apr 2007 10:52:09 -0000      1.97
+++ server/sprite_instance.h    16 Apr 2007 18:23:06 -0000      1.98
@@ -17,7 +17,7 @@
 // 
 //
 
-/* $Id: sprite_instance.h,v 1.97 2007/04/15 10:52:09 bjacques Exp $ */
+/* $Id: sprite_instance.h,v 1.98 2007/04/16 18:23:06 strk Exp $ */
 
 // Stateful live Sprite instance
 
@@ -502,12 +502,11 @@
                const char* new_value);
 
        /// Set the named variable to the wide value
+       //
+       /// TODO: check if worth deprecating
        virtual void set_variable(const char* path_to_var,
                const wchar_t* new_value);
 
-       /// Returns address to static buffer. NOT THREAD SAFE!
-       virtual const char* get_variable(const char* path_to_var) const;
-
        // See dox in as_object.h
        bool get_member(const std::string& name, as_value* val);
 

Index: server/timers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/timers.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- server/timers.cpp   11 Apr 2007 17:54:21 -0000      1.29
+++ server/timers.cpp   16 Apr 2007 18:23:06 -0000      1.30
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 //
 //
 
-/* $Id: timers.cpp,v 1.29 2007/04/11 17:54:21 bjacques Exp $ */
+/* $Id: timers.cpp,v 1.30 2007/04/16 18:23:06 strk Exp $ */
 
 #include "timers.h"
 #include "as_function.h" // for class as_function
@@ -170,7 +170,7 @@
        if ( ! as_func )
        {
                as_value method;
-               std::string method_name = fn.arg(1).to_std_string();
+               const std::string& method_name = fn.arg(1).to_string(&fn.env());
                if ( ! obj->get_member(method_name, &method) )
                {
                        IF_VERBOSE_ASCODING_ERRORS(

Index: server/asobj/LoadVars.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/LoadVars.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- server/asobj/LoadVars.cpp   14 Apr 2007 15:53:17 -0000      1.20
+++ server/asobj/LoadVars.cpp   16 Apr 2007 18:23:06 -0000      1.21
@@ -529,7 +529,7 @@
                return as_value(false);
        }
 
-       std::string urlstr = fn.arg(0).to_std_string();
+       const std::string& urlstr = fn.arg(0).to_string();
        if ( urlstr.empty() )
        {
                IF_VERBOSE_ASCODING_ERRORS(
@@ -565,7 +565,7 @@
                return as_value(false);
        }
 
-       std::string urlstr = fn.arg(0).to_std_string();
+       const std::string& urlstr = fn.arg(0).to_string();
        if ( urlstr.empty() )
        {
                IF_VERBOSE_ASCODING_ERRORS(
@@ -585,7 +585,7 @@
 
        // Post by default, override by ActionScript third argument
        bool post = true;
-       if ( fn.nargs > 2 && fn.arg(2).to_std_string() == "GET" ) post = false;
+       if ( fn.nargs > 2 && fn.arg(2).to_string() == "GET" ) post = false;
 
        //log_msg("LoadVars.sendAndLoad(%s, %p) called, and returning TRUE", 
urlstr.c_str(), target.get());
 

Index: server/asobj/Object.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Object.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- server/asobj/Object.cpp     15 Apr 2007 10:52:09 -0000      1.22
+++ server/asobj/Object.cpp     16 Apr 2007 18:23:06 -0000      1.23
@@ -18,7 +18,7 @@
 //
 //
 
-/* $Id: Object.cpp,v 1.22 2007/04/15 10:52:09 bjacques Exp $ */
+/* $Id: Object.cpp,v 1.23 2007/04/16 18:23:06 strk Exp $ */
 
 // Implementation of ActionScript Object class.
 
@@ -182,7 +182,7 @@
                }
        }
 
-       std::string propname = fn.arg(0).to_string();
+       const std::string& propname = fn.arg(0).to_string(&(fn.env()));
        if ( propname.empty() )
        {
                IF_VERBOSE_ASCODING_ERRORS(
@@ -246,7 +246,7 @@
                }
        }
 
-       std::string symbolid = fn.arg(0).to_std_string();
+       const std::string& symbolid = fn.arg(0).to_string(&(fn.env()));
        if ( symbolid.empty() )
        {
                IF_VERBOSE_ASCODING_ERRORS(
@@ -319,11 +319,11 @@
                return as_value();
        }
        as_value& arg = fn.arg(0);
-       std::string propname = arg.to_std_string();
+       const std::string& propname = arg.to_string(&(fn.env()));
        if ( arg.is_undefined() || propname.empty() )
        {
                IF_VERBOSE_ASCODING_ERRORS(
-               log_aserror("Invalid call to Object.hasOwnProperty('%s')", 
arg.to_string().c_str());
+               log_aserror("Invalid call to Object.hasOwnProperty('%s')", 
arg.to_debug_string().c_str());
                );
                return as_value();
        }
@@ -342,11 +342,11 @@
                return as_value();
        }
        as_value& arg = fn.arg(0);
-       std::string propname = arg.to_std_string();
+       const std::string& propname = arg.to_string(&(fn.env()));
        if ( arg.is_undefined() || propname.empty() )
        {
                IF_VERBOSE_ASCODING_ERRORS(
-               log_aserror("Invalid call to 
Object.isPropertyEnumerable('%s')", arg.to_string().c_str());
+               log_aserror("Invalid call to 
Object.isPropertyEnumerable('%s')", arg.to_debug_string().c_str());
                );
                return as_value();
        }

Index: server/asobj/Sound.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Sound.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- server/asobj/Sound.cpp      15 Apr 2007 10:52:09 -0000      1.13
+++ server/asobj/Sound.cpp      16 Apr 2007 18:23:06 -0000      1.14
@@ -71,7 +71,7 @@
 
 
 void
-Sound::attachSound(int si, const char* name)
+Sound::attachSound(int si, const std::string& name)
 {
        soundId = si;
        soundName = name;
@@ -281,7 +281,7 @@
        int si = -1;
 
        if (fn.nargs > 0) {
-               const char* name = fn.arg(0).to_string().c_str();
+               const std::string& name = fn.arg(0).to_string(&(fn.env()));
 
                // check the import.
                movie_definition* def = 
fn.env().get_target()->get_root_movie()->get_movie_definition();
@@ -290,7 +290,7 @@
                if (res == NULL)
                {
                        IF_VERBOSE_MALFORMED_SWF(
-                   log_swferror("import error: resource '%s' is not exported", 
name);
+                   log_swferror("import error: resource '%s' is not exported", 
name.c_str());
                        );
                    return as_value();
                }
@@ -327,10 +327,10 @@
 
        boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
 
-    const char* name = fn.arg(0).to_string().c_str();
-    if (!name) {
+    const std::string& name = fn.arg(0).to_string(&(fn.env()));
+    if (name.empty()) {
                IF_VERBOSE_ASCODING_ERRORS(
-               log_aserror("attachSound need a non-null argument");
+               log_aserror("attachSound need a non-empty string");
                );
                return as_value();
        }
@@ -342,7 +342,7 @@
        if (res == NULL)
        {
                IF_VERBOSE_MALFORMED_SWF(
-               log_swferror("import error: resource '%s' is not exported", 
name);
+               log_swferror("import error: resource '%s' is not exported", 
name.c_str());
                        );
                return as_value();
        }
@@ -437,7 +437,7 @@
        }
 
        boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
-       so->loadSound(fn.arg(0).to_std_string(), fn.arg(1).to_bool());
+       so->loadSound(fn.arg(0).to_string(&(fn.env())), fn.arg(1).to_bool());
 
        return as_value();
 }

Index: server/asobj/Sound.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Sound.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/asobj/Sound.h        9 Mar 2007 14:38:29 -0000       1.3
+++ server/asobj/Sound.h        16 Apr 2007 18:23:06 -0000      1.4
@@ -40,7 +40,7 @@
 public:
        Sound();
        ~Sound();
-       virtual void attachSound(int si, const char* name);
+       virtual void attachSound(int si, const std::string& name);
        virtual void getBytesLoaded();
        virtual void getBytesTotal();
        virtual void getPan();

Index: server/asobj/Stage.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Stage.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- server/asobj/Stage.cpp      29 Mar 2007 12:42:32 -0000      1.10
+++ server/asobj/Stage.cpp      16 Apr 2007 18:23:06 -0000      1.11
@@ -59,7 +59,7 @@
 Stage::onResize(as_environment* env)
 {
        as_value v;
-       if ( get_member("scaleMode", &v) && v.to_std_string(env) == 
std::string("noScale") )
+       if ( get_member("scaleMode", &v) && v.to_string(env) == "noScale" )
        {
                notifyResize(env);
        }
@@ -218,7 +218,7 @@
        {
                Stage::ScaleMode mode = Stage::showAll;
 
-               std::string str = fn.arg(0).to_std_string(&(fn.env()));
+               const std::string& str = fn.arg(0).to_string(&(fn.env()));
                if ( str == "noScale" ) mode = Stage::noScale;
                else if ( str == "exactFill" ) mode = Stage::exactFill;
                else if ( str == "noBorder" ) mode = Stage::noBorder;

Index: server/asobj/string.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/string.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- server/asobj/string.cpp     12 Apr 2007 16:31:41 -0000      1.27
+++ server/asobj/string.cpp     16 Apr 2007 18:23:06 -0000      1.28
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: string.cpp,v 1.27 2007/04/12 16:31:41 strk Exp $ */
+/* $Id: string.cpp,v 1.28 2007/04/16 18:23:06 strk Exp $ */
 
 // Implementation of ActionScript String class.
 
@@ -153,7 +153,7 @@
     std::string str = obj->str();
 
     for (unsigned int i = 0; i < fn.nargs; i++) {
-        str += fn.arg(i).to_std_string();
+        str += fn.arg(i).to_string(&(fn.env()));
     }
 
     return as_value(str);
@@ -226,7 +226,7 @@
         return as_value(array.get());
     }
 
-    std::string delim = fn.arg(0).to_std_string();
+    const std::string& delim = fn.arg(0).to_string(&(fn.env()));
 
     // SWF5 didn't support multichar or empty delimiter
     if ( fn.env().get_version() < 6 )
@@ -287,7 +287,7 @@
 
     ENSURE_FN_ARGS(1, 2, -1);
 
-    std::string toFind = fn.arg(0).to_std_string();
+    const std::string& toFind = fn.arg(0).to_string(&(fn.env()));
 
     size_t start = str.size();
 
@@ -383,7 +383,7 @@
 
     ENSURE_FN_ARGS(1, 2, -1);
 
-    std::string toFind = fn.arg(0).to_std_string();
+    const std::string& toFind = fn.arg(0).to_string(&(fn.env()));
 
     size_t start = 0;
 
@@ -513,7 +513,7 @@
     std::string& str = obj->str();
 
     if (fn.nargs > 0) {
-        str = fn.arg(0).to_std_string();
+        str = fn.arg(0).to_string(&(fn.env()));
     }
 
     // this shouldn't be needed

Index: server/asobj/xml.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xml.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/asobj/xml.cpp        15 Apr 2007 10:52:09 -0000      1.37
+++ server/asobj/xml.cpp        16 Apr 2007 18:23:06 -0000      1.38
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: xml.cpp,v 1.37 2007/04/15 10:52:09 bjacques Exp $ */
+/* $Id: xml.cpp,v 1.38 2007/04/16 18:23:06 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -484,7 +484,7 @@
   
     boost::intrusive_ptr<XML> xml_obj = ensureType<XML>(fn.this_ptr);
   
-    std::string filespec = fn.arg(0).to_string(); 
+    const std::string& filespec = fn.arg(0).to_string(&(fn.env()));
 
     URL url(filespec, get_base_url());
 
@@ -558,7 +558,7 @@
             }
         }
 
-        std::string xml_in = fn.arg(0).to_std_string();
+        const std::string& xml_in = fn.arg(0).to_string(&(fn.env()));
         if ( xml_in.empty() )
         {
             IF_VERBOSE_ASCODING_ERRORS(
@@ -610,7 +610,7 @@
 //    GNASH_REPORT_FUNCTION;
     
     if (fn.nargs > 0) {
-        const char *text = fn.arg(0).to_string().c_str();
+        const std::string& text = fn.arg(0).to_string(&(fn.env()));
        XMLNode *xml_obj = new XMLNode();
 //     cerr << "create new child XMLNode is at " << (void *)xml_obj << endl;
        xml_obj->nodeNameSet(text);
@@ -640,10 +640,9 @@
 //    GNASH_REPORT_FUNCTION;
 
     XMLNode *xml_obj;
-    const char *text;
 
     if (fn.nargs > 0) {
-       text = fn.arg(0).to_string().c_str(); 
+       const std::string& text = fn.arg(0).to_string(&(fn.env()));
        xml_obj = new XMLNode;
        xml_obj->nodeValueSet(text);
        xml_obj->nodeTypeSet(XMLNode::tText);
@@ -690,7 +689,7 @@
 
     if (fn.nargs > 0)
     {
-        std::string text = fn.arg(0).to_std_string(&(fn.env()));
+        const std::string& text = fn.arg(0).to_string(&(fn.env()));
         ptr->parseXML(text);
     }
     

Index: server/asobj/xmlnode.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xmlnode.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- server/asobj/xmlnode.cpp    15 Apr 2007 10:52:09 -0000      1.30
+++ server/asobj/xmlnode.cpp    16 Apr 2007 18:23:06 -0000      1.31
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: xmlnode.cpp,v 1.30 2007/04/15 10:52:09 bjacques Exp $ */
+/* $Id: xmlnode.cpp,v 1.31 2007/04/16 18:23:06 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -424,10 +424,10 @@
     XMLNode *xml_obj = new XMLNode;
     if ( fn.nargs > 0 )
     {
-        xml_obj->nodeTypeSet(XMLNode::NodeType(int(fn.arg(0).to_number())));
+        
xml_obj->nodeTypeSet(XMLNode::NodeType(int(fn.arg(0).to_number(&(fn.env())))));
         if (fn.nargs > 1)
         {
-            xml_obj->nodeValueSet(fn.arg(1).to_std_string(&(fn.env())));
+            xml_obj->nodeValueSet(fn.arg(1).to_string(&(fn.env())));
         }
     }
     
@@ -575,8 +575,7 @@
     }
     else
     {
-        //log_msg(" arg(0) == '%s'", fn.arg(0).to_string());
-        ptr->nodeValueSet(fn.arg(0).to_std_string(&(fn.env())));
+        ptr->nodeValueSet(fn.arg(0).to_string(&(fn.env())));
     }
     return rv;
 }
@@ -596,7 +595,7 @@
     }
     else
     {
-       ptr->nodeNameSet(fn.arg(0).to_string().c_str());
+       ptr->nodeNameSet(fn.arg(0).to_string(&(fn.env())));
     }
     return rv;
 }

Index: server/asobj/xmlsocket.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xmlsocket.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- server/asobj/xmlsocket.cpp  10 Apr 2007 20:24:23 -0000      1.24
+++ server/asobj/xmlsocket.cpp  16 Apr 2007 18:23:06 -0000      1.25
@@ -435,7 +435,7 @@
     }
     
     as_value hostval = fn.arg(0);
-    std::string host = hostval.to_std_string(&fn.env());
+    const std::string& host = hostval.to_string(&fn.env());
     int port = int(fn.arg(1).to_number(&fn.env()));
     
     bool success = ptr->obj.connect(host.c_str(), port);
@@ -479,7 +479,7 @@
     GNASH_REPORT_FUNCTION;
     
     boost::intrusive_ptr<xmlsocket_as_object> ptr = 
ensureType<xmlsocket_as_object>(fn.this_ptr);
-    std::string object = fn.arg(0).to_std_string(&fn.env());
+    const std::string& object = fn.arg(0).to_string(&fn.env());
     //  log_msg("%s: host=%s, port=%g\n", __FUNCTION__, host, port);
     return as_value(ptr->obj.send(object));
 }
@@ -564,7 +564,7 @@
     }
 
     as_environment& env = fn.env();
-    std::string xmlin = fn.arg(0).to_std_string(&env);
+    const std::string& xmlin = fn.arg(0).to_string(&env);
 
     if ( xmlin.empty() )
     {

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- server/vm/ASHandlers.cpp    16 Apr 2007 16:47:30 -0000      1.95
+++ server/vm/ASHandlers.cpp    16 Apr 2007 18:23:06 -0000      1.96
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ASHandlers.cpp,v 1.95 2007/04/16 16:47:30 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.96 2007/04/16 18:23:06 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1049,7 +1049,7 @@
        thread.ensureStack(2); // prop num, target
 
        as_value& tgt_val = env.top(1);
-       std::string tgt_str = tgt_val.to_std_string(&env);
+       std::string tgt_str = tgt_val.to_string(&env);
        character *target = NULL;
        if ( tgt_str.empty() )
        {
@@ -1210,8 +1210,8 @@
 
     thread.ensureStack(1); 
 
-    //std::string val = 
env.pop().to_std_string_versioned(VM::get().getSWFVersion(), &env);
-    std::string val = env.pop().to_std_string(&env);
+    //std::string val = 
env.pop().to_string_versioned(VM::get().getSWFVersion(), &env);
+    std::string val = env.pop().to_string(&env);
     log_trace(val.c_str());
 }
 
@@ -2484,7 +2484,7 @@
 
        // Get the object
        as_value& var_name = env.top(0);
-       string var_string = var_name.to_std_string(&env);
+       string var_string = var_name.to_string(&env);
 
        as_value variable = thread.getVariable(var_string);
 

Index: testsuite/server/GetterSetterTest.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/server/GetterSetterTest.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- testsuite/server/GetterSetterTest.cpp       20 Mar 2007 15:01:20 -0000      
1.9
+++ testsuite/server/GetterSetterTest.cpp       16 Apr 2007 18:23:06 -0000      
1.10
@@ -52,7 +52,7 @@
        boost::intrusive_ptr<as_object> o = fn.this_ptr;
        assert(fn.nargs == 1);
        as_value& val = fn.arg(0);
-       o->set_member(val.to_std_string(), val);
+       o->set_member(val.to_string(&fn.env()), val);
        return as_value();
 }
 




reply via email to

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