From: Vadim Zeitlin Date: Tue, 19 Jul 2011 22:36:00 +0000 (+0000) Subject: Fix harmless gcc warning about uninitialized mask in PNG saving code. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5568067a3d151caf17d01de9192ca4471decba97?ds=inline Fix harmless gcc warning about uninitialized mask in PNG saving code. The mask was actually only used when it was initialized (or, conversely, the mask was always initialized when it was used) but gcc doesn't seem to notice this and still warns that mask components "may be used uninitialized in this function". Suppress the warnings by always initializing the mask, even if we don't use it. Closes #13333. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 578d0baf6d..284f5d7171 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -795,15 +795,13 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos #endif ; - png_color_8 mask; + png_color_8 mask = { 0, 0, 0, 0, 0 }; if (bHasMask) { mask.red = image->GetMaskRed(); mask.green = image->GetMaskGreen(); mask.blue = image->GetMaskBlue(); - mask.alpha = 0; - mask.gray = 0; } PaletteMap palette;