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/imagewriter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/resources/imagewriter.cpp') diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp index b9287cf8a..a797e2496 100644 --- a/src/resources/imagewriter.cpp +++ b/src/resources/imagewriter.cpp @@ -32,7 +32,7 @@ bool ImageWriter::writePNG(SDL_Surface *const surface, const std::string &filename) { - if (!surface) + if (surface == nullptr) return false; @@ -41,14 +41,14 @@ bool ImageWriter::writePNG(SDL_Surface *const surface, png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); - if (!png_ptr) + if (png_ptr == nullptr) { reportAlways("Had trouble creating png_structp"); return false; } png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) + if (info_ptr == nullptr) { png_destroy_write_struct(&png_ptr, static_cast(nullptr)); reportAlways("Could not create png_info"); @@ -63,7 +63,7 @@ bool ImageWriter::writePNG(SDL_Surface *const surface, } FILE *const fp = fopen(filename.c_str(), "wb"); - if (!fp) + if (fp == nullptr) { reportAlways("could not open file %s for writing", filename.c_str()); -- cgit v1.2.3-70-g09d2