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/render/surfacegraphics.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/render/surfacegraphics.cpp') diff --git a/src/render/surfacegraphics.cpp b/src/render/surfacegraphics.cpp index 543f2add1..52d0db57f 100644 --- a/src/render/surfacegraphics.cpp +++ b/src/render/surfacegraphics.cpp @@ -48,8 +48,12 @@ void SurfaceGraphics::drawImage(const Image *restrict const image, { FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. - if (!mTarget || !image || !image->mSDLSurface) + if (mTarget == nullptr || + image == nullptr || + image->mSDLSurface == nullptr) + { return; + } const SDL_Rect &imageRect = image->mBounds; SDL_Rect dstRect; @@ -82,8 +86,12 @@ void SurfaceGraphics::copyImage(const Image *restrict const image, { FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. - if (!mTarget || !image || !image->mSDLSurface) + if (mTarget == nullptr || + image == nullptr || + image->mSDLSurface == nullptr) + { return; + } const SDL_Rect &imageRect = image->mBounds; SDL_Rect dstRect; @@ -109,8 +117,12 @@ void SurfaceGraphics::drawImageCached(const Image *restrict const image, { FUNC_BLOCK("Graphics::drawImageCached", 1) // Check that preconditions for blitting are met. - if (!mTarget || !image || !image->mSDLSurface) + if (mTarget == nullptr || + image == nullptr || + image->mSDLSurface == nullptr) + { return; + } const SDL_Rect &rect = image->mBounds; -- cgit v1.2.3-70-g09d2