diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-06 23:34:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-07 19:23:40 +0300 |
commit | 36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch) | |
tree | 190156cb88b13a38a6d13c69ee0742cc078065a1 /src/resources/imagewriter.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2 manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip |
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/resources/imagewriter.cpp')
-rw-r--r-- | src/resources/imagewriter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<png_infopp>(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()); |