summaryrefslogtreecommitdiffstats
path: root/include/basebmp
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-29 15:13:23 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-03-29 15:13:45 +0200
commita52cf476e7cec9d0c70dd4ee93cbd328b66479ad (patch)
tree9e03f530d36c1c65f0db9d8698677e802137b3bb /include/basebmp
parentRemove redundant C-style cast (diff)
downloadcore-a52cf476e7cec9d0c70dd4ee93cbd328b66479ad.tar.gz
core-a52cf476e7cec9d0c70dd4ee93cbd328b66479ad.zip
Clean up template-parameter-dependent C-style casts
Change-Id: Ia1ab134a0afbeeb3ae40264bd4233a47df26b734
Diffstat (limited to 'include/basebmp')
-rw-r--r--include/basebmp/accessorfunctors.hxx8
-rw-r--r--include/basebmp/rgbmaskpixelformats.hxx18
2 files changed, 13 insertions, 13 deletions
diff --git a/include/basebmp/accessorfunctors.hxx b/include/basebmp/accessorfunctors.hxx
index 87edfed17290..02e3abaded95 100644
--- a/include/basebmp/accessorfunctors.hxx
+++ b/include/basebmp/accessorfunctors.hxx
@@ -82,7 +82,7 @@ template< typename T,
// mask will be 0, iff m == 0, and 1 otherwise
const T mask( unsigned_cast<T>(m | -m) >> (sizeof(unsigned_T)*8 - 1) );
- return v1*(M)(1-mask) + v2*mask;
+ return v1*static_cast<M>(1-mask) + v2*mask;
}
};
template< typename T,
@@ -98,7 +98,7 @@ template< typename T,
// mask will be 0, iff m == 0, and 1 otherwise
const T mask( unsigned_cast<T>(m | -m) >> (sizeof(unsigned_T)*8 - 1) );
- return v1*mask + v2*(M)(1-mask);
+ return v1*mask + v2*static_cast<M>(1-mask);
}
};
@@ -114,7 +114,7 @@ template< typename T, typename M > struct FastIntegerOutputMaskFunctor<T,M,true>
{
OSL_ASSERT(m<=1);
- return v1*(M)(1-m) + v2*m;
+ return v1*static_cast<M>(1-m) + v2*m;
}
};
template< typename T, typename M > struct FastIntegerOutputMaskFunctor<T,M,false> :
@@ -125,7 +125,7 @@ template< typename T, typename M > struct FastIntegerOutputMaskFunctor<T,M,false
{
OSL_ASSERT(m<=1);
- return v1*m + v2*(M)(1-m);
+ return v1*m + v2*static_cast<M>(1-m);
}
};
diff --git a/include/basebmp/rgbmaskpixelformats.hxx b/include/basebmp/rgbmaskpixelformats.hxx
index 060c0a99e59a..262b17ea983b 100644
--- a/include/basebmp/rgbmaskpixelformats.hxx
+++ b/include/basebmp/rgbmaskpixelformats.hxx
@@ -118,29 +118,29 @@ template< typename PixelType,
// spread the value into the component_type range
ColorType res( (shiftRight(red,
base_type::red_shift-8*
- (signed)sizeof(typename base_type::component_type)+
+ static_cast<signed>(sizeof(typename base_type::component_type))+
base_type::red_bits)) |
(shiftRight(red,
base_type::red_shift-8*
- (signed)sizeof(typename base_type::component_type)+
+ static_cast<signed>(sizeof(typename base_type::component_type))+
2*base_type::red_bits)),
(shiftRight(green,
base_type::green_shift-8*
- (signed)sizeof(typename base_type::component_type)+
+ static_cast<signed>(sizeof(typename base_type::component_type))+
base_type::green_bits)) |
(shiftRight(green,
base_type::green_shift-8*
- (signed)sizeof(typename base_type::component_type)+
+ static_cast<signed>(sizeof(typename base_type::component_type))+
2*base_type::green_bits)),
(shiftRight(blue,
base_type::blue_shift-8*
- (signed)sizeof(typename base_type::component_type)+
+ static_cast<signed>(sizeof(typename base_type::component_type))+
base_type::blue_bits)) |
(shiftRight(blue,
base_type::blue_shift-8*
- (signed)sizeof(typename base_type::component_type)+
+ static_cast<signed>(sizeof(typename base_type::component_type))+
2*base_type::blue_bits)) );
return res;
}
@@ -178,15 +178,15 @@ template< typename PixelType,
BaseValue |
(shiftLeft(red,
base_type::red_shift-8*
- (signed)sizeof(typename base_type::component_type)+
+ static_cast<signed>(sizeof(typename base_type::component_type))+
base_type::red_bits) & RedMask) |
(shiftLeft(green,
base_type::green_shift-8*
- (signed)sizeof(typename base_type::component_type)+
+ static_cast<signed>(sizeof(typename base_type::component_type))+
base_type::green_bits) & GreenMask) |
(shiftLeft(blue,
base_type::blue_shift-8*
- (signed)sizeof(typename base_type::component_type)+
+ static_cast<signed>(sizeof(typename base_type::component_type))+
base_type::blue_bits) & BlueMask) );
return SwapBytes ? byteSwap(res) : res;