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-2092-g36b1a2f
Date: Sat, 31 May 2014 23:02:25 +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  36b1a2fd4fa3a4a6f7e1aa7d80a2e8ec924aed74 (commit)
       via  744fc9c7206df5422a9945c6e426dc37c529c2b8 (commit)
       via  9aa2e0be93ac6ffc64d8971ab3a785e18c163950 (commit)
       via  fe886481fc3d5efa142da8f91f2fa71c52bf700b (commit)
      from  3ff2c456d51280d3d7953b2bf8c57976cfafb660 (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=36b1a2fd4fa3a4a6f7e1aa7d80a2e8ec924aed74


commit 36b1a2fd4fa3a4a6f7e1aa7d80a2e8ec924aed74
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Jun 1 00:54:21 2014 +0200

    In constructors accepting movable objects by const reference and then 
copying them, instead accept the objects by value and std::move() them.
    
    This allows the compiler to avoid copying the objects if an rvalue is 
passed to the constructor.

diff --git a/gui/ScreenShotter.cpp b/gui/ScreenShotter.cpp
index 2c023f8..4acaeb7 100644
--- a/gui/ScreenShotter.cpp
+++ b/gui/ScreenShotter.cpp
@@ -68,11 +68,11 @@ ScreenShotter::ScreenShotter(const std::string& fileName, 
int quality)
 {
 }
 
-ScreenShotter::ScreenShotter(const std::string& fileName, FileType type,
+ScreenShotter::ScreenShotter(std::string fileName, FileType type,
         int quality)
     :
     _immediate(false),
-    _fileName(fileName),
+    _fileName(std::move(fileName)),
     _last(false),
     _type(type),
     _quality(quality)
diff --git a/gui/ScreenShotter.h b/gui/ScreenShotter.h
index e3e4fab..19100f0 100644
--- a/gui/ScreenShotter.h
+++ b/gui/ScreenShotter.h
@@ -43,7 +43,7 @@ public:
     ScreenShotter(const std::string& fileName, int quality = 100);
     
     /// Create a ScreenShotter, specifying the output type.
-    ScreenShotter(const std::string& fileName, FileType f, int quality = 100);
+    ScreenShotter(std::string fileName, FileType f, int quality = 100);
 
     ~ScreenShotter();
 
diff --git a/libbase/NamingPolicy.cpp b/libbase/NamingPolicy.cpp
index baa20f9..c7b782a 100644
--- a/libbase/NamingPolicy.cpp
+++ b/libbase/NamingPolicy.cpp
@@ -52,9 +52,9 @@ OverwriteExisting::operator()(const URL& url) const
 }
 
 
-IncrementalRename::IncrementalRename(const URL& baseURL)
+IncrementalRename::IncrementalRename(URL baseURL)
     :
-    _baseURL(baseURL)
+    _baseURL(std::move(baseURL))
 {
 }
 
diff --git a/libbase/NamingPolicy.h b/libbase/NamingPolicy.h
index 3d237a9..d23edd7 100644
--- a/libbase/NamingPolicy.h
+++ b/libbase/NamingPolicy.h
@@ -53,7 +53,7 @@ public:
 class DSOEXPORT IncrementalRename : public NamingPolicy
 {
 public:
-    IncrementalRename(const URL& baseURL);
+    IncrementalRename(URL baseURL);
     virtual std::string operator()(const URL& url) const;
     
 private:
diff --git a/libbase/StreamProvider.cpp b/libbase/StreamProvider.cpp
index 8fd905a..8700bc8 100644
--- a/libbase/StreamProvider.cpp
+++ b/libbase/StreamProvider.cpp
@@ -38,12 +38,12 @@
 
 namespace gnash {
 
-StreamProvider::StreamProvider(const URL& orig, const URL& base,
+StreamProvider::StreamProvider(URL orig, URL base,
         std::unique_ptr<NamingPolicy> np)
     :
     _namingPolicy(std::move(np)),
-    _base(base),
-    _original(orig)
+    _base(std::move(base)),
+    _original(std::move(orig))
 {
 }
     
diff --git a/libbase/StreamProvider.h b/libbase/StreamProvider.h
index 2466c03..8335105 100644
--- a/libbase/StreamProvider.h
+++ b/libbase/StreamProvider.h
@@ -56,7 +56,7 @@ public:
     ///                     connections.
     /// @param base         The base URL, used to resolve URLs.
     /// @param np           A policy to decide the name of cached files.
-       StreamProvider(const URL& original, const URL& base,
+       StreamProvider(URL original, URL base,
             std::unique_ptr<NamingPolicy> np =
             std::unique_ptr<NamingPolicy>(new NamingPolicy));
 
diff --git a/libbase/arg_parser.h b/libbase/arg_parser.h
index 56cec35..c0f79e1 100644
--- a/libbase/arg_parser.h
+++ b/libbase/arg_parser.h
@@ -48,6 +48,7 @@
 #include "dsodefs.h"
 #include <vector>
 #include <sstream>
+#include <utility>
 
 class Arg_parser
 {
@@ -64,9 +65,9 @@ public:
     class ArgParserException : public std::exception
     {
     public:
-       ArgParserException(const std::string& s)
+       ArgParserException(std::string s)
            :
-           _msg(s)
+           _msg(std::move(s))
        {}
        
        virtual ~ArgParserException() throw() {}
diff --git a/libbase/string_table.h b/libbase/string_table.h
index 0f14240..0ebdf5c 100644
--- a/libbase/string_table.h
+++ b/libbase/string_table.h
@@ -45,9 +45,9 @@ public:
        /// A little helper for indexing.
        struct svt
        {
-               svt(const std::string& val, std::size_t i)
+               svt(std::string val, std::size_t i)
             :
-                       value(val),
+                       value(std::move(val)),
             id(i)
         {}
 
diff --git a/libbase/tree.hh b/libbase/tree.hh
index 74b44bb..86c294b 100644
--- a/libbase/tree.hh
+++ b/libbase/tree.hh
@@ -43,7 +43,7 @@ template<class T>
 class tree_node_ { // size: 5*4=20 bytes (on 32 bit arch), can be reduced by 8.
        public:
                tree_node_();
-               tree_node_(const T&);
+               tree_node_(T );
 
                tree_node_<T> *parent;
           tree_node_<T> *first_child, *last_child;
@@ -58,8 +58,8 @@ tree_node_<T>::tree_node_()
        }
 
 template<class T>
-tree_node_<T>::tree_node_(const T& val)
-       : parent(nullptr), first_child(nullptr), last_child(nullptr), 
prev_sibling(nullptr), next_sibling(nullptr), data(val)
+tree_node_<T>::tree_node_(const T val)
+       : parent(nullptr), first_child(nullptr), last_child(nullptr), 
prev_sibling(nullptr), next_sibling(nullptr), data(std::move(val))
        {
        }
 
diff --git a/libcore/ClassHierarchy.cpp b/libcore/ClassHierarchy.cpp
index 4d9f5cb..8984c5a 100644
--- a/libcore/ClassHierarchy.cpp
+++ b/libcore/ClassHierarchy.cpp
@@ -64,10 +64,10 @@ public:
 
     bool isBuiltin() { return true; }
 
-    declare_native_function(const ClassHierarchy::NativeClass &c, as_object *g)
+    declare_native_function(ClassHierarchy::NativeClass c, as_object *g)
         :
         as_function(getGlobal(*g)),
-        _decl(c),
+        _decl(std::move(c)),
         mTarget(g)
     {
     }
diff --git a/libcore/ClassHierarchy.h b/libcore/ClassHierarchy.h
index 99ae147..8532f1c 100644
--- a/libcore/ClassHierarchy.h
+++ b/libcore/ClassHierarchy.h
@@ -67,10 +67,10 @@ public:
         /// The type of function to use for initialization
                typedef void (*InitFunc)(as_object& obj, const ObjectURI& uri);
 
-        NativeClass(InitFunc init, const ObjectURI& u, int ver)
+        NativeClass(InitFunc init, ObjectURI u, int ver)
             :
             initializer(init),
-            uri(u),
+            uri(std::move(u)),
             version(ver)
         {}
 
diff --git a/libcore/DisplayObjectContainer.cpp 
b/libcore/DisplayObjectContainer.cpp
index 64e8a7d..f1b96a1 100644
--- a/libcore/DisplayObjectContainer.cpp
+++ b/libcore/DisplayObjectContainer.cpp
@@ -48,7 +48,7 @@ public:
             DisplayObject::InfoTree::iterator it)
         :
         _tr(tr),
-        _it(it)
+        _it(std::move(it))
     {}
 
     void operator()(DisplayObject* ch) {
diff --git a/libcore/FillStyle.cpp b/libcore/FillStyle.cpp
index 791677a..fb5f466 100644
--- a/libcore/FillStyle.cpp
+++ b/libcore/FillStyle.cpp
@@ -100,12 +100,12 @@ GradientFill::setFocalPoint(double d)
     _focalPoint = clamp<float>(d, -1, 1); 
 }
 
-BitmapFill::BitmapFill(Type t, const CachedBitmap* bi, const SWFMatrix& m,
+BitmapFill::BitmapFill(Type t, const CachedBitmap* bi, SWFMatrix m,
         SmoothingPolicy pol)
     :
     _type(t),
     _smoothingPolicy(pol),
-    _matrix(m),
+    _matrix(std::move(m)),
     _bitmapInfo(bi),
     _md(nullptr),
     _id(0)
@@ -113,11 +113,11 @@ BitmapFill::BitmapFill(Type t, const CachedBitmap* bi, 
const SWFMatrix& m,
 }
     
 BitmapFill::BitmapFill(SWF::FillType t, movie_definition* md,
-        std::uint16_t id, const SWFMatrix& m)
+        std::uint16_t id, SWFMatrix m)
     :
     _type(),
     _smoothingPolicy(),
-    _matrix(m),
+    _matrix(std::move(m)),
     _bitmapInfo(nullptr),
     _md(md),
     _id(id)
diff --git a/libcore/FillStyle.h b/libcore/FillStyle.h
index 1e8a872..8049643 100644
--- a/libcore/FillStyle.h
+++ b/libcore/FillStyle.h
@@ -40,10 +40,10 @@ namespace gnash {
 class GradientRecord
 {
 public:
-    GradientRecord(std::uint8_t ratio, const rgba& color)
+    GradientRecord(std::uint8_t ratio, rgba color)
         :
         ratio(ratio),
-        color(color)
+        color(std::move(color))
     { }
     
     //data:
@@ -90,12 +90,12 @@ public:
     /// Construct a BitmapFill from arbitrary bitmap data.
     //
     /// TODO: check the smoothing policy here!
-    BitmapFill(Type t, const CachedBitmap* bi, const SWFMatrix& m,
+    BitmapFill(Type t, const CachedBitmap* bi, SWFMatrix m,
             SmoothingPolicy pol);
 
     /// Construct a static BitmapFill using a SWF tag.
     BitmapFill(SWF::FillType t, movie_definition* md, std::uint16_t id,
-            const SWFMatrix& m);
+            SWFMatrix m);
 
     /// Destructor
     ~BitmapFill();
@@ -248,9 +248,9 @@ struct DSOEXPORT SolidFill
 public:
 
     /// Construct a SolidFill.
-    explicit SolidFill(const rgba& c)
+    explicit SolidFill(rgba c)
         :
-        _color(c)
+        _color(std::move(c))
     { }
 
     /// Copy a SolidFill.
diff --git a/libcore/Filters.h b/libcore/Filters.h
index 5c1e09e..d99696b 100644
--- a/libcore/Filters.h
+++ b/libcore/Filters.h
@@ -22,6 +22,7 @@
 
 #include <cstdint>
 #include <vector>
+#include <utility>
 
 namespace gnash {
     class SWFStream;
@@ -132,7 +133,7 @@ public:
     {}
 
     ColorMatrixFilter(std::vector<float> a_matrix) :
-        m_matrix(a_matrix)
+        m_matrix(std::move(a_matrix))
     {}
 
 protected:
@@ -163,13 +164,13 @@ public:
     {}
 
     ConvolutionFilter(std::uint8_t matrixX, std::uint8_t matrixY,
-        const std::vector<float>& _matrix, float divisor, float bias,
+        std::vector<float>  _matrix, float divisor, float bias,
         bool preserveAlpha, bool clamp, std::uint32_t color,
         std::uint8_t alpha)
         :
         _matrixX(matrixX),
         _matrixY(matrixY),
-        _matrix(_matrix),
+        _matrix(std::move(_matrix)),
         _divisor(divisor),
         _bias(bias),
         _preserveAlpha(preserveAlpha),
@@ -291,7 +292,7 @@ public:
         float blurX, float blurY, float strength,
         std::uint8_t quality, glow_types type, bool knockout) :
         m_distance(distance), m_angle(angle),
-        m_colors(colors), m_alphas(alphas), m_ratios(ratios),
+        m_colors(std::move(colors)), m_alphas(std::move(alphas)), 
m_ratios(std::move(ratios)),
         m_blurX(blurX), m_blurY(blurY), m_strength(strength),
         m_quality(quality), m_type(type), m_knockout(knockout)
     {}
@@ -337,8 +338,8 @@ public:
         std::vector<std::uint8_t> ratios,
         float blurX, float blurY, float strength,
         std::uint8_t quality, glow_types type, bool knockout) :
-        m_distance(distance), m_angle(angle), m_colors(colors), 
m_alphas(alphas),
-        m_ratios(ratios), m_blurX(blurX), m_blurY(blurY), m_strength(strength),
+        m_distance(distance), m_angle(angle), m_colors(std::move(colors)), 
m_alphas(std::move(alphas)),
+        m_ratios(std::move(ratios)), m_blurX(blurX), m_blurY(blurY), 
m_strength(strength),
         m_quality(quality), m_type(type), m_knockout(knockout)
     {}
 
diff --git a/libcore/Font.cpp b/libcore/Font.cpp
index 3587ca7..1f22fe9 100644
--- a/libcore/Font.cpp
+++ b/libcore/Font.cpp
@@ -88,9 +88,9 @@ Font::Font(std::unique_ptr<SWF::DefineFontTag> ft)
     }
 }
 
-Font::Font(const std::string& name, bool bold, bool italic)
+Font::Font(std::string name, bool bold, bool italic)
     :
-    _name(name),
+    _name(std::move(name)),
     _unicodeChars(false),
     _shiftJISChars(false),
     _ansiChars(true),
diff --git a/libcore/Font.h b/libcore/Font.h
index 948a200..49273f1 100644
--- a/libcore/Font.h
+++ b/libcore/Font.h
@@ -105,7 +105,7 @@ public:
     ///
     /// @param italic
     ///    Whether to use the italic variant of the font.
-    Font(const std::string& name, bool bold = false, bool italic = false);
+    Font(std::string name, bool bold = false, bool italic = false);
 
     ~Font();
 
diff --git a/libcore/Function.h b/libcore/Function.h
index bb0223c..9ed4662 100644
--- a/libcore/Function.h
+++ b/libcore/Function.h
@@ -130,7 +130,7 @@ protected:
        
     struct Argument
        {
-        Argument(std::uint8_t r, const ObjectURI& n) : reg(r), name(n) {}
+        Argument(std::uint8_t r, ObjectURI n) : reg(r), name(std::move(n)) {}
         std::uint8_t reg;
         ObjectURI name;
        };
diff --git a/libcore/HostInterface.h b/libcore/HostInterface.h
index d305262..feeead7 100644
--- a/libcore/HostInterface.h
+++ b/libcore/HostInterface.h
@@ -66,11 +66,11 @@ namespace gnash {
 class CustomMessage
 {
 public:
-    explicit CustomMessage(const std::string& s,
-            const boost::any& arg = boost::blank())
+    explicit CustomMessage(std::string s,
+            boost::any arg = boost::blank())
         :
-        _name(s),
-        _arg(arg)
+        _name(std::move(s)),
+        _arg(std::move(arg))
     {}
     const std::string& name() const { return _name; }
     const boost::any& arg() const { return _arg; }
@@ -181,10 +181,10 @@ public:
         EXTERNALINTERFACE_ZOOM
     };
 
-    explicit HostMessage(KnownEvent e, const boost::any& arg = boost::blank())
+    explicit HostMessage(KnownEvent e, boost::any arg = boost::blank())
         :
         _event(e),
-        _arg(arg)
+        _arg(std::move(arg))
     {}
 
     KnownEvent event() const { return _event; }
diff --git a/libcore/LineStyle.h b/libcore/LineStyle.h
index 4d50bac..a45f26b 100644
--- a/libcore/LineStyle.h
+++ b/libcore/LineStyle.h
@@ -24,6 +24,7 @@
 
 #include "RGBA.h"
 #include "SWF.h"
+#include <utility>
 
 namespace gnash {
     class SWFStream;
@@ -66,7 +67,7 @@ public:
     /// @param endCapStyle
     /// @param joinStyle
     /// @param miterLimitFactor
-    LineStyle(std::uint16_t width, const rgba& color,
+    LineStyle(std::uint16_t width, rgba color,
             bool scaleThicknessVertically=true,
             bool scaleThicknessHorizontally=true,
             bool pixelHinting=false,
@@ -78,7 +79,7 @@ public:
         )
         :
         m_width(width),
-        m_color(color),
+        m_color(std::move(color)),
         _scaleVertically(scaleThicknessVertically),
         _scaleHorizontally(scaleThicknessHorizontally),
         _pixelHinting(pixelHinting),
diff --git a/libcore/MovieLoader.h b/libcore/MovieLoader.h
index deeec50..6bb9f1f 100644
--- a/libcore/MovieLoader.h
+++ b/libcore/MovieLoader.h
@@ -92,11 +92,11 @@ private:
         /// @param postdata
         ///   If not null POST method will be used for HTTP.
         ///
-        Request(const URL& u, const std::string& t,
+        Request(URL u, std::string t,
                 const std::string* postdata, as_object* handler)
                 :
-                _target(t),
-                _url(u),
+                _target(std::move(t)),
+                _url(std::move(u)),
                 _usePost(false),
                 _mdef(nullptr),
                 _mutex(),
diff --git a/libcore/Property.h b/libcore/Property.h
index 8b3c991..6c1fd56 100644
--- a/libcore/Property.h
+++ b/libcore/Property.h
@@ -289,32 +289,32 @@ class Property
 
 public:
 
-       Property(const ObjectURI& uri, const as_value& value,
-            const PropFlags& flags)
+       Property(ObjectURI uri, const as_value& value,
+            PropFlags flags)
         :
         _bound(value),
-               _uri(uri),
-               _flags(flags),
+               _uri(std::move(uri)),
+               _flags(std::move(flags)),
         _destructive(false)
        {}
 
-       Property(const ObjectURI& uri,
+       Property(ObjectURI uri,
                as_function* getter, as_function* setter, 
-               const PropFlags& flags, bool destroy = false)
+               PropFlags flags, bool destroy = false)
         :
         _bound(GetterSetter(getter, setter)),
-        _uri(uri),
-               _flags(flags), 
+        _uri(std::move(uri)),
+               _flags(std::move(flags)), 
                _destructive(destroy)
        {}
 
-       Property(const ObjectURI& uri, as_c_function_ptr getter,
-            as_c_function_ptr setter, const PropFlags& flags,
+       Property(ObjectURI uri, as_c_function_ptr getter,
+            as_c_function_ptr setter, PropFlags flags,
             bool destroy = false)
                :
         _bound(GetterSetter(getter, setter)),
-        _uri(uri),
-               _flags(flags),
+        _uri(std::move(uri)),
+               _flags(std::move(flags)),
         _destructive(destroy)
        {}
 
diff --git a/libcore/Transform.h b/libcore/Transform.h
index cd334c6..d254112 100644
--- a/libcore/Transform.h
+++ b/libcore/Transform.h
@@ -22,6 +22,7 @@
 
 #include "SWFMatrix.h"
 #include "SWFCxForm.h"
+#include <utility>
 
 namespace gnash {
 
@@ -36,11 +37,11 @@ public:
     /// Construct a Transform
     //
     /// Any arguments not supplied are identity transformations.
-    explicit Transform(const SWFMatrix& m = SWFMatrix(),
-            const SWFCxForm& cx = SWFCxForm())
+    explicit Transform(SWFMatrix m = SWFMatrix(),
+            SWFCxForm cx = SWFCxForm())
         :
-        matrix(m),
-        colorTransform(cx)
+        matrix(std::move(m)),
+        colorTransform(std::move(cx))
     {}
 
     Transform(const Transform& other)
diff --git a/libcore/as_object.cpp b/libcore/as_object.cpp
index 183a402..ed0a53a 100644
--- a/libcore/as_object.cpp
+++ b/libcore/as_object.cpp
@@ -52,7 +52,7 @@ public:
         _object(top),
         _uri(uri),
         _iterations(0),
-        _condition(cmp)
+        _condition(std::move(cmp))
     {
         _visited.insert(top);
     }
diff --git a/libcore/as_object.h b/libcore/as_object.h
index 35a9474..585b311 100644
--- a/libcore/as_object.h
+++ b/libcore/as_object.h
@@ -60,10 +60,10 @@ class Trigger
 {
 public:
 
-    Trigger(const std::string& propname, as_function& trig,
+    Trigger(std::string propname, as_function& trig,
             const as_value& customArg)
         :
-        _propname(propname),
+        _propname(std::move(propname)),
         _func(&trig),
         _customArg(customArg),
         _executing(false),
diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index 8e2b713..c123fee 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -711,8 +711,8 @@ public:
     // Note: cmpfn must implement a strict weak ordering
     as_value_prop(ObjectURI name, as_cmp_fn cmpfn, const as_object& o)
         :
-        _comp(cmpfn),
-        _prop(name),
+        _comp(std::move(cmpfn)),
+        _prop(std::move(name)),
         _obj(o)
     {
     }
diff --git a/libcore/asobj/ContextMenu_as.cpp b/libcore/asobj/ContextMenu_as.cpp
index b8057f7..8134bae 100644
--- a/libcore/asobj/ContextMenu_as.cpp
+++ b/libcore/asobj/ContextMenu_as.cpp
@@ -58,7 +58,7 @@ namespace {
 class CopyMenuItems
 {
 public:
-    CopyMenuItems(const ObjectURI& c, as_object& nc) : _c(c), _target(nc) {}
+    CopyMenuItems(ObjectURI c, as_object& nc) : _c(std::move(c)), _target(nc) 
{}
 
     void operator()(const as_value& val) {
         as_object* obj = toObject(val, getVM(_target));
diff --git a/libcore/asobj/String_as.cpp b/libcore/asobj/String_as.cpp
index 0a114ee..6477904 100644
--- a/libcore/asobj/String_as.cpp
+++ b/libcore/asobj/String_as.cpp
@@ -73,9 +73,9 @@ namespace {
 
 }
 
-String_as::String_as(const std::string& s)
+String_as::String_as(std::string s)
     :
-    _string(s)
+    _string(std::move(s))
 {
 }
 
diff --git a/libcore/asobj/String_as.h b/libcore/asobj/String_as.h
index 48d7c28..2f81c53 100644
--- a/libcore/asobj/String_as.h
+++ b/libcore/asobj/String_as.h
@@ -35,7 +35,7 @@ class String_as : public Relay
 
 public:
 
-    explicit String_as(const std::string& s);
+    explicit String_as(std::string s);
 
     const std::string& value() {
         return _string;
diff --git a/libcore/parser/BitmapMovieDefinition.cpp 
b/libcore/parser/BitmapMovieDefinition.cpp
index c42996c..69d8a03 100644
--- a/libcore/parser/BitmapMovieDefinition.cpp
+++ b/libcore/parser/BitmapMovieDefinition.cpp
@@ -40,13 +40,13 @@ BitmapMovieDefinition::createMovie(Global_as& gl, 
DisplayObject* parent)
 
 BitmapMovieDefinition::BitmapMovieDefinition(
         std::unique_ptr<image::GnashImage> image,
-               Renderer* renderer, const std::string& url)
+               Renderer* renderer, std::string url)
        :
        _version(6),
        _framesize(0, 0, image->width()*20, image->height()*20),
        _framecount(1),
        _framerate(12),
-       _url(url),
+       _url(std::move(url)),
        _bytesTotal(image->size()),
        _bitmap(renderer ? renderer->createCachedBitmap(std::move(image)) : 
nullptr)
 {
diff --git a/libcore/parser/BitmapMovieDefinition.h 
b/libcore/parser/BitmapMovieDefinition.h
index 2d7ccfb..1caddf3 100644
--- a/libcore/parser/BitmapMovieDefinition.h
+++ b/libcore/parser/BitmapMovieDefinition.h
@@ -59,7 +59,7 @@ public:
        ///  - provided url
        ///
        BitmapMovieDefinition(std::unique_ptr<image::GnashImage> image,
-            Renderer* renderer, const std::string& url);
+            Renderer* renderer, std::string url);
 
     virtual DisplayObject* createDisplayObject(Global_as&, DisplayObject*)
         const;
diff --git a/libcore/swf/DefineBitsTag.cpp b/libcore/swf/DefineBitsTag.cpp
index 8135550..1e20bd8 100644
--- a/libcore/swf/DefineBitsTag.cpp
+++ b/libcore/swf/DefineBitsTag.cpp
@@ -77,7 +77,7 @@ class StreamAdapter : public IOChannel
         :
         s(str),
         startPos(s.tell()),
-        endPos(maxPos),
+        endPos(std::move(maxPos)),
         currPos(startPos)
     {
         assert(endPos >= startPos);
diff --git a/libcore/swf/ShapeRecord.cpp b/libcore/swf/ShapeRecord.cpp
index d8eb24c..275d378 100644
--- a/libcore/swf/ShapeRecord.cpp
+++ b/libcore/swf/ShapeRecord.cpp
@@ -52,8 +52,8 @@ public:
     Lerp(typename T::const_iterator style1, typename T::const_iterator style2,
             const double ratio)
         :
-        _style1(style1),
-        _style2(style2),
+        _style1(std::move(style1)),
+        _style2(std::move(style2)),
         _ratio(ratio)
     {}
 
diff --git a/libcore/swf/TagLoadersTable.h b/libcore/swf/TagLoadersTable.h
index 4269c18..b550685 100644
--- a/libcore/swf/TagLoadersTable.h
+++ b/libcore/swf/TagLoadersTable.h
@@ -54,9 +54,9 @@ public:
        TagLoadersTable() {}
 
     /// Construct a TagLoadersTable by copying another table
-    TagLoadersTable(const Loaders& loaders)
+    TagLoadersTable(Loaders loaders)
         :
-        _loaders(loaders)
+        _loaders(std::move(loaders))
     {}
        
     ~TagLoadersTable() {}
diff --git a/libcore/vm/ActionExec.h b/libcore/vm/ActionExec.h
index 85c00db..5786dae 100644
--- a/libcore/vm/ActionExec.h
+++ b/libcore/vm/ActionExec.h
@@ -58,7 +58,7 @@ public:
                _afterTriedOffset(cur_off + try_size + catch_size + 
finally_size),
                _savedEndOffset(0),
                _hasName(true),
-               _name(catchName),
+               _name(std::move(catchName)),
                _registerIndex(0),
                _tryState(TryBlock::TRY_TRY),
                _lastThrow()
diff --git a/librender/agg/LinearRGB.h b/librender/agg/LinearRGB.h
index 5be8daf..db84b8b 100644
--- a/librender/agg/LinearRGB.h
+++ b/librender/agg/LinearRGB.h
@@ -19,6 +19,8 @@
 #ifndef GNASH_AGG_LINEAR_INTERPOLATOR_H
 #define GNASH_AGG_LINEAR_INTERPOLATOR_H
 
+#include <utility>
+
 #include <cmath>
 
 namespace gnash {
@@ -55,11 +57,11 @@ struct linear_rgb_interpolator
 public:
     typedef ColorT color_type;
 
-    linear_rgb_interpolator(const color_type& c1, const color_type& c2, 
+    linear_rgb_interpolator(color_type c1, color_type c2, 
         size_t len)
         :
-        _c1(c1),
-        _c2(c2),
+        _c1(std::move(c1)),
+        _c2(std::move(c2)),
         _len(len),
         _count(0)
     {}
diff --git a/librender/agg/Renderer_agg_style.h 
b/librender/agg/Renderer_agg_style.h
index 9c2d197..16e177b 100644
--- a/librender/agg/Renderer_agg_style.h
+++ b/librender/agg/Renderer_agg_style.h
@@ -81,10 +81,10 @@ namespace {
 class AggStyle 
 {
 public:
-    AggStyle(bool solid, const agg::rgba8& color = agg::rgba8(0,0,0,0))
+    AggStyle(bool solid, agg::rgba8 color = agg::rgba8(0,0,0,0))
       :
       _solid(solid),
-      _color(color)
+      _color(std::move(color))
     {
     }
     
@@ -242,14 +242,14 @@ class GradientStyle : public AggStyle
 public:
   
     GradientStyle(const GradientFill& fs, const SWFMatrix& mat,
-            const SWFCxForm& cx, int norm_size, GradientType gr = 
GradientType())
+            SWFCxForm cx, int norm_size, GradientType gr = GradientType())
         :
         AggStyle(false),
-        m_cx(cx),
+        m_cx(std::move(cx)),
         m_tr(mat.a() / 65536.0, mat.b() / 65536.0, mat.c() / 65536.0,
               mat.d() / 65536.0, mat.tx(), mat.ty()),
         m_span_interpolator(m_tr),
-        m_gradient_adaptor(gr),
+        m_gradient_adaptor(std::move(gr)),
         m_sg(m_span_interpolator, m_gradient_adaptor, m_gradient_lut, 0,
                 norm_size),
       
@@ -365,10 +365,10 @@ class BitmapStyle : public AggStyle
 public:
     
   BitmapStyle(int width, int height, int rowlen, std::uint8_t* data,
-    const SWFMatrix& mat, const SWFCxForm& cx)
+    const SWFMatrix& mat, SWFCxForm cx)
     :
     AggStyle(false),
-    m_cx(cx),
+    m_cx(std::move(cx)),
     m_rbuf(data, width, height, rowlen),  
     m_pixf(m_rbuf),
     m_img_src(m_pixf),
diff --git a/libsound/EmbedSound.cpp b/libsound/EmbedSound.cpp
index 5ec67fe..f92aa42 100644
--- a/libsound/EmbedSound.cpp
+++ b/libsound/EmbedSound.cpp
@@ -33,9 +33,9 @@ namespace gnash {
 namespace sound {
 
 EmbedSound::EmbedSound(std::unique_ptr<SimpleBuffer> data,
-        const media::SoundInfo& info, int nVolume)
+        media::SoundInfo info, int nVolume)
     :
-    soundinfo(info),
+    soundinfo(std::move(info)),
     volume(nVolume),
     _buf(data.release())
 {
diff --git a/libsound/EmbedSound.h b/libsound/EmbedSound.h
index 9324c39..5a6063e 100644
--- a/libsound/EmbedSound.h
+++ b/libsound/EmbedSound.h
@@ -60,7 +60,7 @@ public:
     /// @param data The encoded sound data.
     /// @param info encoding info
     /// @param volume initial volume (0..100). Optional, defaults to 100.
-    EmbedSound(std::unique_ptr<SimpleBuffer> data, const media::SoundInfo& 
info,
+    EmbedSound(std::unique_ptr<SimpleBuffer> data, media::SoundInfo info,
             int volume);
 
     ~EmbedSound();
diff --git a/libsound/StreamingSoundData.cpp b/libsound/StreamingSoundData.cpp
index 1e10fc8..bb075bf 100644
--- a/libsound/StreamingSoundData.cpp
+++ b/libsound/StreamingSoundData.cpp
@@ -45,10 +45,10 @@ StreamingSoundData::append(std::unique_ptr<SimpleBuffer> 
data,
     return _buffers.size() - 1;
 }
 
-StreamingSoundData::StreamingSoundData(const media::SoundInfo& info,
+StreamingSoundData::StreamingSoundData(media::SoundInfo info,
         int nVolume)
     :
-    soundinfo(info),
+    soundinfo(std::move(info)),
     volume(nVolume)
 {
 }
diff --git a/libsound/StreamingSoundData.h b/libsound/StreamingSoundData.h
index 6f3f52a..75113d3 100644
--- a/libsound/StreamingSoundData.h
+++ b/libsound/StreamingSoundData.h
@@ -58,7 +58,7 @@ public:
     //
     /// @param info encoding info
     /// @param nVolume initial volume (0..100).
-    StreamingSoundData(const media::SoundInfo& info, int nVolume);
+    StreamingSoundData(media::SoundInfo info, int nVolume);
 
     ~StreamingSoundData();
 

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


commit 744fc9c7206df5422a9945c6e426dc37c529c2b8
Author: Bastiaan Jacques <address@hidden>
Date:   Sat May 31 03:17:28 2014 +0200

    Manage some unmanaged pointers.

diff --git a/libmedia/MediaParser.cpp b/libmedia/MediaParser.cpp
index 33a9983..7a7642d 100644
--- a/libmedia/MediaParser.cpp
+++ b/libmedia/MediaParser.cpp
@@ -138,7 +138,7 @@ MediaParser::peekNextVideoFrame() const
 #endif
 
        if (!_videoInfo.get() || _videoFrames.empty()) return nullptr;
-       return _videoFrames.front();
+       return _videoFrames.front().get();
 }
 
 bool
@@ -207,7 +207,7 @@ MediaParser::nextVideoFrame()
 
        std::unique_ptr<EncodedVideoFrame> ret;
        if (_videoFrames.empty()) return ret;
-       ret.reset(_videoFrames.front());
+       ret = std::move(_videoFrames.front());
        _videoFrames.pop_front();
 #ifdef GNASH_DEBUG_MEDIAPARSER
        log_debug("nextVideoFrame: waking up parser (in case it was sleeping)");
@@ -230,7 +230,7 @@ MediaParser::nextAudioFrame()
 
        std::unique_ptr<EncodedAudioFrame> ret;
        if (_audioFrames.empty()) return ret;
-       ret.reset(_audioFrames.front());
+       ret = std::move(_audioFrames.front());
        _audioFrames.pop_front();
 #ifdef GNASH_DEBUG_MEDIAPARSER
        log_debug("nextAudioFrame: waking up parser (in case it was sleeping)");
@@ -264,7 +264,7 @@ MediaParser::peekNextAudioFrame() const
        }
 #endif
        if (!_audioInfo.get() || _audioFrames.empty()) return nullptr;
-       return _audioFrames.front();
+       return _audioFrames.front().get();
 }
 
 void
@@ -280,18 +280,6 @@ MediaParser::stopParserThread()
 MediaParser::~MediaParser()
 {
        stopParserThread();
-
-       for (VideoFrames::iterator i=_videoFrames.begin(),
-               e=_videoFrames.end(); i!=e; ++i)
-       {
-               delete (*i);
-       }
-
-       for (AudioFrames::iterator i=_audioFrames.begin(),
-               e=_audioFrames.end(); i!=e; ++i)
-       {
-               delete (*i);
-       }
 }
 
 void
@@ -301,18 +289,6 @@ MediaParser::clearBuffers()
        std::lock_guard<std::mutex> lock(_qMutex);
 #endif
 
-       for (VideoFrames::iterator i=_videoFrames.begin(),
-               e=_videoFrames.end(); i!=e; ++i)
-       {
-               delete (*i);
-       }
-
-       for (AudioFrames::iterator i=_audioFrames.begin(),
-               e=_audioFrames.end(); i!=e; ++i)
-       {
-               delete (*i);
-       }
-
        _audioFrames.clear();
        _videoFrames.clear();
 
@@ -350,7 +326,7 @@ 
MediaParser::pushEncodedAudioFrame(std::unique_ptr<EncodedAudioFrame> frame)
     }
 
        //log_debug("Inserting audio frame with timestamp %d", 
frame->timestamp);
-       _audioFrames.insert(loc, frame.release());
+       _audioFrames.insert(loc, std::move(frame));
 
 #ifdef LOAD_MEDIA_IN_A_SEPARATE_THREAD
        // if the push reaches a "buffer full" condition, or if we find the 
parsing
@@ -390,7 +366,7 @@ 
MediaParser::pushEncodedVideoFrame(std::unique_ptr<EncodedVideoFrame> frame)
     }
 
        //log_debug("Pushing video frame with timestamp %d", 
frame->timestamp());
-       _videoFrames.insert(loc, frame.release());
+       _videoFrames.insert(loc, std::move(frame));
 
 #ifdef LOAD_MEDIA_IN_A_SEPARATE_THREAD
        waitIfNeeded(lock); // if the push reaches a "buffer full" condition, 
wait to be waken up
diff --git a/libmedia/MediaParser.h b/libmedia/MediaParser.h
index 7cd9a4a..caaf413 100644
--- a/libmedia/MediaParser.h
+++ b/libmedia/MediaParser.h
@@ -712,8 +712,8 @@ protected:
 
 private:
 
-       typedef std::deque<EncodedVideoFrame*> VideoFrames;
-       typedef std::deque<EncodedAudioFrame*> AudioFrames;
+       typedef std::deque<std::unique_ptr<EncodedVideoFrame>> VideoFrames;
+       typedef std::deque<std::unique_ptr<EncodedAudioFrame>> AudioFrames;
 
        /// Return pointer to next encoded video frame in buffer
        //

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


commit 9aa2e0be93ac6ffc64d8971ab3a785e18c163950
Author: Bastiaan Jacques <address@hidden>
Date:   Fri May 30 16:02:37 2014 +0200

    Fix warning about unused variable, which also happens to be affected
    by the static initialization order fiasco.

diff --git a/libdevice/rawfb/RawFBDevice.cpp b/libdevice/rawfb/RawFBDevice.cpp
index ee9bb6e..6c9bf2b 100644
--- a/libdevice/rawfb/RawFBDevice.cpp
+++ b/libdevice/rawfb/RawFBDevice.cpp
@@ -38,17 +38,11 @@ namespace renderer {
 
 namespace rawfb {
     
-// The debug log used by all the gnash libraries.
-static LogFile& dbglogfile = LogFile::getDefaultInstance();
-
-
 RawFBDevice::RawFBDevice()
     : _fd(0),
       _fbmem(nullptr)
 {
     // GNASH_REPORT_FUNCTION;
-
-    //    dbglogfile.setVerbosity();
 }
 
 RawFBDevice::RawFBDevice(int /* vid */)

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


commit fe886481fc3d5efa142da8f91f2fa71c52bf700b
Author: Bastiaan Jacques <address@hidden>
Date:   Fri May 30 00:13:10 2014 +0200

    Replace boost::lexical_cast<string>(<int>) with std::to_string.

diff --git a/gui/ScreenShotter.h b/gui/ScreenShotter.h
index 72ace3e..e3e4fab 100644
--- a/gui/ScreenShotter.h
+++ b/gui/ScreenShotter.h
@@ -23,7 +23,6 @@
 #include <string>
 #include <set>
 #include <algorithm>
-#include <boost/lexical_cast.hpp>
 
 #include "GnashEnums.h"
 
@@ -126,7 +125,7 @@ public:
             if (t) (*t)();
             _done.insert(frameAdvance);
 
-            saveImage(r, boost::lexical_cast<std::string>(frameAdvance));
+            saveImage(r, std::to_string(frameAdvance));
             _immediate = false;
         }
         
diff --git a/libbase/Socket.cpp b/libbase/Socket.cpp
index 88fbd60..43a10ac 100644
--- a/libbase/Socket.cpp
+++ b/libbase/Socket.cpp
@@ -26,7 +26,6 @@
 
 #include <cerrno>
 #include <csignal>
-#include <boost/lexical_cast.hpp>
 #include <cstdint>
 
 #include "GnashSystemNetHeaders.h"
@@ -131,7 +130,7 @@ addrinfo* getAddrInfo(const std::string& hostname, 
std::uint16_t port)
     req.ai_family = AF_UNSPEC;  // Allow IPv4 or IPv6
     req.ai_socktype = SOCK_STREAM;
 
-    std::string portNo = boost::lexical_cast<std::string>(port);
+    std::string portNo = std::to_string(port);
     int code = getaddrinfo(hostname.c_str(), portNo.c_str(), &req, &ans);
     if (code != 0) {
         log_error(_("getaddrinfo() failed with code: #%d - %s"),
diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index ed94e55..8e2b713 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -995,7 +995,7 @@ ObjectURI
 arrayKey(VM& vm, size_t i)
 {
     // TODO: tell getURI that the string is already lowercase!
-    return getURI(vm, boost::lexical_cast<std::string>(i), true);
+    return getURI(vm, std::to_string(i), true);
 }
 
 namespace {
@@ -1559,7 +1559,7 @@ join(as_object* array, const std::string& separator)
 
     for (size_t i = 0; i < size; ++i) {
         if (i) s += separator;
-        const std::string& index = boost::lexical_cast<std::string>(i);
+        const std::string& index = std::to_string(i);
         const as_value& el = getOwnProperty(*array, getURI(vm, index));
         s += el.to_string(version);
     }
diff --git a/libcore/asobj/MovieClip_as.cpp b/libcore/asobj/MovieClip_as.cpp
index da68096..391f037 100644
--- a/libcore/asobj/MovieClip_as.cpp
+++ b/libcore/asobj/MovieClip_as.cpp
@@ -1804,7 +1804,7 @@ movieclip_beginGradientFill(const fn_call& fn)
     gradients.reserve(stops);
     for (size_t i = 0; i < stops; ++i) {
 
-        const ObjectURI& key = getURI(vm, boost::lexical_cast<std::string>(i));
+        const ObjectURI& key = getURI(vm, std::to_string(i));
 
         as_value colVal = getMember(*colors, key);
         std::uint32_t col = colVal.is_number() ? toInt(colVal, getVM(fn)) : 0;
diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index 3fe5bac..60a3fd7 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -27,7 +27,6 @@
 #include <string>
 #include <vector>
 #include <boost/random.hpp>
-#include <boost/lexical_cast.hpp>
 #include <algorithm> 
 
 #include "log.h"
@@ -2371,7 +2370,7 @@ ActionInitArray(ActionExec& thread)
     // Fill the elements with the initial values from the stack.
     for (int i = 0; i < array_size; i++) {
         const ObjectURI& k = 
-            getURI(vm, boost::lexical_cast<std::string>(i));
+            getURI(vm, std::to_string(i));
         ao->set_member(k, env.pop());
     }
 

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

Summary of changes:
 gui/ScreenShotter.cpp                    |    4 +-
 gui/ScreenShotter.h                      |    5 +--
 libbase/NamingPolicy.cpp                 |    4 +-
 libbase/NamingPolicy.h                   |    2 +-
 libbase/Socket.cpp                       |    3 +-
 libbase/StreamProvider.cpp               |    6 ++--
 libbase/StreamProvider.h                 |    2 +-
 libbase/arg_parser.h                     |    5 ++-
 libbase/string_table.h                   |    4 +-
 libbase/tree.hh                          |    6 ++--
 libcore/ClassHierarchy.cpp               |    4 +-
 libcore/ClassHierarchy.h                 |    4 +-
 libcore/DisplayObjectContainer.cpp       |    2 +-
 libcore/FillStyle.cpp                    |    8 +++---
 libcore/FillStyle.h                      |   12 +++++-----
 libcore/Filters.h                        |   13 +++++-----
 libcore/Font.cpp                         |    4 +-
 libcore/Font.h                           |    2 +-
 libcore/Function.h                       |    2 +-
 libcore/HostInterface.h                  |   12 +++++-----
 libcore/LineStyle.h                      |    5 ++-
 libcore/MovieLoader.h                    |    6 ++--
 libcore/Property.h                       |   24 ++++++++++----------
 libcore/Transform.h                      |    9 ++++---
 libcore/as_object.cpp                    |    2 +-
 libcore/as_object.h                      |    4 +-
 libcore/asobj/Array_as.cpp               |    8 +++---
 libcore/asobj/ContextMenu_as.cpp         |    2 +-
 libcore/asobj/MovieClip_as.cpp           |    2 +-
 libcore/asobj/String_as.cpp              |    4 +-
 libcore/asobj/String_as.h                |    2 +-
 libcore/parser/BitmapMovieDefinition.cpp |    4 +-
 libcore/parser/BitmapMovieDefinition.h   |    2 +-
 libcore/swf/DefineBitsTag.cpp            |    2 +-
 libcore/swf/ShapeRecord.cpp              |    4 +-
 libcore/swf/TagLoadersTable.h            |    4 +-
 libcore/vm/ASHandlers.cpp                |    3 +-
 libcore/vm/ActionExec.h                  |    2 +-
 libdevice/rawfb/RawFBDevice.cpp          |    6 -----
 libmedia/MediaParser.cpp                 |   36 +++++-------------------------
 libmedia/MediaParser.h                   |    4 +-
 librender/agg/LinearRGB.h                |    8 ++++--
 librender/agg/Renderer_agg_style.h       |   14 +++++-----
 libsound/EmbedSound.cpp                  |    4 +-
 libsound/EmbedSound.h                    |    2 +-
 libsound/StreamingSoundData.cpp          |    4 +-
 libsound/StreamingSoundData.h            |    2 +-
 47 files changed, 123 insertions(+), 150 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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