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. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2136-g62c8f58
Date: Thu, 12 Jun 2014 16:25:50 +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  62c8f58d25b441afcb6e4466dbf2234d5894a4f5 (commit)
       via  6b4fb6f4bffe29b1fa7c5758729d595554d2222c (commit)
      from  8753d58170ed40da84d14163da9d92ab5841e8b5 (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=62c8f58d25b441afcb6e4466dbf2234d5894a4f5


commit 62c8f58d25b441afcb6e4466dbf2234d5894a4f5
Author: Bastiaan Jacques <address@hidden>
Date:   Thu Jun 12 18:19:22 2014 +0200

    Switch LiveChars and ButtonListeners to forward_list.
    
    They are used as forward lists already.

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index b64a4a1..952e063 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -1760,7 +1760,6 @@ movie_root::markReachableResources() const
 
     std::for_each(_objectCallbacks.begin(), _objectCallbacks.end(),
             std::mem_fun(&ActiveRelay::setReachable));
-
     std::for_each(_loadCallbacks.begin(), _loadCallbacks.end(),
             std::mem_fun_ref(&movie_root::LoadCallback::setReachable));
 
@@ -1955,7 +1954,7 @@ movie_root::registerButton(Button* listener)
 void
 movie_root::cleanupDisplayList()
 {
-#define GNASH_DEBUG_INSTANCE_LIST 1
+//#define GNASH_DEBUG_INSTANCE_LIST 1
 
 #ifdef GNASH_DEBUG_INSTANCE_LIST
     static size_t maxLiveChars = 0;
@@ -2001,9 +2000,7 @@ movie_root::cleanupDisplayList()
         needScan=false;
 
         // Remove unloaded MovieClips from the _liveChars list
-        for (LiveChars::iterator i = _liveChars.begin(), e = _liveChars.end();
-                i != e;) {
-            MovieClip* ch = *i;
+        _liveChars.remove_if([&](MovieClip* ch) {
             if (ch->unloaded()) {
                 // the sprite might have been destroyed already
                 // by effect of an unload() call with no onUnload
@@ -2027,14 +2024,13 @@ movie_root::cleanupDisplayList()
                 }
 #endif
 
-                i = _liveChars.erase(i);
-
 #ifdef GNASH_DEBUG_DLIST_CLEANUP
                 cleaned++;
 #endif
+                return true;
             }
-            else ++i; 
-        }
+            return false;
+        });
 
 #ifdef GNASH_DEBUG_DLIST_CLEANUP
         cout << " Scan " << scansCount << " cleaned " << cleaned <<
@@ -2043,8 +2039,9 @@ movie_root::cleanupDisplayList()
     } while (needScan);
 
 #ifdef GNASH_DEBUG_INSTANCE_LIST
-    if (_liveChars.size() > maxLiveChars) {
-        maxLiveChars = _liveChars.size();
+    size_t count = std::distance(begin(_liveChars), end(_liveChars));
+    if (count > maxLiveChars) {
+        maxLiveChars = count;
         log_debug("Global instance list grew to %d entries", maxLiveChars);
     }
 #endif
@@ -2060,11 +2057,11 @@ movie_root::advanceLiveChars()
 
     // Advance all characters, then notify them.
     LiveChars::iterator it;
-    for (it=_liveChars.begin(); it != _liveChars.end(); ++it) {
-        advanceLiveChar(*it);
+    for (MovieClip* liveChar : _liveChars) {
+        advanceLiveChar(liveChar);
     }
-    for (it=_liveChars.begin(); it != _liveChars.end(); ++it) {
-        notifyLoad(*it);
+    for (MovieClip* liveChar : _liveChars) {
+        notifyLoad(liveChar);
     }
 }
 
@@ -2319,7 +2316,7 @@ movie_root::getCharacterTree(InfoTree& tr, 
InfoTree::iterator it)
 
     /// Stage: number of live MovieClips.
     std::ostringstream os;
-    os << _liveChars.size();
+    os << std::distance(begin(_liveChars), end(_liveChars));
     localIter = tr.append_child(it, std::make_pair(_("Live MovieClips"),
                 os.str()));
 
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index 778ab01..743bfeb 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -71,7 +71,7 @@
 #include <map>
 #include <string>
 #include <vector>
-#include <list>
+#include <forward_list>
 #include <set>
 #include <bitset>
 #include <array>
@@ -165,7 +165,7 @@ public:
         SimpleBuffer _buf;
         as_object* _obj;
     };
-    typedef std::list<LoadCallback> LoadCallbacks;        
+    typedef std::list<LoadCallback> LoadCallbacks;
 
     typedef std::bitset<key::KEYCOUNT> Keys;
 
@@ -948,7 +948,7 @@ private:
 
     void handleActionLimitHit(const std::string& ref);
 
-    typedef std::list<Button*> ButtonListeners;
+    typedef std::forward_list<Button*> ButtonListeners;
     ButtonListeners _buttonListeners;
 
     GC _gc;
@@ -971,7 +971,7 @@ private:
     /// ::advance of each element to insert new DisplayObjects before
     /// the start w/out invalidating iterators scanning the
     /// list forward for proper movie advancement
-    typedef std::list<MovieClip*> LiveChars;
+    typedef std::forward_list<MovieClip*> LiveChars;
 
     /// The list of advanceable DisplayObject, in placement order
     LiveChars _liveChars;

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


commit 6b4fb6f4bffe29b1fa7c5758729d595554d2222c
Author: Bastiaan Jacques <address@hidden>
Date:   Thu Jun 12 16:11:46 2014 +0200

    Simplify.

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index a2da564..b64a4a1 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -638,10 +638,10 @@ movie_root::keyEvent(key::code k, bool down)
         // However, the previous attempt to fix caused real-life failures:
         // see bug #33889.
         ButtonListeners copy = _buttonListeners;
-        for (ButtonListeners::const_iterator it = copy.begin(), e = copy.end();
-                it != e; ++it) {
-            if ((*it)->unloaded()) continue;
-            (*it)->keyPress(k);
+        for (Button* button : copy) {
+            if (!button->unloaded()) {
+                button->keyPress(k);
+            }
         }
 
         // If we're focused on an editable text field, finally the text
@@ -1939,8 +1939,7 @@ movie_root::callExternalCallback(const std::string &name,
 void
 movie_root::removeButton(Button* listener)
 {
-    _buttonListeners.remove_if(
-            std::bind2nd(std::equal_to<Button*>(), listener));
+    _buttonListeners.remove(listener);
 }
 
 void

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

Summary of changes:
 libcore/movie_root.cpp |   40 ++++++++++++++++++----------------------
 libcore/movie_root.h   |    8 ++++----
 2 files changed, 22 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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