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-2143-gfaae2eb
Date: Tue, 17 Jun 2014 09:52:19 +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  faae2ebadf60f8cc674363e08c37cd239e8a33a8 (commit)
       via  fa56d9a4e64f9fd1e9a295946c574b01b98178ce (commit)
      from  21b977dfe038f61293998e3bf39616715dd8798c (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=faae2ebadf60f8cc674363e08c37cd239e8a33a8


commit faae2ebadf60f8cc674363e08c37cd239e8a33a8
Author: Bastiaan Jacques <address@hidden>
Date:   Tue Jun 17 11:50:27 2014 +0200

    Write enable_if expressions as static_asserts where possible.

diff --git a/libbase/GnashFactory.h b/libbase/GnashFactory.h
index ed8aa81..a9d1760 100644
--- a/libbase/GnashFactory.h
+++ b/libbase/GnashFactory.h
@@ -85,9 +85,10 @@ public:
     /// Only usable with output iterators.
     template<typename Iterator>
     void
-    listKeys(Iterator i, typename std::enable_if<
-        std::is_same<typename 
std::iterator_traits<Iterator>::iterator_category,
-           std::output_iterator_tag>::value>::type* = 0) {
+    listKeys(Iterator i) {
+        typedef typename std::iterator_traits<Iterator>::iterator_category cat;
+        static_assert(std::is_same<cat, std::output_iterator_tag>::value,
+            "i must be an output iterator.");
         Init();
         std::transform(_handlers.begin(), _handlers.end(), i,
                 std::bind(&Handlers::value_type::first, 
std::placeholders::_1));
diff --git a/libbase/GnashNumeric.h b/libbase/GnashNumeric.h
index 6670eba..34cca6d 100644
--- a/libbase/GnashNumeric.h
+++ b/libbase/GnashNumeric.h
@@ -58,9 +58,11 @@ isFinite(double d)
 
 template <typename T>
 inline
-typename std::enable_if<std::is_floating_point<T>::value, bool>::type
+bool
 isNaN(const T& num)
 {
+    static_assert(std::is_floating_point<T>::value,
+        "isNaN() is only meaningful for floating point types.");
     return num != num;
 }
 

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


commit fa56d9a4e64f9fd1e9a295946c574b01b98178ce
Author: Bastiaan Jacques <address@hidden>
Date:   Mon Jun 16 01:00:36 2014 +0200

    Don't bother wrapping SimpleBuffer in a unique_ptr.

diff --git a/libcore/swf/StreamSoundBlockTag.cpp 
b/libcore/swf/StreamSoundBlockTag.cpp
index 1a9dbcc..eea639c 100644
--- a/libcore/swf/StreamSoundBlockTag.cpp
+++ b/libcore/swf/StreamSoundBlockTag.cpp
@@ -104,10 +104,10 @@ StreamSoundBlockTag::loader(SWFStream& in, TagType tag, 
movie_definition& m,
     const size_t padding = mh ? mh->getInputPaddingSize() : 0;
 
     // Reserve padding too.
-    std::unique_ptr<SimpleBuffer> buf(new SimpleBuffer(dataLength + padding));
-    buf->resize(dataLength);
+    SimpleBuffer buf(dataLength + padding);
+    buf.resize(dataLength);
 
-    const unsigned int bytesRead = in.read((char*)buf->data(), dataLength);
+    const unsigned int bytesRead = in.read((char*)buf.data(), dataLength);
     
     if (bytesRead < dataLength) {
         throw ParserException(_("Tag boundary reported past end of stream!"));
diff --git a/libsound/StreamingSoundData.cpp b/libsound/StreamingSoundData.cpp
index 7beba4d..d02c07f 100644
--- a/libsound/StreamingSoundData.cpp
+++ b/libsound/StreamingSoundData.cpp
@@ -35,11 +35,10 @@ namespace sound {
 
 
 size_t
-StreamingSoundData::append(std::unique_ptr<SimpleBuffer> data,
+StreamingSoundData::append(SimpleBuffer data,
         size_t sampleCount, int seekSamples)
 {
-    assert(data.get());
-    _buffers.push_back(data.release());
+    _buffers.push_back(std::move(data));
     _blockData.emplace_back(sampleCount, seekSamples);
     assert(_blockData.size() == _buffers.size());
     return _buffers.size() - 1;
diff --git a/libsound/StreamingSoundData.h b/libsound/StreamingSoundData.h
index 75113d3..997b4b8 100644
--- a/libsound/StreamingSoundData.h
+++ b/libsound/StreamingSoundData.h
@@ -25,7 +25,6 @@
 #include <list>
 #include <memory>
 #include <mutex>
-#include <boost/ptr_container/ptr_vector.hpp>
 
 #include "SoundInfo.h" 
 
@@ -68,7 +67,7 @@ public:
     ///                      padded (see MediaHandler::getInputPaddingBytes())
     /// @param sampleCount   The number of samples when decoded.
     /// @param seekSamples   Where to start playing from at a particular frame.
-    size_t append(std::unique_ptr<SimpleBuffer> data, size_t sampleCount,
+    size_t append(SimpleBuffer data, size_t sampleCount,
             int seekSamples);
 
     /// Do we have any data?
@@ -183,7 +182,7 @@ private:
     /// Mutex protecting access to _soundInstances
     mutable std::mutex _soundInstancesMutex;
 
-    boost::ptr_vector<SimpleBuffer> _buffers;
+    std::vector<SimpleBuffer> _buffers;
 
     std::vector<BlockData> _blockData;
 };
diff --git a/libsound/sdl/sound_handler_sdl.cpp 
b/libsound/sdl/sound_handler_sdl.cpp
index e46121c..7516869 100644
--- a/libsound/sdl/sound_handler_sdl.cpp
+++ b/libsound/sdl/sound_handler_sdl.cpp
@@ -148,7 +148,7 @@ 
SDL_sound_handler::create_sound(std::unique_ptr<SimpleBuffer> data,
 }
 
 sound_handler::StreamBlockId
-SDL_sound_handler::addSoundBlock(std::unique_ptr<SimpleBuffer> buf,
+SDL_sound_handler::addSoundBlock(SimpleBuffer buf,
         size_t sampleCount, int seekSamples, int handle)
 {
 
diff --git a/libsound/sdl/sound_handler_sdl.h b/libsound/sdl/sound_handler_sdl.h
index 0a5441e..649f31a 100644
--- a/libsound/sdl/sound_handler_sdl.h
+++ b/libsound/sdl/sound_handler_sdl.h
@@ -96,7 +96,7 @@ public:
 
     // See dox in sound_handler.h
     // overridden to serialize access to the data buffer slot
-    virtual StreamBlockId addSoundBlock(std::unique_ptr<SimpleBuffer> buf,
+    virtual StreamBlockId addSoundBlock(SimpleBuffer buf,
            size_t sample_count, int seekSamples, int streamId);
 
     // See dox in sound_handler.h
diff --git a/libsound/sound_handler.cpp b/libsound/sound_handler.cpp
index a984ab5..78ea118 100644
--- a/libsound/sound_handler.cpp
+++ b/libsound/sound_handler.cpp
@@ -76,7 +76,7 @@ ensurePadding(SimpleBuffer& data, media::MediaHandler* m)
 } // anonymous namespace
 
 sound_handler::StreamBlockId
-sound_handler::addSoundBlock(std::unique_ptr<SimpleBuffer> data,
+sound_handler::addSoundBlock(SimpleBuffer data,
         size_t sampleCount, int seekSamples, int handle)
 {
     if (!validHandle(_streamingSounds, handle)) {
@@ -92,8 +92,7 @@ sound_handler::addSoundBlock(std::unique_ptr<SimpleBuffer> 
data,
         return -1;
     }
 
-    assert(data.get());
-    ensurePadding(*data, _mediaHandler);
+    ensurePadding(data, _mediaHandler);
 
     return sounddata->append(std::move(data), sampleCount, seekSamples);
 }
diff --git a/libsound/sound_handler.h b/libsound/sound_handler.h
index 38fddea..a5dd629 100644
--- a/libsound/sound_handler.h
+++ b/libsound/sound_handler.h
@@ -234,7 +234,7 @@ public:
     ///
     /// Gnash's parser calls this to fill up soundstreams data.
     ///
-    /// @param data         The sound data to be stored. May not be null.
+    /// @param data         The sound data to be stored.
     ///                     This should be appropriately padded (@see
     ///                     MediaHandler::getInputPaddingBytes()), or a
     ///                     reallocation will take place here.
@@ -244,7 +244,7 @@ public:
     ///                     to add data to
     /// @return             a handler for the new block for use in playStream()
     /// @throw              SoundException on error
-    virtual StreamBlockId addSoundBlock(std::unique_ptr<SimpleBuffer> data,
+    virtual StreamBlockId addSoundBlock(SimpleBuffer data,
                size_t sampleCount, int seekSamples, int streamId);
 
     /// Returns a SoundInfo object for the sound with the given id.

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

Summary of changes:
 libbase/GnashFactory.h              |    7 ++++---
 libbase/GnashNumeric.h              |    4 +++-
 libcore/swf/StreamSoundBlockTag.cpp |    6 +++---
 libsound/StreamingSoundData.cpp     |    5 ++---
 libsound/StreamingSoundData.h       |    5 ++---
 libsound/sdl/sound_handler_sdl.cpp  |    2 +-
 libsound/sdl/sound_handler_sdl.h    |    2 +-
 libsound/sound_handler.cpp          |    5 ++---
 libsound/sound_handler.h            |    4 ++--
 9 files changed, 20 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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