From 36ba43d6ea38062b17f7e63ef659962bfc51c64d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Jun 2017 23:34:34 +0300 Subject: Fix clang-tidy check readability-implicit-bool-cast. --- src/resources/image/subimage.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/resources/image/subimage.cpp') diff --git a/src/resources/image/subimage.cpp b/src/resources/image/subimage.cpp index 7d936ecbf..77d0eb889 100644 --- a/src/resources/image/subimage.cpp +++ b/src/resources/image/subimage.cpp @@ -90,7 +90,7 @@ SubImage::SubImage(Image *const parent, mInternalBounds(), mParent(parent) { - if (mParent) + if (mParent != nullptr) { mParent->incRef(); mParent->SDLTerminateAlphaCache(); @@ -118,7 +118,7 @@ SubImage::SubImage(Image *const parent, mBounds.y = CAST_S16(y); mBounds.w = CAST_U16(width); mBounds.h = CAST_U16(height); - if (mParent) + if (mParent != nullptr) { mInternalBounds.x = mParent->mBounds.x; mInternalBounds.y = mParent->mBounds.y; @@ -145,7 +145,7 @@ SubImage::SubImage(Image *const parent, mInternalBounds(), mParent(parent) { - if (mParent) + if (mParent != nullptr) mParent->incRef(); // Set up the rectangle. @@ -153,7 +153,7 @@ SubImage::SubImage(Image *const parent, mBounds.y = CAST_S16(y); mBounds.w = CAST_U16(width); mBounds.h = CAST_U16(height); - if (mParent) + if (mParent != nullptr) { mInternalBounds.x = mParent->mBounds.x; mInternalBounds.y = mParent->mBounds.y; @@ -196,7 +196,7 @@ SubImage::~SubImage() #ifdef USE_OPENGL mGLImage = 0; #endif // USE_OPENGL - if (mParent) + if (mParent != nullptr) { #ifdef DEBUG_IMAGES logger->log("decref from subminage: %p, parent: %p", @@ -211,7 +211,7 @@ SubImage::~SubImage() Image *SubImage::getSubImage(const int x, const int y, const int w, const int h) { - if (mParent) + if (mParent != nullptr) return mParent->getSubImage(mBounds.x + x, mBounds.y + y, w, h); else return nullptr; -- cgit v1.2.3-70-g09d2