X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5568067a3d151caf17d01de9192ca4471decba97..19c453d0aca1b76b201d0acf874b01efc2241b6a:/src/common/imagpng.cpp diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 284f5d7171..8888b59b17 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -116,11 +116,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler) // First, let me describe what's the problem: libpng uses jmp_buf in // its png_struct structure. Unfortunately, this structure is // compiler-specific and may vary in size, so if you use libpng compiled -// as DLL with another compiler than the main executable, it may not work -// (this is for example the case with wxMGL port and SciTech MGL library -// that provides custom runtime-loadable libpng implementation with jmpbuf -// disabled altogether). Luckily, it is still possible to use setjmp() & -// longjmp() as long as the structure is not part of png_struct. +// as DLL with another compiler than the main executable, it may not work. +// Luckily, it is still possible to use setjmp() & longjmp() as long as the +// structure is not part of png_struct. // // Sadly, there's no clean way to attach user-defined data to png_struct. // There is only one customizable place, png_struct.io_ptr, which is meant @@ -162,7 +160,7 @@ static void PNGLINKAGEMODE wx_PNG_stream_writer( png_structp png_ptr, png_bytep } static void -PNGLINKAGEMODE wx_png_warning(png_structp png_ptr, png_const_charp message) +PNGLINKAGEMODE wx_PNG_warning(png_structp png_ptr, png_const_charp message) { wxPNGInfoStruct *info = png_ptr ? WX_PNG_INFO(png_ptr) : NULL; if ( !info || info->verbose ) @@ -174,9 +172,9 @@ PNGLINKAGEMODE wx_png_warning(png_structp png_ptr, png_const_charp message) // from pngerror.c // so that the libpng doesn't send anything on stderr static void -PNGLINKAGEMODE wx_png_error(png_structp png_ptr, png_const_charp message) +PNGLINKAGEMODE wx_PNG_error(png_structp png_ptr, png_const_charp message) { - wx_png_warning(NULL, message); + wx_PNG_warning(NULL, message); // we're not using libpng built-in jump buffer (see comment before // wxPNGInfoStruct above) so we have to return ourselves, otherwise libpng @@ -523,8 +521,8 @@ wxPNGHandler::LoadFile(wxImage *image, ( PNG_LIBPNG_VER_STRING, NULL, - wx_png_error, - wx_png_warning + wx_PNG_error, + wx_PNG_warning ); if (!png_ptr) goto error; @@ -569,7 +567,7 @@ wxPNGHandler::LoadFile(wxImage *image, for (i = 0; i < height; i++) { - if ((lines[i] = (unsigned char *)malloc( (size_t)(width * (sizeof(unsigned char) * 4)))) == NULL) + if ((lines[i] = (unsigned char *)malloc( (size_t)(width * 4))) == NULL) goto error; } @@ -739,8 +737,8 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos ( PNG_LIBPNG_VER_STRING, NULL, - wx_png_error, - wx_png_warning + wx_PNG_error, + wx_PNG_warning ); if (!png_ptr) {