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-2109-g66566a8
Date: Thu, 05 Jun 2014 08:11:37 +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  66566a80d1f3a5bfbb5ac914293073230f48a75b (commit)
       via  cf874696d4f4cc56f1a100007eecaef0ae1d9ae0 (commit)
       via  68a2525becd22a6c0fb5fcdbf84845e659b23283 (commit)
      from  7349e86703cb74cfaa870f39eb892e6c7eb7a7b0 (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=66566a80d1f3a5bfbb5ac914293073230f48a75b


commit 66566a80d1f3a5bfbb5ac914293073230f48a75b
Author: Bastiaan Jacques <address@hidden>
Date:   Thu Jun 5 10:02:44 2014 +0200

    Replace shared_ptr in cases where shared pointer semantics are not
    needed, such as when returning a newly created pointer, or when
    storing a scoped pointer in a standard container.

diff --git a/libcore/ExternalInterface.cpp b/libcore/ExternalInterface.cpp
index b39e5da..55c5461 100644
--- a/libcore/ExternalInterface.cpp
+++ b/libcore/ExternalInterface.cpp
@@ -138,12 +138,12 @@ ExternalInterface::_toXML(const as_value &val)
     return ss.str();
 }
 
-std::shared_ptr<ExternalInterface::invoke_t>
+std::unique_ptr<ExternalInterface::invoke_t>
 ExternalInterface::ExternalEventCheck(int fd)
 {
 //    GNASH_REPORT_FUNCTION;
     
-    std::shared_ptr<ExternalInterface::invoke_t> error;
+    std::unique_ptr<ExternalInterface::invoke_t> error;
 
     if (fd > 0) {
         int bytes = 0;
@@ -175,10 +175,10 @@ ExternalInterface::ExternalEventCheck(int fd)
 //      </arguments>
 // </invoke>
 //
-std::shared_ptr<ExternalInterface::invoke_t>
+std::unique_ptr<ExternalInterface::invoke_t>
 ExternalInterface::parseInvoke(const std::string &xml)
 {
-    std::shared_ptr<ExternalInterface::invoke_t> invoke;
+    std::unique_ptr<ExternalInterface::invoke_t> invoke;
     if (xml.empty()) {
         return invoke;
     }
diff --git a/libcore/ExternalInterface.h b/libcore/ExternalInterface.h
index 650d73b..6a1089b 100644
--- a/libcore/ExternalInterface.h
+++ b/libcore/ExternalInterface.h
@@ -57,9 +57,9 @@ struct DSOEXPORT ExternalInterface
     static std::vector<as_value> parseArguments(const std::string &xml);
 
     // Parse the XML Invoke message.
-    static std::shared_ptr<invoke_t> parseInvoke(const std::string &str);
+    static std::unique_ptr<invoke_t> parseInvoke(const std::string &str);
     // Check for data from the browser and parse it.
-    DSOEXPORT static std::shared_ptr<invoke_t> ExternalEventCheck(int fd);
+    DSOEXPORT static std::unique_ptr<invoke_t> ExternalEventCheck(int fd);
 
     // These methods are for constructing Invoke messages.
     // Create an Invoke message for the standalone Gnash
diff --git a/libcore/Font.cpp b/libcore/Font.cpp
index 1f22fe9..45c88e0 100644
--- a/libcore/Font.cpp
+++ b/libcore/Font.cpp
@@ -59,20 +59,13 @@ Font::GlyphInfo::GlyphInfo()
     advance(0)
 {}
 
-Font::GlyphInfo::GlyphInfo(std::unique_ptr<SWF::ShapeRecord> glyph,
+Font::GlyphInfo::GlyphInfo(std::unique_ptr<SWF::ShapeRecord> the_glyph,
         float advance)
     :
-    glyph(glyph.release()),
+    glyph(std::move(the_glyph)),
     advance(advance)
 {}
 
-Font::GlyphInfo::GlyphInfo(const GlyphInfo& o)
-    :
-    glyph(o.glyph),
-    advance(o.advance)
-{}
-
-
 Font::Font(std::unique_ptr<SWF::DefineFontTag> ft)
     :
     _fontTag(ft.release()),
diff --git a/libcore/Font.h b/libcore/Font.h
index 49273f1..f69bd4b 100644
--- a/libcore/Font.h
+++ b/libcore/Font.h
@@ -234,9 +234,7 @@ public:
         /// Takes ownership of the SWF::ShapeRecord.
         GlyphInfo(std::unique_ptr<SWF::ShapeRecord> glyph, float advance);
 
-        GlyphInfo(const GlyphInfo& o);
-
-        std::shared_ptr<SWF::ShapeRecord> glyph;
+        std::unique_ptr<SWF::ShapeRecord> glyph;
 
         float advance;
     };
diff --git a/libcore/asobj/LocalConnection_as.cpp 
b/libcore/asobj/LocalConnection_as.cpp
index f2d4608..705d3a9 100644
--- a/libcore/asobj/LocalConnection_as.cpp
+++ b/libcore/asobj/LocalConnection_as.cpp
@@ -224,12 +224,12 @@ public:
 
     void connect(const std::string& name);
 
-    void send(std::shared_ptr<ConnectionData> d)
+    void send(std::unique_ptr<ConnectionData> d)
     {
         assert(d.get());
         VM& vm = getVM(owner());
         d->ts = getTimestamp(vm);
-        _queue.push_back(d);
+        _queue.push_back(std::move(d));
         
         // Register callback so we can send the data on the next advance.
         movie_root& mr = getRoot(owner());
@@ -248,7 +248,7 @@ private:
 
     SharedMem _shm;
 
-    std::deque<std::shared_ptr<ConnectionData> > _queue;
+    std::deque<std::unique_ptr<ConnectionData>> _queue;
 
     // The timestamp of our last write to the shared memory.
     std::uint32_t _lastTime;
@@ -376,7 +376,7 @@ LocalConnection_as::update()
     }
 
     // Get the first buffer.
-    std::shared_ptr<ConnectionData> cd = _queue.front();
+    std::unique_ptr<ConnectionData> cd = std::move(_queue.front());
     _queue.pop_front();
 
     // If the correct listener isn't there, iterate until we find one or
@@ -387,7 +387,7 @@ LocalConnection_as::update()
             cd->ts = 0;
             break;
         }
-        cd = _queue.front();
+        cd = std::move(_queue.front());
         _queue.pop_front();
     }
 
@@ -613,7 +613,7 @@ localconnection_send(const fn_call& fn)
         return as_value(false);
     }
     
-    std::shared_ptr<ConnectionData> cd(new ConnectionData());
+    std::unique_ptr<ConnectionData> cd(new ConnectionData());
 
     SimpleBuffer& buf = cd->data;
 
@@ -633,7 +633,7 @@ localconnection_send(const fn_call& fn)
 
     cd->name = name;
 
-    relay->send(cd);
+    relay->send(std::move(cd));
 
     return as_value(true);
 }
diff --git a/libcore/asobj/NetConnection_as.cpp 
b/libcore/asobj/NetConnection_as.cpp
index e6c7895..1ce7268 100644
--- a/libcore/asobj/NetConnection_as.cpp
+++ b/libcore/asobj/NetConnection_as.cpp
@@ -257,10 +257,10 @@ private:
     const URL _url;
 
     /// The queue of sent requests.
-    std::vector<std::shared_ptr<HTTPRequest> > _requestQueue;
+    std::vector<std::unique_ptr<HTTPRequest>> _requestQueue;
 
     /// The current request.
-    std::shared_ptr<HTTPRequest> _currentRequest;
+    std::unique_ptr<HTTPRequest> _currentRequest;
     
 };
 
@@ -567,8 +567,7 @@ NetConnection_as::close()
 
     /// Queue the current call queue if it has pending calls
     if (_currentConnection.get() && _currentConnection->hasPendingCalls()) {
-        std::shared_ptr<Connection> c(_currentConnection.release());
-        _oldConnections.push_back(c);
+        _oldConnections.emplace_back(std::move(_currentConnection));
     }
 
     /// TODO: what should actually happen here? Should an attached
@@ -1086,20 +1085,16 @@ HTTPConnection::advance()
 {
     // If there is data waiting to be sent, send it and push it
     // to the queue.
-    if (_currentRequest.get()) {
+    if (_currentRequest) {
         _currentRequest->send(_url, _nc);
-        _requestQueue.push_back(_currentRequest);
-
         // Clear the current request for the next go.
-        _currentRequest.reset();
+        _requestQueue.emplace_back(std::move(_currentRequest));
     }
 
     // Process all replies and clear finished requests.
-    for (std::vector<std::shared_ptr<HTTPRequest> >::iterator i =
-            _requestQueue.begin(); i != _requestQueue.end();) {
-        if (!(*i)->process(_nc)) i = _requestQueue.erase(i);
-        else ++i;
-    }
+    auto rm = std::remove_if(_requestQueue.begin(), _requestQueue.end(),
+        [&](std::unique_ptr<HTTPRequest>& req) { return !req->process(_nc); });
+    _requestQueue.erase(rm, _requestQueue.end());
 
     return true;
 }
@@ -1229,7 +1224,7 @@ void
 HTTPConnection::call(as_object* asCallback, const std::string& methodName,
             const std::vector<as_value>& args)
 {
-    if (!_currentRequest.get()) {
+    if (!_currentRequest) {
         _currentRequest.reset(new HTTPRequest(*this));
     }
 
diff --git a/libcore/asobj/NetConnection_as.h b/libcore/asobj/NetConnection_as.h
index ee5dcc5..f56e0fc 100644
--- a/libcore/asobj/NetConnection_as.h
+++ b/libcore/asobj/NetConnection_as.h
@@ -117,7 +117,7 @@ private:
     /// Extend the URL to be used for playing
     void addToURL(const std::string& url);
 
-    typedef std::list<std::shared_ptr<Connection> > Connections;
+    typedef std::list<std::unique_ptr<Connection> > Connections;
 
     /// Queue of call groups
     //
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 6451fa5..2fc00cd 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -819,9 +819,7 @@ movie_root::addIntervalTimer(std::unique_ptr<Timer> timer)
 
     assert(_intervalTimers.find(id) == _intervalTimers.end());
 
-    std::shared_ptr<Timer> addTimer(timer.release());
-
-    _intervalTimers.insert(std::make_pair(id, addTimer));
+    _intervalTimers.insert(std::make_pair(id, std::move(timer)));
 
     return id;
 }
@@ -1453,8 +1451,7 @@ movie_root::flushHigherPriorityActionQueues()
 void
 movie_root::addLoadableObject(as_object* obj, std::unique_ptr<IOChannel> str)
 {
-    std::shared_ptr<IOChannel> io(str.release());
-    _loadCallbacks.emplace_back(io, obj);
+    _loadCallbacks.emplace_back(std::move(str), obj);
 }
 
 void
@@ -1555,7 +1552,7 @@ movie_root::executeAdvanceCallbacks()
     // application. If it is set, we have to check the socket connection
     // for XML messages.
     if (_controlfd > 0) {
-    std::shared_ptr<ExternalInterface::invoke_t> invoke =
+    std::unique_ptr<ExternalInterface::invoke_t> invoke =
         ExternalInterface::ExternalEventCheck(_controlfd);
         if (invoke) {
             if (processInvoke(invoke.get()) == false) {
@@ -1708,7 +1705,7 @@ movie_root::executeTimers()
 
     unsigned long now = _vm.getTime();
 
-    typedef std::multimap<unsigned int, std::shared_ptr<Timer> >
+    typedef std::multimap<unsigned long, Timer*>
         ExpiredTimers;
 
     ExpiredTimers expiredTimers;
@@ -1719,7 +1716,7 @@ movie_root::executeTimers()
         TimerMap::iterator nextIterator = it;
         ++nextIterator;
 
-        std::shared_ptr<Timer> timer(it->second);
+        Timer* timer = it->second.get();
 
         if (timer->cleared()) {
             // this timer was cleared, erase it
@@ -1738,8 +1735,8 @@ movie_root::executeTimers()
     foreachSecond(expiredTimers.begin(), expiredTimers.end(),
                   &Timer::executeAndReset);
 
-    if (!expiredTimers.empty()) processActionQueue();
-
+    if (!expiredTimers.empty())
+        processActionQueue();
 }
 
 void
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index 5093cae..778ab01 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -93,6 +93,7 @@
 #include "VM.h"
 #include "HostInterface.h"
 #include "log.h"
+#include "IOChannel.h"
 
 #ifdef USE_SWFTREE
 # include "tree.hh"
@@ -114,7 +115,6 @@ namespace gnash {
     class Timer;
     class MovieClip;
     class VirtualClock;
-    class IOChannel;
     class RunResources;
     class Button;
     class VM;
@@ -153,15 +153,15 @@ public:
     
     class LoadCallback {
     public:
-        LoadCallback(std::shared_ptr<IOChannel> s, as_object* o)
+        LoadCallback(std::unique_ptr<IOChannel> s, as_object* o)
             :
-            _stream(s),
+            _stream(std::move(s)),
             _obj(o)
         {}
         bool processLoad();
         void setReachable() const;
     private:
-        std::shared_ptr<IOChannel> _stream;
+        std::unique_ptr<IOChannel> _stream;
         SimpleBuffer _buf;
         as_object* _obj;
     };
@@ -999,7 +999,7 @@ private:
 
     LoadCallbacks _loadCallbacks;
     
-    typedef std::map<std::uint32_t, std::shared_ptr<Timer> > TimerMap;
+    typedef std::map<std::uint32_t, std::unique_ptr<Timer>> TimerMap;
 
     TimerMap _intervalTimers;
 

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


commit cf874696d4f4cc56f1a100007eecaef0ae1d9ae0
Author: Bastiaan Jacques <address@hidden>
Date:   Thu Jun 5 00:26:53 2014 +0200

    Use C++11 atomics.

diff --git a/libbase/ref_counted.h b/libbase/ref_counted.h
index 85e6f3d..9e153d5 100644
--- a/libbase/ref_counted.h
+++ b/libbase/ref_counted.h
@@ -22,7 +22,7 @@
 #include "dsodefs.h" // for DSOEXPORT
 
 #include <cassert>
-#include <boost/detail/atomic_count.hpp>
+#include <atomic>
 
 namespace gnash {
 
@@ -41,9 +41,7 @@ private:
        // carefully designed for this to be effective
        // (decrement & check in a single statement)
        //
-       typedef boost::detail::atomic_count Counter;
-
-       mutable Counter m_ref_count;
+       mutable std::atomic<int> m_ref_count;
        
 protected:
 

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


commit 68a2525becd22a6c0fb5fcdbf84845e659b23283
Author: Bastiaan Jacques <address@hidden>
Date:   Wed Jun 4 20:29:38 2014 +0200

    Simplify another loop.

diff --git a/librender/agg/Renderer_agg.cpp b/librender/agg/Renderer_agg.cpp
index 46113b2..474d416 100644
--- a/librender/agg/Renderer_agg.cpp
+++ b/librender/agg/Renderer_agg.cpp
@@ -1115,12 +1115,11 @@ public:
             return; // no need to draw
         }
 
-        for (SWF::ShapeRecord::Subshapes::const_iterator it = 
shape.subshapes().begin(),
-             end = shape.subshapes().end(); it != end; ++it ) {
+        for (const SWF::Subshape& subshape : shape.subshapes()) {
 
-            const SWF::ShapeRecord::FillStyles& fillStyles = it->fillStyles();
-            const SWF::ShapeRecord::LineStyles& lineStyles = it->lineStyles();
-            const SWF::ShapeRecord::Paths& paths = it->paths();
+            const SWF::ShapeRecord::FillStyles& fillStyles = 
subshape.fillStyles();
+            const SWF::ShapeRecord::LineStyles& lineStyles = 
subshape.lineStyles();
+            const SWF::ShapeRecord::Paths& paths = subshape.paths();
 
             // select ranges
             select_clipbounds(shape.getBounds(), xform.matrix);

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

Summary of changes:
 libbase/ref_counted.h                |    6 ++----
 libcore/ExternalInterface.cpp        |    8 ++++----
 libcore/ExternalInterface.h          |    4 ++--
 libcore/Font.cpp                     |   11 ++---------
 libcore/Font.h                       |    4 +---
 libcore/asobj/LocalConnection_as.cpp |   14 +++++++-------
 libcore/asobj/NetConnection_as.cpp   |   23 +++++++++--------------
 libcore/asobj/NetConnection_as.h     |    2 +-
 libcore/movie_root.cpp               |   17 +++++++----------
 libcore/movie_root.h                 |   10 +++++-----
 librender/agg/Renderer_agg.cpp       |    9 ++++-----
 11 files changed, 44 insertions(+), 64 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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