From 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Feb 2016 16:18:13 +0300 Subject: Replace most static_cast to shorter versions from defines. --- src/gui/widgets/progressbar.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui/widgets/progressbar.cpp') diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 03db3f97e..455ccc31c 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -161,7 +161,7 @@ void ProgressBar::draw(Graphics *graphics) } updateAlpha(); - mBackgroundColor.a = static_cast(mAlpha * 255); + mBackgroundColor.a = CAST_U32(mAlpha * 255); if (mRedraw || graphics->getRedraw()) { @@ -173,7 +173,7 @@ void ProgressBar::draw(Graphics *graphics) { const unsigned int pad = 2 * mFillPadding; const int maxWidth = mDimension.width - pad; - int width = static_cast(mProgress + int width = CAST_S32(mProgress * static_cast(maxWidth)); if (width > 0) { @@ -194,7 +194,7 @@ void ProgressBar::draw(Graphics *graphics) graphics->setColor(mBackgroundColor); const unsigned int pad = 2 * mFillPadding; const int maxWidth = mDimension.width - pad; - int width = static_cast(mProgress * static_cast(maxWidth)); + int width = CAST_S32(mProgress * static_cast(maxWidth)); if (width > 0) { if (width > maxWidth) @@ -240,7 +240,7 @@ void ProgressBar::safeDraw(Graphics *graphics) } updateAlpha(); - mBackgroundColor.a = static_cast(mAlpha * 255); + mBackgroundColor.a = CAST_U32(mAlpha * 255); graphics->drawImageRect(0, 0, mDimension.width, mDimension.height, mSkin->getBorder()); @@ -248,7 +248,7 @@ void ProgressBar::safeDraw(Graphics *graphics) { const unsigned int pad = 2 * mFillPadding; const int maxWidth = mDimension.width - pad; - int width = static_cast(mProgress + int width = CAST_S32(mProgress * static_cast(maxWidth)); if (width > 0) { @@ -265,7 +265,7 @@ void ProgressBar::safeDraw(Graphics *graphics) graphics->setColor(mBackgroundColor); const unsigned int pad = 2 * mFillPadding; const int maxWidth = mDimension.width - pad; - int width = static_cast(mProgress * static_cast(maxWidth)); + int width = CAST_S32(mProgress * static_cast(maxWidth)); if (width > 0) { if (width > maxWidth) -- cgit v1.2.3-70-g09d2