From f98d003e354a1792117b7cbc771d1dd91475a156 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Mar 2011 17:48:29 +0200 Subject: Fix most old style cast except manaserv and libxml2 defines. --- src/resources/imagewriter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/resources/imagewriter.cpp') diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp index bc5fb7905..d5d3de898 100644 --- a/src/resources/imagewriter.cpp +++ b/src/resources/imagewriter.cpp @@ -53,14 +53,14 @@ bool ImageWriter::writePNG(SDL_Surface *surface, const std::string &filename) info_ptr = png_create_info_struct(png_ptr); if (!info_ptr) { - png_destroy_write_struct(&png_ptr, (png_infopp)NULL); + png_destroy_write_struct(&png_ptr, static_cast(NULL)); logger->log1("Could not create png_info"); return false; } if (setjmp(png_jmpbuf(png_ptr))) { - png_destroy_write_struct(&png_ptr, (png_infopp)NULL); + png_destroy_write_struct(&png_ptr, static_cast(NULL)); logger->log("problem writing to %s", filename.c_str()); return false; } @@ -95,8 +95,8 @@ bool ImageWriter::writePNG(SDL_Surface *surface, const std::string &filename) for (int i = 0; i < surface->h; i++) { - row_pointers[i] = (png_bytep)(Uint8 *)surface->pixels - + i * surface->pitch; + row_pointers[i] = static_cast(static_cast( + surface->pixels)) + i * surface->pitch; } png_write_image(png_ptr, row_pointers); @@ -106,7 +106,7 @@ bool ImageWriter::writePNG(SDL_Surface *surface, const std::string &filename) delete [] row_pointers; - png_destroy_write_struct(&png_ptr, (png_infopp)NULL); + png_destroy_write_struct(&png_ptr, static_cast(NULL)); if (SDL_MUSTLOCK(surface)) SDL_UnlockSurface(surface); -- cgit v1.2.3-60-g2f50