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-2104-g0c13c8e
Date: Wed, 04 Jun 2014 14:03:48 +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  0c13c8e5a45e065ae4524d743359f7d04f171ece (commit)
       via  4aa54a42c829ccbf70f1efe6fe80c3567efa904c (commit)
       via  dc339979fe39244b8777bb10fd3a3cd2bd1832b7 (commit)
      from  30b45a12966c0674db6c55cfda01fa5d0fa941b3 (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=0c13c8e5a45e065ae4524d743359f7d04f171ece


commit 0c13c8e5a45e065ae4524d743359f7d04f171ece
Author: Bastiaan Jacques <address@hidden>
Date:   Wed Jun 4 15:55:23 2014 +0200

    Pass by value.

diff --git a/libbase/tree.hh b/libbase/tree.hh
index 04fb1b1..f410d84 100644
--- a/libbase/tree.hh
+++ b/libbase/tree.hh
@@ -58,7 +58,7 @@ tree_node_<T>::tree_node_()
        }
 
 template<class T>
-tree_node_<T>::tree_node_(const T val)
+tree_node_<T>::tree_node_(T val)
        : parent(nullptr), first_child(nullptr), last_child(nullptr), 
prev_sibling(nullptr), next_sibling(nullptr), data(std::move(val))
        {
        }

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


commit 4aa54a42c829ccbf70f1efe6fe80c3567efa904c
Author: Bastiaan Jacques <address@hidden>
Date:   Wed Jun 4 15:54:55 2014 +0200

    More move semantics.

diff --git a/libbase/tree.hh b/libbase/tree.hh
index 86c294b..04fb1b1 100644
--- a/libbase/tree.hh
+++ b/libbase/tree.hh
@@ -420,7 +420,7 @@ class tree {
                template<class StrictWeakOrdering>
                class compare_nodes {
                        public:
-                               compare_nodes(StrictWeakOrdering comp) : 
comp_(comp) {};
+                               compare_nodes(StrictWeakOrdering comp) : 
comp_(std::move(comp)) {};
                                
                                bool operator()(const tree_node *a, const 
tree_node *b) 
                                        {
diff --git a/libcore/Function.cpp b/libcore/Function.cpp
index 034883b..903d9ed 100644
--- a/libcore/Function.cpp
+++ b/libcore/Function.cpp
@@ -34,13 +34,13 @@
 namespace gnash {
 
 Function::Function(const action_buffer& ab, as_environment& env,
-            size_t start, const ScopeStack& scopeStack)
+            size_t start, ScopeStack scopeStack)
     :
     UserFunction(getGlobal(env)),
     _env(env),
     _pool(getVM(env).getConstantPool()),
     _action_buffer(ab),
-    _scopeStack(scopeStack),
+    _scopeStack(std::move(scopeStack)),
     _startPC(start),
     _length(0)
 {
diff --git a/libcore/Function.h b/libcore/Function.h
index 9ed4662..77812d9 100644
--- a/libcore/Function.h
+++ b/libcore/Function.h
@@ -72,7 +72,7 @@ public:
        /// action_buffer starting at offset 'start'
        //
        Function(const action_buffer& ab, as_environment& env, size_t start,
-               const ScopeStack& with_stack);
+               ScopeStack with_stack);
 
        virtual ~Function() {}
 
diff --git a/libcore/Geometry.h b/libcore/Geometry.h
index f421ed5..fe8cf78 100644
--- a/libcore/Geometry.h
+++ b/libcore/Geometry.h
@@ -68,10 +68,10 @@ public:
         ap(from.ap)
     {}
 
-    constexpr Edge(const point& ncp, const point& nap)
+    constexpr Edge(point ncp, point nap)
         :
-        cp(ncp),
-        ap(nap)
+        cp(std::move(ncp)),
+        ap(std::move(nap))
     {}
 
     bool straight() const
diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index a7c5fa8..4f6482b 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -117,10 +117,10 @@ class QueuedEvent : public ExecutableCode
 {
 public:
 
-    QueuedEvent(MovieClip* nTarget, const event_id& id)
+    QueuedEvent(MovieClip* nTarget, event_id id)
         :
         ExecutableCode(nTarget),
-        _eventId(id)
+        _eventId(std::move(id))
     {}
 
     virtual void execute() {
@@ -154,8 +154,8 @@ public:
         _highestHiddenDepth(std::numeric_limits<int>::min()),
         _m(nullptr),
         _candidates(),
-        _wp(wp),
-        _pp(pp),
+        _wp(std::move(wp)),
+        _pp(std::move(pp)),
         _checked(false)
     {}
 
diff --git a/libcore/Shape.h b/libcore/Shape.h
index ea218f9..8631ef8 100644
--- a/libcore/Shape.h
+++ b/libcore/Shape.h
@@ -43,7 +43,7 @@ public:
             DisplayObject* parent)
         :
         DisplayObject(mr, object, parent),
-        _shape(sh)
+        _shape(std::move(sh))
     {
         assert(_shape.get());
     }
diff --git a/libcore/TextField.cpp b/libcore/TextField.cpp
index a31769e..6ff6e54 100644
--- a/libcore/TextField.cpp
+++ b/libcore/TextField.cpp
@@ -143,7 +143,7 @@ TextField::TextField(as_object* object, DisplayObject* 
parent,
 }
 
 TextField::TextField(as_object* object, DisplayObject* parent,
-        const SWFRect& bounds)
+        SWFRect bounds)
     :
     InteractiveObject(object, parent),
     _url(""),
@@ -166,7 +166,7 @@ TextField::TextField(as_object* object, DisplayObject* 
parent,
     _maxChars(0),
     _autoSize(AUTOSIZE_NONE),
     _type(typeDynamic),
-    _bounds(bounds),
+    _bounds(std::move(bounds)),
     _selection(0, 0),
     _leading(0),
     _indent(0), 
diff --git a/libcore/TextField.h b/libcore/TextField.h
index 26c10f4..6544cc0 100644
--- a/libcore/TextField.h
+++ b/libcore/TextField.h
@@ -115,7 +115,7 @@ public:
     /// Notably, the default textHeight is 12pt (240 twips).
        /// @param parent A pointer to the DisplayObject parent of this 
TextField
        /// @param bounds A SWFRect specifying the bounds of this TextField
-    TextField(as_object* object, DisplayObject* parent, const SWFRect& bounds);
+    TextField(as_object* object, DisplayObject* parent, SWFRect bounds);
 
 
        ~TextField();
diff --git a/libcore/Timers.cpp b/libcore/Timers.cpp
index 780af76..88d627d 100644
--- a/libcore/Timers.cpp
+++ b/libcore/Timers.cpp
@@ -57,7 +57,7 @@ Timer::Timer(as_object* this_ptr, ObjectURI methodName,
     _interval(ms),
     _start(std::numeric_limits<unsigned long>::max()),
     _function(nullptr),
-    _methodName(methodName),
+    _methodName(std::move(methodName)),
     _object(this_ptr),
     _args(std::move(args)),
     _runOnce(runOnce)
diff --git a/libcore/as_object.h b/libcore/as_object.h
index 585b311..00db6cd 100644
--- a/libcore/as_object.h
+++ b/libcore/as_object.h
@@ -61,11 +61,11 @@ class Trigger
 public:
 
     Trigger(std::string propname, as_function& trig,
-            const as_value& customArg)
+            as_value customArg)
         :
         _propname(std::move(propname)),
         _func(&trig),
-        _customArg(customArg),
+        _customArg(std::move(customArg)),
         _executing(false),
         _dead(false)
     {}
diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index a7642d7..98118ac 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -119,8 +119,8 @@ struct indexed_as_value : public as_value
 {
     int vec_index;
     
-    indexed_as_value(const as_value& val, int index)
-       : as_value(val)
+    indexed_as_value(as_value val, int index)
+       : as_value(std::move(val))
        {
            vec_index = index;
        }
diff --git a/libcore/asobj/NetConnection_as.cpp 
b/libcore/asobj/NetConnection_as.cpp
index 7a2e7df..e6c7895 100644
--- a/libcore/asobj/NetConnection_as.cpp
+++ b/libcore/asobj/NetConnection_as.cpp
@@ -234,10 +234,10 @@ public:
     //
     /// @param nc   The NetConnection AS object to send status/error events to
     /// @param url  URL to post calls to
-    HTTPConnection(NetConnection_as& nc, const URL& url)
+    HTTPConnection(NetConnection_as& nc, const URL url)
         :
         Connection(nc),
-        _url(url)
+        _url(std::move(url))
     {
     }
 
diff --git a/libcore/asobj/SharedObject_as.cpp 
b/libcore/asobj/SharedObject_as.cpp
index d5b390e..404a55d 100644
--- a/libcore/asobj/SharedObject_as.cpp
+++ b/libcore/asobj/SharedObject_as.cpp
@@ -107,7 +107,7 @@ public:
 
     SOLPropsBufSerializer(amf::Writer w, VM& vm)
         :
-        _writer(w),
+        _writer(std::move(w)),
         _vm(vm),
         _error(false),
         _count(0)
diff --git a/libcore/swf_event.h b/libcore/swf_event.h
index 01e14b7..808fade 100644
--- a/libcore/swf_event.h
+++ b/libcore/swf_event.h
@@ -21,6 +21,7 @@
 #define GNASH_SWF_EVENT_H
 
 #include "event_id.h" // for composition
+#include <utility>
 
 namespace gnash {
     class action_buffer;
@@ -40,9 +41,9 @@ class swf_event
 {
 public:
 
-       swf_event(const event_id& ev, action_buffer& buf)
+       swf_event(event_id ev, action_buffer& buf)
                :
-               m_event(ev),
+               m_event(std::move(ev)),
                m_action_buffer(buf)
        {
        }
diff --git a/libcore/vm/ExecutableCode.h b/libcore/vm/ExecutableCode.h
index 889cbb9..215e5d9 100644
--- a/libcore/vm/ExecutableCode.h
+++ b/libcore/vm/ExecutableCode.h
@@ -92,10 +92,10 @@ public:
         ExecutableCode(nTarget)
     {}
 
-    EventCode(DisplayObject* nTarget, const BufferList& buffers)
+    EventCode(DisplayObject* nTarget, BufferList buffers)
         :
         ExecutableCode(nTarget),
-        _buffers(buffers)
+        _buffers(std::move(buffers))
     {}
 
     /// Add an action buffer to this event handler
@@ -146,14 +146,14 @@ class DelayedFunctionCall : public ExecutableCode
 public:
 
     DelayedFunctionCall(DisplayObject* target,
-            as_object* obj, const ObjectURI& name,
-            const as_value& arg1, const as_value& arg2)
+            as_object* obj, ObjectURI name,
+            as_value arg1, as_value arg2)
         :
         ExecutableCode(target),
         _obj(obj),
-        _name(name),
-        _arg1(arg1),
-        _arg2(arg2)
+        _name(std::move(name)),
+        _arg1(std::move(arg1)),
+        _arg2(std::move(arg2))
     {}
 
     virtual void execute() {

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


commit dc339979fe39244b8777bb10fd3a3cd2bd1832b7
Author: Bastiaan Jacques <address@hidden>
Date:   Wed Jun 4 15:32:48 2014 +0200

    Move semantics and argument forwarding for FunctionArgs.

diff --git a/libcore/Timers.cpp b/libcore/Timers.cpp
index 289e830..780af76 100644
--- a/libcore/Timers.cpp
+++ b/libcore/Timers.cpp
@@ -38,28 +38,28 @@ Timer::~Timer()
 }
 
 Timer::Timer(as_function& method, unsigned long ms,
-        as_object* this_ptr, const fn_call::Args& args, bool runOnce)
+        as_object* this_ptr, fn_call::Args args, bool runOnce)
     :
     _interval(ms),
     _start(std::numeric_limits<unsigned long>::max()),
     _function(&method),
     _methodName(),
     _object(this_ptr),
-    _args(args),
+    _args(std::move(args)),
     _runOnce(runOnce)
 {
     start();
 }
 
-Timer::Timer(as_object* this_ptr, const ObjectURI& methodName,
-        unsigned long ms, const fn_call::Args& args, bool runOnce)
+Timer::Timer(as_object* this_ptr, ObjectURI methodName,
+        unsigned long ms, fn_call::Args args, bool runOnce)
     :
     _interval(ms),
     _start(std::numeric_limits<unsigned long>::max()),
     _function(nullptr),
     _methodName(methodName),
     _object(this_ptr),
-    _args(args),
+    _args(std::move(args)),
     _runOnce(runOnce)
 {
     start();
diff --git a/libcore/Timers.h b/libcore/Timers.h
index dac3f52..4c88d1c 100644
--- a/libcore/Timers.h
+++ b/libcore/Timers.h
@@ -73,7 +73,7 @@ public:
     /// @param runOnce
     ///     If true the interval will run only once. False if omitted.
     Timer(as_function& method, unsigned long ms, as_object* this_ptr,
-            const fn_call::Args& args, bool runOnce = false);
+            fn_call::Args args, bool runOnce = false);
 
     /// Construct the Timer to call a late-evaluated object method, enabling 
it.
     //
@@ -94,8 +94,8 @@ public:
     ///
     /// @param runOnce
     ///     If true the interval will run only once. False if omitted.
-    Timer(as_object* obj, const ObjectURI& methodName, unsigned long ms,
-            const fn_call::Args& args, bool runOnce = false);
+    Timer(as_object* obj, ObjectURI methodName, unsigned long ms,
+            fn_call::Args args, bool runOnce = false);
 
     /// Clear the timer, ready for reuse
     //
diff --git a/libcore/vm/fn_call.h b/libcore/vm/fn_call.h
index 389dd21..16d7fb0 100644
--- a/libcore/vm/fn_call.h
+++ b/libcore/vm/fn_call.h
@@ -61,21 +61,31 @@ public:
     typedef std::vector<T> container_type;
     typedef T value_type;
 
-    FunctionArgs() {}
+    FunctionArgs() = default;
+    FunctionArgs(FunctionArgs&& other) = default;
 
     /// The copy constructor copies all the arguments.
-    FunctionArgs(const FunctionArgs& other)
-        :
-        _v(other._v)
-    {}
+    FunctionArgs(const FunctionArgs& other) = default;
+
+    FunctionArgs& operator+=(T t) {
+        _v.push_back(std::move(t));
+        return *this;
+    }
+
+    FunctionArgs& operator,(T t) {
+        _v.push_back(std::move(t));
+        return *this;
+    }
 
-    FunctionArgs& operator+=(const T& t) {
-        _v.push_back(t);
+    template <typename U>
+    FunctionArgs& operator,(U&& u) {
+        _v.emplace_back(std::forward<U>(u));
         return *this;
     }
 
-    FunctionArgs& operator,(const T& t) {
-        _v.push_back(t);
+    template <typename U>
+    FunctionArgs& operator+=(U&& u) {
+        _v.emplace_back(std::forward<U>(u));
         return *this;
     }
 

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

Summary of changes:
 libbase/tree.hh                    |    4 ++--
 libcore/Function.cpp               |    4 ++--
 libcore/Function.h                 |    2 +-
 libcore/Geometry.h                 |    6 +++---
 libcore/MovieClip.cpp              |    8 ++++----
 libcore/Shape.h                    |    2 +-
 libcore/TextField.cpp              |    4 ++--
 libcore/TextField.h                |    2 +-
 libcore/Timers.cpp                 |   12 ++++++------
 libcore/Timers.h                   |    6 +++---
 libcore/as_object.h                |    4 ++--
 libcore/asobj/Array_as.cpp         |    4 ++--
 libcore/asobj/NetConnection_as.cpp |    4 ++--
 libcore/asobj/SharedObject_as.cpp  |    2 +-
 libcore/swf_event.h                |    5 +++--
 libcore/vm/ExecutableCode.h        |   14 +++++++-------
 libcore/vm/fn_call.h               |   28 +++++++++++++++++++---------
 17 files changed, 61 insertions(+), 50 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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