gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. 787929f2e6ef32521b19


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 787929f2e6ef32521b195e7604132d7b3cafceb6
Date: Fri, 03 Dec 2010 17:05:23 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  787929f2e6ef32521b195e7604132d7b3cafceb6 (commit)
       via  161cd6747a15170b00a46a02f8857617032cb330 (commit)
       via  add41d6dfe12ca009278343e0479db4009ff9ece (commit)
      from  0f01f719dba2a7db3a6d410eccf091d1c6338694 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=787929f2e6ef32521b195e7604132d7b3cafceb6


commit 787929f2e6ef32521b195e7604132d7b3cafceb6
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Dec 3 17:35:17 2010 +0100

    Const correct and use to_movie

diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index 108abd5..3788cc5 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -658,8 +658,8 @@ DisplayObject::getTarget() const
     // Build parents stack
     const DisplayObject* ch = this;
     string_table& st = stage().getVM().getStringTable();
-    for (;;)
-    {
+    for (;;) {
+
         const DisplayObject* parent = ch->parent();
 
         // Don't push the _root name on the stack
@@ -670,8 +670,6 @@ DisplayObject::getTarget() const
                 // must be an as-referenceable
                 // DisplayObject created using 'new'
                 // like, new MovieClip, new Video, new TextField...
-                //log_debug("DisplayObject %p (%s) doesn't have a parent and "
-                //        "is not a Movie", ch, typeName(*ch));
                 ss << "<no parent, depth" << ch->get_depth() << ">";
                 path.push_back(ss.str());
             }
@@ -951,7 +949,7 @@ getDisplayObjectProperty(DisplayObject& obj, const 
ObjectURI& uri,
         return false;
     }
     
-    MovieClip* mc = dynamic_cast<MovieClip*>(&obj);
+    MovieClip* mc = obj.to_movie();
     if (mc) {
         DisplayObject* ch = mc->getDisplayListObject(uri);
         if (ch) {
@@ -1439,7 +1437,7 @@ as_value
 getDropTarget(DisplayObject& o)
 {
     // This property only applies to MovieClips.
-    MovieClip* mc = dynamic_cast<MovieClip*>(&o);
+    MovieClip* mc = o.to_movie();
     if (!mc) return as_value();
     return as_value(mc->getDropTarget());
 }
@@ -1448,7 +1446,7 @@ as_value
 getCurrentFrame(DisplayObject& o)
 {
     // This property only applies to MovieClips.
-    MovieClip* mc = dynamic_cast<MovieClip*>(&o);
+    MovieClip* mc = o.to_movie();
     if (!mc) return as_value();
     const int currframe =
         std::min(mc->get_loaded_frames(), mc->get_current_frame() + 1);
@@ -1459,7 +1457,7 @@ as_value
 getFramesLoaded(DisplayObject& o)
 {
     // This property only applies to MovieClips.
-    MovieClip* mc = dynamic_cast<MovieClip*>(&o);
+    MovieClip* mc = o.to_movie();
     if (!mc) return as_value();
     return as_value(mc->get_loaded_frames());
 }
@@ -1468,7 +1466,7 @@ as_value
 getTotalFrames(DisplayObject& o)
 {
     // This property only applies to MovieClips.
-    MovieClip* mc = dynamic_cast<MovieClip*>(&o);
+    MovieClip* mc = o.to_movie();
     if (!mc) return as_value();
     return as_value(mc->get_frame_count());
 }
diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index 1c42bed..d86a57c 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -1905,8 +1905,7 @@ MovieClip::getLoadedMovie(Movie* extern_movie)
                 true, true);
         extern_movie->construct();
     }
-    else
-    {
+    else {
         // replaceLevel will set depth for us
         stage().replaceLevel(get_depth() - DisplayObject::staticDepthOffset,
                               extern_movie);
@@ -1951,8 +1950,7 @@ MovieClip::loadVariables(const std::string& urlstr,
         }
         _loadVariableRequests.back().process();
     }
-    catch (NetworkException& ex)
-    {
+    catch (const NetworkException& ex) {
         log_error(_("Could not load variables from %s"), url.str());
     }
 
@@ -1970,12 +1968,11 @@ 
MovieClip::processCompletedLoadVariableRequest(LoadVariablesThread& request)
     notifyEvent(event_id::DATA);
 }
 
-/*private*/
 void
 MovieClip::processCompletedLoadVariableRequests()
 {
     // Nothing to do (just for clarity)
-    if ( _loadVariableRequests.empty() ) return;
+    if (_loadVariableRequests.empty()) return;
 
     for (LoadVariablesThreads::iterator it=_loadVariableRequests.begin();
             it != _loadVariableRequests.end(); )
@@ -1994,8 +1991,8 @@ MovieClip::setVariables(const MovieVariables& vars)
 {
     VM& vm = getVM(*getObject(this));
     for (MovieVariables::const_iterator it=vars.begin(), itEnd=vars.end();
-        it != itEnd; ++it)
-    {
+        it != itEnd; ++it) {
+
         const std::string& name = it->first;
         const std::string& val = it->second;
         getObject(this)->set_member(getURI(vm, name), val);
@@ -2005,13 +2002,12 @@ MovieClip::setVariables(const MovieVariables& vars)
 void
 MovieClip::removeMovieClip()
 {
-    int depth = get_depth();
-    if ( depth < 0 || depth > 1048575 )
-    {
+    const int depth = get_depth();
+    if (depth < 0 || depth > 1048575) {
         IF_VERBOSE_ASCODING_ERRORS(
-        log_aserror(_("removeMovieClip(%s): movieclip depth (%d) out of the "
-            "'dynamic' zone [0..1048575], won't remove"),
-            getTarget(), depth);
+            log_aserror(_("removeMovieClip(%s): movieclip depth (%d) out of "
+                "the 'dynamic' zone [0..1048575], won't remove"),
+                getTarget(), depth);
         );
         return;
     }

http://git.savannah.gnu.org/cgit//commit/?id=161cd6747a15170b00a46a02f8857617032cb330


commit 161cd6747a15170b00a46a02f8857617032cb330
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Dec 3 17:27:21 2010 +0100

    Const correct

diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index d5275ed..1c42bed 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -721,9 +721,9 @@ MovieClip::queueAction(const action_buffer& action)
 }
 
 void
-MovieClip::queueActions(ActionList& actions)
+MovieClip::queueActions(const ActionList& actions)
 {
-    for(ActionList::const_iterator it=actions.begin(), itEnd=actions.end();
+    for (ActionList::const_iterator it=actions.begin(), itEnd=actions.end();
                      it != itEnd; ++it)
     {
         const action_buffer* buf = *it;
diff --git a/libcore/MovieClip.h b/libcore/MovieClip.h
index 8ec4ce0..38a8830 100644
--- a/libcore/MovieClip.h
+++ b/libcore/MovieClip.h
@@ -719,7 +719,7 @@ private:
     /// The list of action will be pushed on the current
     /// global list (see movie_root).
     ///
-    void queueActions(ActionList& action_list);
+    void queueActions(const ActionList& action_list);
 
     /// Execute the actions in the action list
     //

http://git.savannah.gnu.org/cgit//commit/?id=add41d6dfe12ca009278343e0479db4009ff9ece


commit add41d6dfe12ca009278343e0479db4009ff9ece
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Dec 3 17:26:05 2010 +0100

    Use a ptr_list for clarity.

diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index cf54110..d5275ed 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -518,7 +518,6 @@ MovieClip::MovieClip(as_object* object, const 
movie_definition* def,
 MovieClip::~MovieClip()
 {
     stopStreamSound();
-    deleteChecked(_loadVariableRequests.begin(), _loadVariableRequests.end());
 }
 
 int
@@ -1950,7 +1949,7 @@ MovieClip::loadVariables(const std::string& urlstr,
             }
             _loadVariableRequests.push_back(new LoadVariablesThread(sp, url));
         }
-        _loadVariableRequests.back()->process();
+        _loadVariableRequests.back().process();
     }
     catch (NetworkException& ex)
     {
@@ -1981,11 +1980,9 @@ MovieClip::processCompletedLoadVariableRequests()
     for (LoadVariablesThreads::iterator it=_loadVariableRequests.begin();
             it != _loadVariableRequests.end(); )
     {
-        LoadVariablesThread& request = *(*it);
-        if (request.completed())
-        {
+        LoadVariablesThread& request = *it;
+        if (request.completed()) {
             processCompletedLoadVariableRequest(request);
-            delete *it;
             it = _loadVariableRequests.erase(it);
         }
         else ++it;
diff --git a/libcore/MovieClip.h b/libcore/MovieClip.h
index 209cbbd..8ec4ce0 100644
--- a/libcore/MovieClip.h
+++ b/libcore/MovieClip.h
@@ -26,11 +26,12 @@
 #include "gnashconfig.h" // GNASH_USE_GC, USE_SWFTREE
 #endif
 
-#include <boost/intrusive_ptr.hpp>
 #include <vector>
 #include <list>
 #include <map>
 #include <string>
+#include <boost/ptr_container/ptr_list.hpp>
+#include <boost/intrusive_ptr.hpp>
 
 #include "ControlTag.h"
 #include "movie_definition.h" // for inlines
@@ -754,7 +755,7 @@ private:
     const boost::intrusive_ptr<const movie_definition> _def;
 
     /// List of loadVariables requests
-    typedef std::list<LoadVariablesThread*> LoadVariablesThreads;
+    typedef boost::ptr_list<LoadVariablesThread> LoadVariablesThreads;
     
     /// List of active loadVariable requests 
     //

-----------------------------------------------------------------------

Summary of changes:
 libcore/DisplayObject.cpp |   16 +++++++---------
 libcore/MovieClip.cpp     |   37 +++++++++++++++----------------------
 libcore/MovieClip.h       |    7 ++++---
 3 files changed, 26 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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