From 9f6f6bd8ee3718af4c04861aab669c7326afcb4d Mon Sep 17 00:00:00 2001 From: "cbiesinger%web.de" Date: Thu, 21 Feb 2002 14:08:25 +0000 Subject: [PATCH] bug 124117 r=pavlov sr=tor a=shaver Fix build warnings in the GIF Decoder --- modules/libpr0n/decoders/gif/GIF2.cpp | 8 ++-- .../libpr0n/decoders/gif/nsGIFDecoder2.cpp | 47 ++++++++++++++++++- modules/libpr0n/decoders/gif/nsGIFDecoder2.h | 43 ----------------- 3 files changed, 50 insertions(+), 48 deletions(-) diff --git a/modules/libpr0n/decoders/gif/GIF2.cpp b/modules/libpr0n/decoders/gif/GIF2.cpp index 8872bca0cca3..359bc4c09dff 100644 --- a/modules/libpr0n/decoders/gif/GIF2.cpp +++ b/modules/libpr0n/decoders/gif/GIF2.cpp @@ -219,7 +219,7 @@ output_row(gif_struct *gs) if (width > 0) if (gs->GIFCallback_HaveDecodedRow) { /* Decoded data available callback */ - int result = (gs->GIFCallback_HaveDecodedRow)( + (gs->GIFCallback_HaveDecodedRow)( gs->clientptr, gs->rowbuf, /* Pointer to single scanline temporary buffer */ gs->x_offset, /* x offset with respect to GIF logical screen origin */ @@ -1420,7 +1420,7 @@ PRStatus gif_write(gif_struct *gs, const PRUint8 *buf, PRUint32 len) case gif_done: if (gs->GIFCallback_EndGIF) { - int result = (gs->GIFCallback_EndGIF)(gs->clientptr, gs->loop_count); + (gs->GIFCallback_EndGIF)(gs->clientptr, gs->loop_count); } return PR_SUCCESS; break; @@ -1493,7 +1493,7 @@ PRStatus gif_write(gif_struct *gs, const PRUint8 *buf, PRUint32 len) // Handle general errors case gif_error: if (gs->GIFCallback_EndGIF) { - int result = (gs->GIFCallback_EndGIF)(gs->clientptr, gs->loop_count); + (gs->GIFCallback_EndGIF)(gs->clientptr, gs->loop_count); } return PR_FAILURE; break; @@ -1522,7 +1522,7 @@ gif_destroy(gif_struct *gs) /* Clear any pending timeouts */ if (gs->delay_time) { //ic->imgdcb->ImgDCBClearTimeout(gs->delay_timeout); - gs->delay_time = NULL; + gs->delay_time = 0; } gif_destroy_transparency(gs); diff --git a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp index ab8b6b9ece69..4147ef04bed4 100644 --- a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp +++ b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp @@ -33,6 +33,52 @@ #include "nsRect.h" +////////////////////////////////////////////////////////////////////// +// Declaration of the static callbacks + +static int PR_CALLBACK BeginGIF( + void* aClientData, + PRUint32 aLogicalScreenWidth, + PRUint32 aLogicalScreenHeight, + PRUint8 aBackgroundRGBIndex); + +static int PR_CALLBACK HaveDecodedRow( + void* aClientData, + PRUint8* aRowBufPtr, // Pointer to single scanline temporary buffer + int aXOffset, // With respect to GIF logical screen origin + int aLength, // Length of the row? + int aRow, // Row number? + int aDuplicateCount, // Number of times to duplicate the row? + PRUint8 aDrawMode, // il_draw_mode + int aInterlacePass); + +static int PR_CALLBACK NewPixmap(); + +static int PR_CALLBACK EndGIF( + void* aClientData, + int aAnimationLoopCount); + +static int PR_CALLBACK BeginImageFrame( + void* aClientData, + PRUint32 aFrameNumber, /* Frame number, 1-n */ + PRUint32 aFrameXOffset, /* X offset in logical screen */ + PRUint32 aFrameYOffset, /* Y offset in logical screen */ + PRUint32 aFrameWidth, + PRUint32 aFrameHeight, + GIF_RGB* aTransparencyChromaKey); +static int PR_CALLBACK EndImageFrame( + void* aClientData, + PRUint32 aFrameNumber, + PRUint32 aDelayTimeout, + PRUint32 aDisposal); +static int PR_CALLBACK SetupColorspaceConverter(); +static int PR_CALLBACK ResetPalette(); +static int PR_CALLBACK InitTransparentPixel(); +static int PR_CALLBACK DestroyTransparentPixel(); + +static int PR_CALLBACK HaveImageAll( + void* aClientData); + ////////////////////////////////////////////////////////////////////// // GIF Decoder Implementation // This is an adaptor between GIF2 and imgIDecoder @@ -397,7 +443,6 @@ int HaveDecodedRow( nscoord width; decoder->mImageFrame->GetWidth(&width); - PRUint32 iwidth = width; gfx_format format; decoder->mImageFrame->GetFormat(&format); diff --git a/modules/libpr0n/decoders/gif/nsGIFDecoder2.h b/modules/libpr0n/decoders/gif/nsGIFDecoder2.h index d2cdd9d41a90..ad7a8e2efdff 100644 --- a/modules/libpr0n/decoders/gif/nsGIFDecoder2.h +++ b/modules/libpr0n/decoders/gif/nsGIFDecoder2.h @@ -71,47 +71,4 @@ public: PRUint8 mLastFlushedPass; }; -// static callbacks for the GIF decoder -static int PR_CALLBACK BeginGIF( - void* aClientData, - PRUint32 aLogicalScreenWidth, - PRUint32 aLogicalScreenHeight, - PRUint8 aBackgroundRGBIndex); - -static int PR_CALLBACK HaveDecodedRow( - void* aClientData, - PRUint8* aRowBufPtr, // Pointer to single scanline temporary buffer - int aXOffset, // With respect to GIF logical screen origin - int aLength, // Length of the row? - int aRow, // Row number? - int aDuplicateCount, // Number of times to duplicate the row? - PRUint8 aDrawMode, // il_draw_mode - int aInterlacePass); - -static int PR_CALLBACK NewPixmap(); - -static int PR_CALLBACK EndGIF( - void* aClientData, - int aAnimationLoopCount); - -static int PR_CALLBACK BeginImageFrame( - void* aClientData, - PRUint32 aFrameNumber, /* Frame number, 1-n */ - PRUint32 aFrameXOffset, /* X offset in logical screen */ - PRUint32 aFrameYOffset, /* Y offset in logical screen */ - PRUint32 aFrameWidth, - PRUint32 aFrameHeight, - GIF_RGB* aTransparencyChromaKey); -static int PR_CALLBACK EndImageFrame( - void* aClientData, - PRUint32 aFrameNumber, - PRUint32 aDelayTimeout, - PRUint32 aDisposal); -static int PR_CALLBACK SetupColorspaceConverter(); -static int PR_CALLBACK ResetPalette(); -static int PR_CALLBACK InitTransparentPixel(); -static int PR_CALLBACK DestroyTransparentPixel(); - -static int PR_CALLBACK HaveImageAll( - void* aClientData); #endif