On Sat, 15 Dec 2012, Alexandre Julliard wrote:
Current snapshots of GCC 4.8.0 issue a warning about some of the new code in windowscodecs/pngformat.c:
pngformat.c: In function 'PngDecoder_Frame_GetColorContexts': pngformat.c:882:5: warning: passing argument 5 of 'ppng_get_iCCP' from incompatible pointer type [enabled by default] if (ppng_get_iCCP(This->png_ptr, This->info_ptr, &name, &compression_type,&profile, &len)) pngformat.c:882:5: note: expected 'png_bytepp' but argument is of type 'char **'
The patch below addresses this.
That will break on older libpng.
Do you have an idea on how to work around the warning (on newer libpng)?
The patch below does it for me, but there may be a better one...
Gerald
ChangeLog: Add cast to avoid compiler warning (GCC 4.8) in PngDecoder_Frame_GetColorContexts.
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index 4183d8e..0d238d5 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -879,7 +879,7 @@ static HRESULT WINAPI PngDecoder_Frame_GetColorContexts(IWICBitmapFrameDecode *i
EnterCriticalSection(&This->lock);
- if (ppng_get_iCCP(This->png_ptr, This->info_ptr, &name, &compression_type, &profile, &len)) + if (ppng_get_iCCP(This->png_ptr, This->info_ptr, &name, &compression_type, (BYTE**)&profile, &len)) { if (cCount && ppIColorContexts) {