[Libreoffice-commits] .: idlc/inc registry/source sal/cppunittester sal/inc sal/osl sal/rtl

Fridrich Strba fridrich at kemper.freedesktop.org
Thu Feb 3 13:32:43 PST 2011


 idlc/inc/idlc/idlctypes.hxx         |    4 ++--
 idlc/inc/idlc/options.hxx           |    2 +-
 registry/source/regimpl.hxx         |    8 ++------
 sal/cppunittester/cppunittester.cxx |    2 --
 sal/inc/osl/diagnose.hxx            |   18 ++----------------
 sal/inc/rtl/ustring.hxx             |    8 --------
 sal/osl/all/debugbase.cxx           |    1 -
 sal/rtl/source/bootstrap.cxx        |   13 ++-----------
 sal/rtl/source/unload.cxx           |   32 +++-----------------------------
 9 files changed, 12 insertions(+), 76 deletions(-)

New commits:
commit 9e7fbf366b72b3dd01af4a4ef0af6d8294a923e0
Author: Fridrich Strba <fridrich.strba at bluewin.ch>
Date:   Thu Feb 3 14:05:04 2011 -0700

    some std::hash_map/set -> boost::unordered_map/set changes

diff --git a/idlc/inc/idlc/idlctypes.hxx b/idlc/inc/idlc/idlctypes.hxx
index a23e760..834b8cc 100644
--- a/idlc/inc/idlc/idlctypes.hxx
+++ b/idlc/inc/idlc/idlctypes.hxx
@@ -30,7 +30,7 @@
 
 #include <stdio.h>
 
-#include <hash_map>
+#include <boost/unordered_map.hpp>
 #include <list>
 #include <vector>
 #include <set>
@@ -73,7 +73,7 @@ typedef ::std::list< AstUnionLabel* >  	LabelList;
 
 class AstDeclaration;
 
-typedef ::std::hash_map< ::rtl::OString, AstDeclaration*, HashString, EqualString > DeclMap;
+typedef ::boost::unordered_map< ::rtl::OString, AstDeclaration*, HashString, EqualString > DeclMap;
 typedef ::std::list< AstDeclaration* > DeclList;
 
 class AstScope;
diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx
index 1b725c0..eda2a92 100644
--- a/idlc/inc/idlc/options.hxx
+++ b/idlc/inc/idlc/options.hxx
@@ -31,7 +31,7 @@
 
 #include <idlc/idlctypes.hxx>
 
-typedef	::std::hash_map< ::rtl::OString, 
+typedef	::boost::unordered_map< ::rtl::OString,
                          ::rtl::OString,
                          HashString,
                          EqualString > OptionMap;
diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx
index 085accc..050158b 100644
--- a/registry/source/regimpl.hxx
+++ b/registry/source/regimpl.hxx
@@ -30,7 +30,7 @@
 #define _REGIMPL_HXX_
 
 #include <set>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
 
 #include 	<registry/registry.h>
 #include	<rtl/ustring.hxx>
@@ -168,11 +168,7 @@ private:
                         const rtl::OUString& sName, 
                         sal_Int16 nSpace) const;
 
-#ifdef USE_MSVC_HASH_MAP
-    typedef	std::hash_map< rtl::OUString, ORegKey* > KeyMap;
-#else
-    typedef	std::hash_map< rtl::OUString, ORegKey*, rtl::OUStringHash > KeyMap;
-#endif
+    typedef	boost::unordered_map< rtl::OUString, ORegKey*, rtl::OUStringHash > KeyMap;
 
     sal_uInt32 		m_refCount;
     osl::Mutex	    	m_mutex;
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index 6d1291d..0bbd0ba 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -32,7 +32,6 @@
 #include <cstdlib>
 #include <iostream>
 
-#include "preextstl.h"
 #include "cppunit/CompilerOutputter.h"
 #include "cppunit/TestResult.h"
 #include "cppunit/TestResultCollector.h"
@@ -40,7 +39,6 @@
 #include "cppunit/extensions/TestFactoryRegistry.h"
 #include "cppunit/plugin/PlugInManager.h"
 #include "cppunit/portability/Stream.h"
-#include "postextstl.h"
 #include "osl/thread.h"
 #include "rtl/process.h"
 #include "rtl/string.hxx"
diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx
index 8904e75..211eb50 100644
--- a/sal/inc/osl/diagnose.hxx
+++ b/sal/inc/osl/diagnose.hxx
@@ -43,7 +43,7 @@
 #if ! defined(_RTL_INSTANCE_HXX_)
 #include "rtl/instance.hxx"
 #endif
-#include <hash_set>
+#include <boost/unordered_set.hpp>
 #include <functional>
 #include <typeinfo>
 
@@ -96,22 +96,8 @@ struct VoidPtrHash : ::std::unary_function<void const*, ::std::size_t> {
     }
 };
 
-#ifdef USE_MSVC_HASH_SET
-namespace stdext
-{
-    inline ::std::size_t hash_value( void const* p ) {
-        ::std::size_t const d = static_cast< ::std::size_t >(
-            reinterpret_cast< ::std::ptrdiff_t >(p) );
-        return d + (d >> 3);
-    }
-}
-
-typedef ::std::hash_set<void const*, ::std::hash_compare<void const *>,
+typedef ::boost::unordered_set<void const*, VoidPtrHash, ::std::equal_to<void const*>,
                         ::rtl::Allocator<void const*> > VoidPointerSet;
-#else
-typedef ::std::hash_set<void const*, VoidPtrHash, ::std::equal_to<void const*>,
-                        ::rtl::Allocator<void const*> > VoidPointerSet;
-#endif
 
 struct ObjectRegistryData {
     ObjectRegistryData( ::std::type_info const& rTypeInfo )
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index cbb278b..b4b8f4c 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -1550,14 +1550,6 @@ inline OString OUStringToOString( const OUString & rUnicode,
 
 } /* Namespace */
 
-namespace stdext
-{
-    inline size_t hash_value(const rtl::OUString &rString)
-    {
-        return rtl::OUStringHash()(rString);
-    }
-}
-
 #endif /* __cplusplus */
 
 #endif /* _RTL_USTRING_HXX */
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index 44c9a76..1269324 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -36,7 +36,6 @@
 #include "osl/diagnose.hxx"
 #include "boost/bind.hpp"
 #include <vector>
-#include <algorithm>
 
 // define own ones, independent of OSL_DEBUG_LEVEL:
 #define DEBUGBASE_ENSURE_(c, f, l, m) \
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx
index 8bb7edf..79398dd 100644
--- a/sal/rtl/source/bootstrap.cxx
+++ b/sal/rtl/source/bootstrap.cxx
@@ -50,7 +50,7 @@
 
 #include "macro.hxx"
 
-#include <hash_map>
+#include <boost/unordered_map.hpp>
 #include <list>
 
 #define MY_STRING_(x) # x
@@ -604,19 +604,10 @@ void Bootstrap_Impl::expandValue(
 namespace {
 
 struct bootstrap_map {
-    // map<> may be preferred here, but hash_map<> is implemented fully inline,
-    // thus there is no need to link against the stlport:
-#ifdef USE_MSVC_HASH_MAP
-    typedef std::hash_map<
-        rtl::OUString, Bootstrap_Impl *,
-        std::hash_compare<rtl::OUString>,
-        rtl::Allocator< OUString> > t;
-#else
-    typedef std::hash_map<
+    typedef boost::unordered_map<
         rtl::OUString, Bootstrap_Impl *,
         rtl::OUStringHash, std::equal_to< rtl::OUString >,
         rtl::Allocator< OUString > > t;
-#endif
 
     // get and release must only be called properly synchronized via some mutex
     // (e.g., osl::Mutex::getGlobalMutex()):
diff --git a/sal/rtl/source/unload.cxx b/sal/rtl/source/unload.cxx
index 883f3bf..6bc024a 100644
--- a/sal/rtl/source/unload.cxx
+++ b/sal/rtl/source/unload.cxx
@@ -32,7 +32,7 @@
 #include <rtl/alloc.h>
 #include <rtl/ustring.hxx>
 #include <osl/mutex.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
 #include "rtl/allocator.hxx"
 
 #include <functional>
@@ -157,30 +157,13 @@ struct hashModule
     }
 };
 
-#ifdef USE_MSVC_HASH_MAP
-namespace stdext
-{
-    inline size_t hash_value( const oslModule& rkey)
-    {
-        return (size_t)rkey;
-    }
-}
-
-typedef std::hash_map<
-    oslModule,
-    std::pair<sal_uInt32, component_canUnloadFunc>,
-    std::hash_compare<oslModule>,
-    rtl::Allocator<oslModule>
-> ModuleMap;
-#else
-typedef std::hash_map<
+typedef boost::unordered_map<
     oslModule,
     std::pair<sal_uInt32, component_canUnloadFunc>,
     hashModule,
     std::equal_to<oslModule>,
     rtl::Allocator<oslModule>
 > ModuleMap;
-#endif
 
 typedef ModuleMap::iterator Mod_IT;
 
@@ -323,22 +306,13 @@ struct hashListener
     }
 };
 
-#ifdef USE_MSVC_HASH_MAP
-typedef std::hash_map<
-    sal_Int32,
-    std::pair<rtl_unloadingListenerFunc, void*>,
-    std::hash_compare<sal_Int32>,
-    rtl::Allocator<sal_Int32>
-> ListenerMap;
-#else
-typedef std::hash_map<
+typedef boost::unordered_map<
     sal_Int32,
     std::pair<rtl_unloadingListenerFunc, void*>,
     hashListener,
     std::equal_to<sal_Int32>,
     rtl::Allocator<sal_Int32>
 > ListenerMap;
-#endif
 
 typedef ListenerMap::iterator Lis_IT;
 


More information about the Libreoffice-commits mailing list