summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:10:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:10:40 +0100
commit55f07d4daa76503530d96b9c20b53c59bcd5bcf9 (patch)
tree7ad8a720341e38258dab12597d25616c3bff8807 /vcl/inc
parente235da515af0e2a5d5a0cf80773943b65fdb8f7b (diff)
More loplugin:cstylecast: vcl
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I363c01a1ae9e863fca4fb4589829492d7280d711
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/impoctree.hxx24
-rw-r--r--vcl/inc/listbox.hxx2
-rw-r--r--vcl/inc/octree.hxx8
-rw-r--r--vcl/inc/salframe.hxx8
-rw-r--r--vcl/inc/salwtype.hxx2
5 files changed, 22 insertions, 22 deletions
diff --git a/vcl/inc/impoctree.hxx b/vcl/inc/impoctree.hxx
index fc63122d3e0f..073720a9e319 100644
--- a/vcl/inc/impoctree.hxx
+++ b/vcl/inc/impoctree.hxx
@@ -38,9 +38,9 @@ public:
}
ImpErrorQuad( const BitmapColor& rColor )
- : nRed( (long) rColor.GetRed() << 5 )
- , nGreen( (long) rColor.GetGreen() << 5 )
- , nBlue( (long) rColor.GetBlue() << 5 )
+ : nRed( static_cast<long>(rColor.GetRed()) << 5 )
+ , nGreen( static_cast<long>(rColor.GetGreen()) << 5 )
+ , nBlue( static_cast<long>(rColor.GetBlue()) << 5 )
{
}
@@ -57,16 +57,16 @@ public:
inline void ImpErrorQuad::operator=( const BitmapColor& rColor )
{
- nRed = (long) rColor.GetRed() << 5;
- nGreen = (long) rColor.GetGreen() << 5;
- nBlue = (long) rColor.GetBlue() << 5;
+ nRed = static_cast<long>(rColor.GetRed()) << 5;
+ nGreen = static_cast<long>(rColor.GetGreen()) << 5;
+ nBlue = static_cast<long>(rColor.GetBlue()) << 5;
}
inline ImpErrorQuad& ImpErrorQuad::operator-=( const BitmapColor& rColor )
{
- nRed -= ( (long) rColor.GetRed() << 5 );
- nGreen -= ( (long) rColor.GetGreen() << 5 );
- nBlue -= ( (long) rColor.GetBlue() << 5 );
+ nRed -= ( static_cast<long>(rColor.GetRed()) << 5 );
+ nGreen -= ( static_cast<long>(rColor.GetGreen()) << 5 );
+ nBlue -= ( static_cast<long>(rColor.GetBlue()) << 5 );
return *this;
}
@@ -101,9 +101,9 @@ inline void ImpErrorQuad::ImplAddColorError7( const ImpErrorQuad& rErrQuad )
inline BitmapColor ImpErrorQuad::ImplGetColor()
{
- return BitmapColor( (sal_uInt8) ( ( nRed < 0 ? 0L : nRed > 8160 ? 8160L : nRed ) >> 5 ),
- (sal_uInt8) ( ( nGreen < 0 ? 0L : nGreen > 8160 ? 8160L : nGreen ) >> 5 ),
- (sal_uInt8) ( ( nBlue < 0 ? 0L : nBlue > 8160 ? 8160L : nBlue ) >> 5 ) );
+ return BitmapColor( static_cast<sal_uInt8>( ( nRed < 0 ? 0L : nRed > 8160 ? 8160L : nRed ) >> 5 ),
+ static_cast<sal_uInt8>( ( nGreen < 0 ? 0L : nGreen > 8160 ? 8160L : nGreen ) >> 5 ),
+ static_cast<sal_uInt8>( ( nBlue < 0 ? 0L : nBlue > 8160 ? 8160L : nBlue ) >> 5 ) );
}
class ImpNodeCache
diff --git a/vcl/inc/listbox.hxx b/vcl/inc/listbox.hxx
index 402275af73a0..cea25b5cfeb0 100644
--- a/vcl/inc/listbox.hxx
+++ b/vcl/inc/listbox.hxx
@@ -113,7 +113,7 @@ public:
long GetAddedHeight( sal_Int32 nEndIndex, sal_Int32 nBeginIndex ) const;
long GetEntryHeight( sal_Int32 nPos ) const;
- sal_Int32 GetEntryCount() const { return (sal_Int32 )maEntries.size(); }
+ sal_Int32 GetEntryCount() const { return static_cast<sal_Int32>(maEntries.size()); }
bool HasImages() const { return mnImages != 0; }
OUString GetEntryText( sal_Int32 nPos ) const;
diff --git a/vcl/inc/octree.hxx b/vcl/inc/octree.hxx
index 114425befdc7..7665d9321619 100644
--- a/vcl/inc/octree.hxx
+++ b/vcl/inc/octree.hxx
@@ -75,7 +75,7 @@ public:
inline const BitmapPalette& Octree::GetPalette()
{
- aPal.SetEntryCount( (sal_uInt16) nLeafCount );
+ aPal.SetEntryCount( static_cast<sal_uInt16>(nLeafCount) );
nPalIndex = 0;
CreatePalette( pTree );
return aPal;
@@ -110,9 +110,9 @@ public:
inline sal_uInt16 InverseColorMap::GetBestPaletteIndex( const BitmapColor& rColor )
{
- return pMap[ ( ( (sal_uLong) rColor.GetRed() >> nBits ) << OCTREE_BITS_1 ) |
- ( ( (sal_uLong) rColor.GetGreen() >> nBits ) << OCTREE_BITS ) |
- ( (sal_uLong) rColor.GetBlue() >> nBits ) ];
+ return pMap[ ( ( static_cast<sal_uLong>(rColor.GetRed()) >> nBits ) << OCTREE_BITS_1 ) |
+ ( ( static_cast<sal_uLong>(rColor.GetGreen()) >> nBits ) << OCTREE_BITS ) |
+ ( static_cast<sal_uLong>(rColor.GetBlue()) >> nBits ) ];
}
#endif // INCLUDED_VCL_INC_OCTREE_HXX
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index 652da0177279..766301256f6e 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -90,10 +90,10 @@ typedef sal_uInt64 SalExtStyle;
#define SAL_FRAME_EXT_STYLE_DOCMODIFIED SalExtStyle(0x00000002)
// Flags for SetPosSize
-#define SAL_FRAME_POSSIZE_X ((sal_uInt16)0x0001)
-#define SAL_FRAME_POSSIZE_Y ((sal_uInt16)0x0002)
-#define SAL_FRAME_POSSIZE_WIDTH ((sal_uInt16)0x0004)
-#define SAL_FRAME_POSSIZE_HEIGHT ((sal_uInt16)0x0008)
+#define SAL_FRAME_POSSIZE_X (sal_uInt16(0x0001))
+#define SAL_FRAME_POSSIZE_Y (sal_uInt16(0x0002))
+#define SAL_FRAME_POSSIZE_WIDTH (sal_uInt16(0x0004))
+#define SAL_FRAME_POSSIZE_HEIGHT (sal_uInt16(0x0008))
struct SystemParentData;
struct ImplSVEvent;
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index 1538c8e78a25..c8cce972b788 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -139,7 +139,7 @@ struct SalPaintEvent
{}
};
-#define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
+#define SAL_WHEELMOUSE_EVENT_PAGESCROLL (sal_uLong(0xFFFFFFFF))
struct SalWheelMouseEvent
{
sal_uInt64 mnTime; // Time in ms, when event is created