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/mobileopenglgraphics.cpp | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/render/mobileopenglgraphics.cpp') diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 853757a22..cc1812107 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -121,13 +121,13 @@ void MobileOpenGLGraphics::initArrays(const int vertCount) restrict2 // need alocate small size, after if limit reached reallocate to double size const size_t sz = mMaxVertices * 4 + 30; vertexBufSize = mMaxVertices; - if (!mFloatTexArray) + if (mFloatTexArray == nullptr) mFloatTexArray = new GLfloat[sz]; - if (!mShortVertArray) + if (mShortVertArray == nullptr) mShortVertArray = new GLshort[sz]; - if (!mFloatTexArrayCached) + if (mFloatTexArrayCached == nullptr) mFloatTexArrayCached = new GLfloat[sz]; - if (!mShortVertArrayCached) + if (mShortVertArrayCached == nullptr) mShortVertArrayCached = new GLshort[sz]; } @@ -283,7 +283,7 @@ void MobileOpenGLGraphics::drawImageInline(const Image *restrict const image, int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) - if (!image) + if (image == nullptr) return; setColorAlpha(image->mAlpha); @@ -307,7 +307,7 @@ void MobileOpenGLGraphics::copyImage(const Image *restrict const image, void MobileOpenGLGraphics::drawImageCached(const Image *restrict const image, int x, int y) restrict2 { - if (!image) + if (image == nullptr) return; if (image->mGLImage != mImageCached) @@ -364,7 +364,7 @@ void MobileOpenGLGraphics::drawPatternCached(const Image *restrict const image, const int w, const int h) restrict2 { - if (!image) + if (image == nullptr) return; if (image->mGLImage != mImageCached) @@ -419,7 +419,7 @@ void MobileOpenGLGraphics::drawPatternCached(const Image *restrict const image, void MobileOpenGLGraphics::completeCache() restrict2 { - if (!mImageCached) + if (mImageCached == 0u) return; setColorAlpha(mAlphaCached); @@ -440,7 +440,7 @@ void MobileOpenGLGraphics::drawRescaledImage(const Image *restrict const image, const int desiredHeight) restrict2 { FUNC_BLOCK("Graphics::drawRescaledImage", 1) - if (!image) + if (image == nullptr) return; const SDL_Rect &imageRect = image->mBounds; @@ -478,7 +478,7 @@ void MobileOpenGLGraphics::drawPatternInline(const Image *restrict const image, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPattern", 1) - if (!image) + if (image == nullptr) return; const SDL_Rect &imageRect = image->mBounds; @@ -544,7 +544,7 @@ void MobileOpenGLGraphics::drawRescaledPattern(const Image * const int scaledHeight) restrict2 { - if (!image) + if (image == nullptr) return; if (scaledWidth == 0 || scaledHeight == 0) @@ -660,7 +660,7 @@ void MobileOpenGLGraphics::calcPatternInline(ImageVertexes * const int w, const int h) const restrict2 { - if (!image || !vert) + if (image == nullptr || vert == nullptr) return; const SDL_Rect &imageRect = image->mBounds; @@ -724,7 +724,7 @@ void MobileOpenGLGraphics::calcTileCollection(ImageCollection * restrict const image, int x, int y) restrict2 { - if (!vertCol || !image) + if (vertCol == nullptr || image == nullptr) return; if (vertCol->currentGLImage != image->mGLImage) { @@ -769,7 +769,7 @@ void MobileOpenGLGraphics::calcPattern(ImageCollection *restrict const vertCol, const int w, const int h) const restrict2 { - if (!vertCol || !image) + if (vertCol == nullptr || image == nullptr) return; ImageVertexes *vert = nullptr; if (vertCol->currentGLImage != image->mGLImage) @@ -851,7 +851,7 @@ void MobileOpenGLGraphics::calcTileVertexesInline(ImageVertexes * void MobileOpenGLGraphics::drawTileVertexes(const ImageVertexes * restrict const vert) restrict2 { - if (!vert) + if (vert == nullptr) return; const Image *const image = vert->image; @@ -872,7 +872,7 @@ void MobileOpenGLGraphics::calcWindow(ImageCollection *restrict const vertCol, { ImageVertexes *vert = nullptr; const Image *const image = imgRect.grid[4]; - if (!image) + if (image == nullptr) return; if (vertCol->currentGLImage != image->mGLImage) { @@ -978,7 +978,7 @@ void MobileOpenGLGraphics::pushClipArea(const Rect &restrict area) restrict2 transX += clipArea.xOffset; transY += clipArea.yOffset; - if (transX || transY) + if (transX != 0 || transY != 0) { glTranslatef(static_cast(transX), static_cast(transY), 0); @@ -1006,7 +1006,7 @@ void MobileOpenGLGraphics::popClipArea() restrict2 const ClipRect &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; - if (transX || transY) + if (transX != 0 || transY != 0) { glTranslatef(static_cast(transX), static_cast(transY), 0); @@ -1294,7 +1294,7 @@ void MobileOpenGLGraphics::dumpSettings() test[2] = 0; test[3] = 0; mglGetIntegerv(f, &test[0]); - if (test[0] || test[1] || test[2] || test[3]) + if (test[0] != 0 || test[1] != 0 || test[2] != 0 || test[3] != 0) { logger->log("\n%d = %d, %d, %d, %d", f, test[0], test[1], test[2], test[3]); -- cgit v1.2.3-60-g2f50