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: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-564-g5b4945b
Date: Thu, 21 Jul 2011 17:48:52 +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  5b4945bc401b1360598eec570eb1d4e073b01e01 (commit)
       via  f6c47442693810e3706adc4791aeed5bad25b89d (commit)
      from  918cc12b38e01e6bf6ecadb77b121836f1e8ed04 (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=5b4945bc401b1360598eec570eb1d4e073b01e01


commit 5b4945bc401b1360598eec570eb1d4e073b01e01
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Jul 21 19:18:17 2011 +0200

    Use existing boost functions.

diff --git a/libbase/StringPredicates.h b/libbase/StringPredicates.h
index 95d966d..ac0c76b 100644
--- a/libbase/StringPredicates.h
+++ b/libbase/StringPredicates.h
@@ -15,56 +15,33 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
 
 #ifndef GNASH_STRINGPREDICATES_H
 #define GNASH_STRINGPREDICATES_H
 
 #include <string>
 #include <algorithm>
-#include <boost/algorithm/string/compare.hpp>
+#include <functional>
 #include <boost/algorithm/string/predicate.hpp>
+#include <locale>
 
 namespace gnash {
 
 /// A case-insensitive string comparator
-class StringNoCaseLessThan {
+class StringNoCaseLessThan
+{
 public:
-       bool operator() (const std::string& a, const std::string& b) const
-       {
-               return std::lexicographical_compare(a.begin(), a.end(),
-                                                   b.begin(), b.end(),
-                                                   nocase_less());
+       bool operator()(const std::string& a, const std::string& b) const {
+               return boost::ilexicographical_compare(a, b);
        }
-private:
-
-       class nocase_less
-       {
-       public:
-               nocase_less(const std::locale& locale = std::locale())
-                       : _locale(locale)
-               {}
-
-               bool operator() (const char& a, const char& b) const
-               {
-                       return std::toupper<char>(a, _locale) <
-                              std::toupper<char>(b, _locale);
-               }
-       private:
-               const std::locale& _locale;
-       };
 };
 
-
 /// A case-insensitive string equality operator
-class StringNoCaseEqual {
+class StringNoCaseEqual :
+    public std::binary_function<std::string, std::string, bool>
+{
 public:
-
-    typedef bool result_type;
-
-       bool operator() (const std::string& a, const std::string& b) const
-       {
+       bool operator()(const std::string& a, const std::string& b) const {
                return boost::iequals(a, b);
        }
 };

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


commit f6c47442693810e3706adc4791aeed5bad25b89d
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Jul 21 18:51:28 2011 +0200

    Don't duplicate bind functionality.
    
    Unusually, it's more concise than the alternative.

diff --git a/libbase/GnashAlgorithm.h b/libbase/GnashAlgorithm.h
index e9e8e18..1c60518 100644
--- a/libbase/GnashAlgorithm.h
+++ b/libbase/GnashAlgorithm.h
@@ -25,28 +25,6 @@
 
 namespace gnash {
 
-/// Retrieve the second element of a container with std::pairs.
-template<typename T>
-struct SecondElement
-{
-    typedef typename T::second_type result_type;
-
-    const result_type& operator()(const T& pair) const {
-        return pair.second;
-    }
-};
-
-/// Retrieve the first element of a container with std::pairs.
-template<typename T>
-struct FirstElement
-{
-    typedef typename T::first_type result_type;
-
-    const result_type& operator()(const T& pair) const {
-        return pair.first;
-    }
-};
-
 /// Return a pointer to a type
 template<typename T>
 struct CreatePointer
@@ -73,7 +51,6 @@ void EraseIf(Container& c, Predicate p)
     }
 }
 
-
 /// Get the size of an array without passing a pointer by mistake
 template<typename T, size_t N>
 size_t
@@ -94,8 +71,10 @@ template<typename T, typename U>
 void
 foreachSecond(T begin, T end, U op)
 {
-    typedef SecondElement<typename std::iterator_traits<T>::value_type> S;
-    std::for_each(begin, end, boost::bind(op, boost::bind(S(), _1)));
+    typedef typename std::iterator_traits<T>::value_type value_type;
+
+    std::for_each(begin, end, boost::bind(op,
+                boost::bind(&value_type::second, _1)));
 }
 
 } // namespace gnash
diff --git a/libbase/GnashFactory.h b/libbase/GnashFactory.h
index 747b935..ab84e6e 100644
--- a/libbase/GnashFactory.h
+++ b/libbase/GnashFactory.h
@@ -91,8 +91,7 @@ public:
         Init();
         static_cast<void>(dummy);
         std::transform(_handlers.begin(), _handlers.end(), i,
-                FirstElement<typename Handlers::value_type>());
-
+                boost::bind(&Handlers::value_type::first, _1));
     }
 
     /// Return a Handler identified by a name.
diff --git a/libcore/as_object.cpp b/libcore/as_object.cpp
index c79cbf5..1b9ebb4 100644
--- a/libcore/as_object.cpp
+++ b/libcore/as_object.cpp
@@ -560,7 +560,7 @@ as_object::executeTriggers(Property* prop, const ObjectURI& 
uri,
     
     // This is a particularly clear and concise way of removing dead triggers.
     EraseIf(*_trigs, boost::bind(boost::mem_fn(&Trigger::dead), 
-             boost::bind(SecondElement<TriggerContainer::value_type>(), _1)));
+             boost::bind(&TriggerContainer::value_type::second, _1)));
                     
     // The trigger call could have deleted the property,
     // so we check for its existence again, and do NOT put
diff --git a/libmedia/FLVParser.cpp b/libmedia/FLVParser.cpp
index cc57efc..eb4b876 100644
--- a/libmedia/FLVParser.cpp
+++ b/libmedia/FLVParser.cpp
@@ -566,13 +566,14 @@ void
 FLVParser::fetchMetaTags(OrderedMetaTags& tags, boost::uint64_t ts)
 {
        boost::mutex::scoped_lock lock(_metaTagsMutex);
-       if (!_metaTags.empty())
-       {
+       if (!_metaTags.empty()) {
         MetaTags::iterator it = _metaTags.upper_bound(ts);
+
+        // Copy the first value into the return container.
         std::transform(_metaTags.begin(), it, std::back_inserter(tags),
-                SecondElement<MetaTags::value_type>());
+                boost::bind(&MetaTags::value_type::second, _1));
+
         _metaTags.erase(_metaTags.begin(), it);
-       
        }
 }
 

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

Summary of changes:
 libbase/GnashAlgorithm.h   |   29 ++++-------------------------
 libbase/GnashFactory.h     |    3 +--
 libbase/StringPredicates.h |   43 ++++++++++---------------------------------
 libcore/as_object.cpp      |    2 +-
 libmedia/FLVParser.cpp     |    9 +++++----
 5 files changed, 21 insertions(+), 65 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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