From 9e67e628d6cd4b04d192ac5f0528eb3cb691b219 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 21 Jul 2006 19:57:06 +0000 Subject: #i65904# Compiler compatibility changes: made the BOOST_NO_MEMBER_TEMPLATE_FRIENDS path actually work; added SunCC kludge for nested template as function template parameter problem; corrected blend_functor specialization to make msvc happy --- basebmp/inc/basebmp/accessoradapters.hxx | 46 +++++++++++++++++--------------- basebmp/inc/basebmp/accessorfunctors.hxx | 6 ++--- basebmp/inc/basebmp/color.hxx | 6 ++--- basebmp/inc/basebmp/colormisc.hxx | 6 ++--- basebmp/source/bitmapdevice.cxx | 24 +++++++++++++++-- basebmp/source/makefile.mk | 8 ++++-- 6 files changed, 62 insertions(+), 34 deletions(-) (limited to 'basebmp') diff --git a/basebmp/inc/basebmp/accessoradapters.hxx b/basebmp/inc/basebmp/accessoradapters.hxx index 0d0599a43760..b990e592b5e4 100644 --- a/basebmp/inc/basebmp/accessoradapters.hxx +++ b/basebmp/inc/basebmp/accessoradapters.hxx @@ -4,9 +4,9 @@ * * $RCSfile: accessoradapters.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: thb $ $Date: 2006-07-12 15:09:43 $ + * last change: $Author: thb $ $Date: 2006-07-21 20:57:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -61,6 +61,10 @@ template< class WrappedAccessor, typename GetterFunctor, typename SetterFunctor > class UnaryFunctionAccessorAdapter { +public: + typedef typename GetterFunctor::result_type value_type; + typedef typename SetterFunctor::argument_type argument_type; + #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS // making all members public, if no member template friends private: @@ -74,9 +78,6 @@ private: SetterFunctor maSetterFunctor; public: - typedef typename GetterFunctor::result_type value_type; - typedef typename SetterFunctor::argument_type argument_type; - UnaryFunctionAccessorAdapter() : maAccessor(), maGetterFunctor(), @@ -92,7 +93,7 @@ public: maSetterFunctor( rSrc.maSetterFunctor ) {} - template< class T > explicit UnaryFunctionAccessorAdapter( T accessor ) : + template< class T > explicit UnaryFunctionAccessorAdapter( T const& accessor ) : maAccessor( accessor ), maGetterFunctor(), maSetterFunctor() @@ -178,6 +179,10 @@ public: template< class WrappedAccessor, typename SetterFunctor > class BinarySetterFunctionAccessorAdapter { +public: + typedef typename WrappedAccessor::value_type value_type; + typedef typename SetterFunctor::second_argument_type argument_type; + #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS // making all members public, if no member template friends private: @@ -188,9 +193,6 @@ private: SetterFunctor maFunctor; public: - typedef typename WrappedAccessor::value_type value_type; - typedef typename SetterFunctor::second_argument_type argument_type; - BinarySetterFunctionAccessorAdapter() : maAccessor(), maFunctor() @@ -204,7 +206,7 @@ public: maFunctor( rSrc.maFunctor ) {} - template< class T > explicit BinarySetterFunctionAccessorAdapter( T accessor ) : + template< class T > explicit BinarySetterFunctionAccessorAdapter( T const& accessor ) : maAccessor( accessor ), maFunctor() {} @@ -293,6 +295,10 @@ template< class WrappedAccessor1, class WrappedAccessor2, typename Functor > class TernarySetterFunctionAccessorAdapter { +public: + typedef typename WrappedAccessor1::value_type value_type; + typedef typename Functor::third_argument_type argument_type; + #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS // making all members public, if no member template friends private: @@ -304,16 +310,13 @@ private: Functor maFunctor; public: - typedef typename WrappedAccessor1::value_type value_type; - typedef typename Functor::third_argument_type argument_type; - TernarySetterFunctionAccessorAdapter() : ma1stAccessor(), ma2ndAccessor(), maFunctor() {} - template< class T > explicit TernarySetterFunctionAccessorAdapter( T accessor ) : + template< class T > explicit TernarySetterFunctionAccessorAdapter( T const& accessor ) : ma1stAccessor( accessor ), ma2ndAccessor(), maFunctor() @@ -428,6 +431,13 @@ public: template< class WrappedAccessor1, class WrappedAccessor2 > class JoinImageAccessorAdapter { +public: + // TODO(F3): Need numeric traits and a few free functions to + // actually calculate with a pair (semantic: apply every operation + // individually to the contained types) + typedef std::pair value_type; + #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS // making all members public, if no member template friends private: @@ -438,18 +448,12 @@ private: WrappedAccessor2 ma2ndAccessor; public: - // TODO(F3): Need numeric traits and a few free functions to - // actually calculate with a pair (semantic: apply every operation - // individually to the contained types) - typedef std::pair value_type; - JoinImageAccessorAdapter() : ma1stAccessor(), ma2ndAccessor() {} - template< class T > explicit JoinImageAccessorAdapter( T accessor ) : + template< class T > explicit JoinImageAccessorAdapter( T const& accessor ) : ma1stAccessor( accessor ), ma2ndAccessor() {} diff --git a/basebmp/inc/basebmp/accessorfunctors.hxx b/basebmp/inc/basebmp/accessorfunctors.hxx index 89a30772459c..0c22d29a6032 100644 --- a/basebmp/inc/basebmp/accessorfunctors.hxx +++ b/basebmp/inc/basebmp/accessorfunctors.hxx @@ -4,9 +4,9 @@ * * $RCSfile: accessorfunctors.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: thb $ $Date: 2006-07-13 12:03:25 $ + * last change: $Author: thb $ $Date: 2006-07-21 20:57:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -158,7 +158,7 @@ template< typename T, typename M > struct FastIntegerOutputMaskFunctor class BinaryFunctorSplittingWrapper : +template< typename Functor > struct BinaryFunctorSplittingWrapper : public std::binary_function, diff --git a/basebmp/inc/basebmp/color.hxx b/basebmp/inc/basebmp/color.hxx index 72b3325f78ed..218947205a13 100644 --- a/basebmp/inc/basebmp/color.hxx +++ b/basebmp/inc/basebmp/color.hxx @@ -4,9 +4,9 @@ * * $RCSfile: color.hxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: thb $ $Date: 2006-07-12 15:09:44 $ + * last change: $Author: thb $ $Date: 2006-07-21 20:57:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -99,7 +99,7 @@ public: getGreen()==rhs.getGreen() && getBlue()==rhs.getBlue()); } bool operator!=( const Color& rhs ) const { return !(*this==rhs); } - double magnitude() const { return sqrt(getRed()*getRed() + double magnitude() const { return sqrt((double)getRed()*getRed() + getGreen()*getGreen() + getBlue()*getBlue()); } }; diff --git a/basebmp/inc/basebmp/colormisc.hxx b/basebmp/inc/basebmp/colormisc.hxx index c4f1ec0126a4..5a6eeadb3750 100644 --- a/basebmp/inc/basebmp/colormisc.hxx +++ b/basebmp/inc/basebmp/colormisc.hxx @@ -4,9 +4,9 @@ * * $RCSfile: colormisc.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: thb $ $Date: 2006-07-13 12:03:25 $ + * last change: $Author: thb $ $Date: 2006-07-21 20:57:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -130,7 +130,7 @@ template<> struct ColorTraits< Color > }; /// Only defined for 8 bit alpha, currently -template<> template struct ColorTraits< Color >::blend_functor< sal_uInt8, polarity > +template struct ColorTraits< Color >::blend_functor< sal_uInt8, polarity > { typedef ColorBlendFunctor type; }; diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index d43056b7a6a1..324422c23ac2 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -4,9 +4,9 @@ * * $RCSfile: bitmapdevice.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: thb $ $Date: 2006-07-14 14:22:58 $ + * last change: $Author: thb $ $Date: 2006-07-21 20:57:06 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1760,6 +1760,11 @@ struct MaskTraitsGeneric //---------------------------------------------------------------------------------- +// Some compilers don't like the nested template wrap_accessor +// reference in the parameter list - being slightly less type safe, +// then. +#ifndef BASEBMP_NO_NESTED_TEMPLATE_PARAMETER + /// Produces a specialized renderer for the given pixel format template< class FormatTraits, class MaskTraits > BitmapDeviceSharedPtr createRenderer( @@ -1772,6 +1777,21 @@ BitmapDeviceSharedPtr createRenderer( typename FormatTraits::raw_accessor_type>::type const& rAccessor, boost::shared_array< sal_uInt8 > pMem, const PaletteMemorySharedVector& pPal ) + +#else + +template< class FormatTraits, class MaskTraits, class Accessor > +BitmapDeviceSharedPtr createRenderer( + const basegfx::B2IRange& rBounds, + bool bTopDown, + sal_Int32 nScanlineFormat, + sal_Int32 nScanlineStride, + sal_uInt8* pFirstScanline, + Accessor const& rAccessor, + boost::shared_array< sal_uInt8 > pMem, + const PaletteMemorySharedVector& pPal ) + +#endif { typedef typename FormatTraits::iterator_type Iterator; typedef BitmapRenderer< Iterator, diff --git a/basebmp/source/makefile.mk b/basebmp/source/makefile.mk index 3fc5438ccb70..da5006e0c07e 100644 --- a/basebmp/source/makefile.mk +++ b/basebmp/source/makefile.mk @@ -4,9 +4,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.3 $ +# $Revision: 1.4 $ # -# last change: $Author: thb $ $Date: 2006-07-11 11:38:56 $ +# last change: $Author: thb $ $Date: 2006-07-21 20:57:06 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. @@ -43,6 +43,10 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF "$(OS)"=="SOLARIS" && "$(COM)"!="GCC" +CDEFS+= -DBASEBMP_NO_NESTED_TEMPLATE_PARAMETER +.ENDIF + # --- Common ---------------------------------------------------------- SLOFILES = \ -- cgit