From 10f996efb1ab913101e1a635f6cda8087758568e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 29 Sep 2011 17:11:14 +0200 Subject: fix trunk gcc compiler errors; second attempt for the previously reverted part --- slideshow/source/inc/tools.hxx | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'slideshow') diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx index 0293fb8a9abe..0aaafe515012 100644 --- a/slideshow/source/inc/tools.hxx +++ b/slideshow/source/inc/tools.hxx @@ -76,6 +76,14 @@ namespace slideshow typedef ::boost::shared_ptr< GDIMetaFile > GDIMetaFileSharedPtr; + template + inline ::std::size_t hash_value( T * const& p ) + { + ::std::size_t d = static_cast< ::std::size_t >( + reinterpret_cast< ::std::ptrdiff_t >(p) ); + return d + (d >> 3); + } + // xxx todo: remove with boost::hash when 1.33 is available template struct hash : ::std::unary_function @@ -84,16 +92,11 @@ namespace slideshow return hash_value(val); } }; - template - inline ::std::size_t hash_value( T * const& p ) - { - ::std::size_t d = static_cast< ::std::size_t >( - reinterpret_cast< ::std::ptrdiff_t >(p) ); - return d + (d >> 3); - } + } +} + +namespace com { namespace sun { namespace star { namespace uno { - // xxx todo: shift to namespace com::sun::star::uno when - // 1.33 is available template inline ::std::size_t hash_value( ::com::sun::star::uno::Reference const& x ) @@ -103,9 +106,15 @@ namespace slideshow ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> const xRoot( x, ::com::sun::star::uno::UNO_QUERY ); - return hash()(xRoot.get()); + return slideshow::internal::hash()(xRoot.get()); } +} } } } + +namespace slideshow +{ + namespace internal + { /** Cycle mode of intrinsic animations */ enum CycleMode -- cgit