some std::hash_map/set -> boost::unordered_map/set changes
This commit is contained in:
committed by
Fridrich Štrba
parent
712fba7496
commit
f8e27a7c46
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <hash_map>
|
#include <boost/unordered_map.hpp>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
#include <set>
|
||||||
@@ -73,7 +73,7 @@ typedef ::std::list< AstUnionLabel* > LabelList;
|
|||||||
|
|
||||||
class AstDeclaration;
|
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;
|
typedef ::std::list< AstDeclaration* > DeclList;
|
||||||
|
|
||||||
class AstScope;
|
class AstScope;
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include <idlc/idlctypes.hxx>
|
#include <idlc/idlctypes.hxx>
|
||||||
|
|
||||||
typedef ::std::hash_map< ::rtl::OString,
|
typedef ::boost::unordered_map< ::rtl::OString,
|
||||||
::rtl::OString,
|
::rtl::OString,
|
||||||
HashString,
|
HashString,
|
||||||
EqualString > OptionMap;
|
EqualString > OptionMap;
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
#define _REGIMPL_HXX_
|
#define _REGIMPL_HXX_
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <hash_map>
|
#include <boost/unordered_map.hpp>
|
||||||
|
|
||||||
#include <registry/registry.h>
|
#include <registry/registry.h>
|
||||||
#include <rtl/ustring.hxx>
|
#include <rtl/ustring.hxx>
|
||||||
@@ -168,11 +168,7 @@ private:
|
|||||||
const rtl::OUString& sName,
|
const rtl::OUString& sName,
|
||||||
sal_Int16 nSpace) const;
|
sal_Int16 nSpace) const;
|
||||||
|
|
||||||
#ifdef USE_MSVC_HASH_MAP
|
typedef boost::unordered_map< rtl::OUString, ORegKey*, rtl::OUStringHash > KeyMap;
|
||||||
typedef std::hash_map< rtl::OUString, ORegKey* > KeyMap;
|
|
||||||
#else
|
|
||||||
typedef std::hash_map< rtl::OUString, ORegKey*, rtl::OUStringHash > KeyMap;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sal_uInt32 m_refCount;
|
sal_uInt32 m_refCount;
|
||||||
osl::Mutex m_mutex;
|
osl::Mutex m_mutex;
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "preextstl.h"
|
|
||||||
#include "cppunit/CompilerOutputter.h"
|
#include "cppunit/CompilerOutputter.h"
|
||||||
#include "cppunit/TestResult.h"
|
#include "cppunit/TestResult.h"
|
||||||
#include "cppunit/TestResultCollector.h"
|
#include "cppunit/TestResultCollector.h"
|
||||||
@@ -40,7 +39,6 @@
|
|||||||
#include "cppunit/extensions/TestFactoryRegistry.h"
|
#include "cppunit/extensions/TestFactoryRegistry.h"
|
||||||
#include "cppunit/plugin/PlugInManager.h"
|
#include "cppunit/plugin/PlugInManager.h"
|
||||||
#include "cppunit/portability/Stream.h"
|
#include "cppunit/portability/Stream.h"
|
||||||
#include "postextstl.h"
|
|
||||||
#include "osl/thread.h"
|
#include "osl/thread.h"
|
||||||
#include "rtl/process.h"
|
#include "rtl/process.h"
|
||||||
#include "rtl/string.hxx"
|
#include "rtl/string.hxx"
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
#if ! defined(_RTL_INSTANCE_HXX_)
|
#if ! defined(_RTL_INSTANCE_HXX_)
|
||||||
#include "rtl/instance.hxx"
|
#include "rtl/instance.hxx"
|
||||||
#endif
|
#endif
|
||||||
#include <hash_set>
|
#include <boost/unordered_set.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
@@ -96,22 +96,8 @@ struct VoidPtrHash : ::std::unary_function<void const*, ::std::size_t> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_MSVC_HASH_SET
|
typedef ::boost::unordered_set<void const*, VoidPtrHash, ::std::equal_to<void const*>,
|
||||||
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 *>,
|
|
||||||
::rtl::Allocator<void const*> > VoidPointerSet;
|
::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 {
|
struct ObjectRegistryData {
|
||||||
ObjectRegistryData( ::std::type_info const& rTypeInfo )
|
ObjectRegistryData( ::std::type_info const& rTypeInfo )
|
||||||
|
@@ -1550,14 +1550,6 @@ inline OString OUStringToOString( const OUString & rUnicode,
|
|||||||
|
|
||||||
} /* Namespace */
|
} /* Namespace */
|
||||||
|
|
||||||
namespace stdext
|
|
||||||
{
|
|
||||||
inline size_t hash_value(const rtl::OUString &rString)
|
|
||||||
{
|
|
||||||
return rtl::OUStringHash()(rString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* _RTL_USTRING_HXX */
|
#endif /* _RTL_USTRING_HXX */
|
||||||
|
@@ -36,7 +36,6 @@
|
|||||||
#include "osl/diagnose.hxx"
|
#include "osl/diagnose.hxx"
|
||||||
#include "boost/bind.hpp"
|
#include "boost/bind.hpp"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
// define own ones, independent of OSL_DEBUG_LEVEL:
|
// define own ones, independent of OSL_DEBUG_LEVEL:
|
||||||
#define DEBUGBASE_ENSURE_(c, f, l, m) \
|
#define DEBUGBASE_ENSURE_(c, f, l, m) \
|
||||||
|
@@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
#include "macro.hxx"
|
#include "macro.hxx"
|
||||||
|
|
||||||
#include <hash_map>
|
#include <boost/unordered_map.hpp>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#define MY_STRING_(x) # x
|
#define MY_STRING_(x) # x
|
||||||
@@ -604,19 +604,10 @@ void Bootstrap_Impl::expandValue(
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
struct bootstrap_map {
|
struct bootstrap_map {
|
||||||
// map<> may be preferred here, but hash_map<> is implemented fully inline,
|
typedef boost::unordered_map<
|
||||||
// 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<
|
|
||||||
rtl::OUString, Bootstrap_Impl *,
|
rtl::OUString, Bootstrap_Impl *,
|
||||||
rtl::OUStringHash, std::equal_to< rtl::OUString >,
|
rtl::OUStringHash, std::equal_to< rtl::OUString >,
|
||||||
rtl::Allocator< OUString > > t;
|
rtl::Allocator< OUString > > t;
|
||||||
#endif
|
|
||||||
|
|
||||||
// get and release must only be called properly synchronized via some mutex
|
// get and release must only be called properly synchronized via some mutex
|
||||||
// (e.g., osl::Mutex::getGlobalMutex()):
|
// (e.g., osl::Mutex::getGlobalMutex()):
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#include <rtl/alloc.h>
|
#include <rtl/alloc.h>
|
||||||
#include <rtl/ustring.hxx>
|
#include <rtl/ustring.hxx>
|
||||||
#include <osl/mutex.hxx>
|
#include <osl/mutex.hxx>
|
||||||
#include <hash_map>
|
#include <boost/unordered_map.hpp>
|
||||||
#include "rtl/allocator.hxx"
|
#include "rtl/allocator.hxx"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -157,30 +157,13 @@ struct hashModule
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_MSVC_HASH_MAP
|
typedef boost::unordered_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<
|
|
||||||
oslModule,
|
oslModule,
|
||||||
std::pair<sal_uInt32, component_canUnloadFunc>,
|
std::pair<sal_uInt32, component_canUnloadFunc>,
|
||||||
hashModule,
|
hashModule,
|
||||||
std::equal_to<oslModule>,
|
std::equal_to<oslModule>,
|
||||||
rtl::Allocator<oslModule>
|
rtl::Allocator<oslModule>
|
||||||
> ModuleMap;
|
> ModuleMap;
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef ModuleMap::iterator Mod_IT;
|
typedef ModuleMap::iterator Mod_IT;
|
||||||
|
|
||||||
@@ -323,22 +306,13 @@ struct hashListener
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_MSVC_HASH_MAP
|
typedef boost::unordered_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<
|
|
||||||
sal_Int32,
|
sal_Int32,
|
||||||
std::pair<rtl_unloadingListenerFunc, void*>,
|
std::pair<rtl_unloadingListenerFunc, void*>,
|
||||||
hashListener,
|
hashListener,
|
||||||
std::equal_to<sal_Int32>,
|
std::equal_to<sal_Int32>,
|
||||||
rtl::Allocator<sal_Int32>
|
rtl::Allocator<sal_Int32>
|
||||||
> ListenerMap;
|
> ListenerMap;
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef ListenerMap::iterator Lis_IT;
|
typedef ListenerMap::iterator Lis_IT;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user