From 7884ab9018ce2c674fc730bc1eaadaf9b9aa9b18 Mon Sep 17 00:00:00 2001 From: David Surovell Date: Wed, 22 Mar 2006 16:21:55 +0000 Subject: [PATCH] fix wxMac compilation problem by hoisting simple variable declarations above all goto stmts git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/imagpng.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index ab10f4b9e9..1d8a97046d 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -508,13 +508,16 @@ wxPNGHandler::LoadFile(wxImage *image, bool verbose, int WXUNUSED(index)) { - // VZ: as this function uses setjmp() the only fool proof error handling + // VZ: as this function uses setjmp() the only fool-proof error handling // method is to use goto (setjmp is not really C++ dtors friendly...) unsigned char **lines = NULL; png_infop info_ptr = (png_infop) NULL; wxPNGInfoStruct wxinfo; + png_uint_32 i, width, height = 0; + int bit_depth, color_type, interlace_type; + wxinfo.verbose = verbose; wxinfo.stream.in = &stream; @@ -541,9 +544,6 @@ wxPNGHandler::LoadFile(wxImage *image, if (setjmp(wxinfo.jmpbuf)) goto error; - png_uint_32 i, width, height = 0; - int bit_depth, color_type, interlace_type; - png_read_info( png_ptr, info_ptr ); png_get_IHDR( png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, (int*) NULL, (int*) NULL ); -- 2.45.2