From fdec0e788d408d1620b1c966152484890c80b6b6 Mon Sep 17 00:00:00 2001 From: dirk Date: Fri, 9 May 2014 18:45:41 +0000 Subject: [PATCH] Fixed compiler warnings. --- coders/pdf.c | 16 +++++++++------- coders/ps.c | 16 +++++++++------- coders/vips.c | 20 ++++++++++++++++---- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/coders/pdf.c b/coders/pdf.c index cdce09d34..54033d3e1 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -125,6 +125,7 @@ static MagickBooleanType % o exception: return any errors or warnings in this structure. % */ +#if defined(MAGICKCORE_GS_DELEGATE) || defined(MAGICKCORE_WINDOWS_SUPPORT) static int MagickDLLCall PDFDelegateMessage(void *handle,const char *msg, int len) { @@ -147,10 +148,15 @@ static int MagickDLLCall PDFDelegateMessage(void *handle,const char *msg, (*messages)[offset+len] ='\0'; return(len); } +#endif static MagickBooleanType InvokePDFDelegate(const MagickBooleanType verbose, const char *command,ExceptionInfo *exception) { + int + status; + +#if defined(MAGICKCORE_GS_DELEGATE) || defined(MAGICKCORE_WINDOWS_SUPPORT) #define SetArgsStart \ if (args_start == (const char *) NULL) \ { \ @@ -176,17 +182,13 @@ static MagickBooleanType InvokePDFDelegate(const MagickBooleanType verbose, return(MagickFalse); \ } - const char - *args_start=NULL; - - int - status; - -#if defined(MAGICKCORE_GS_DELEGATE) || defined(MAGICKCORE_WINDOWS_SUPPORT) char **argv, *errors; + const char + *args_start=NULL; + const GhostInfo *ghost_info; diff --git a/coders/ps.c b/coders/ps.c index 7b2cf0f92..9da0bd69f 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -114,6 +114,7 @@ static MagickBooleanType % o exception: return any errors or warnings in this structure. % */ +#if defined(MAGICKCORE_GS_DELEGATE) || defined(MAGICKCORE_WINDOWS_SUPPORT) static int MagickDLLCall PostscriptDelegateMessage(void *handle, const char *msg,int len) { @@ -136,10 +137,15 @@ static int MagickDLLCall PostscriptDelegateMessage(void *handle, (*messages)[offset+len] ='\0'; return(len); } +#endif static MagickBooleanType InvokePostscriptDelegate( const MagickBooleanType verbose,const char *command,ExceptionInfo *exception) { + int + status; + +#if defined(MAGICKCORE_GS_DELEGATE) || defined(MAGICKCORE_WINDOWS_SUPPORT) #define SetArgsStart \ if (args_start == (const char *) NULL) \ { \ @@ -165,17 +171,13 @@ static MagickBooleanType InvokePostscriptDelegate( return(MagickFalse); \ } - const char - *args_start=NULL; - - int - status; - -#if defined(MAGICKCORE_GS_DELEGATE) || defined(MAGICKCORE_WINDOWS_SUPPORT) char **argv, *errors; + const char + *args_start=NULL; + const GhostInfo *ghost_info; diff --git a/coders/vips.c b/coders/vips.c index 03d636522..1fc21c9fc 100644 --- a/coders/vips.c +++ b/coders/vips.c @@ -203,9 +203,12 @@ static inline MagickBooleanType IsSupportedCombination( case VIPSBandFormatFLOAT: case VIPSBandFormatDOUBLE: return(MagickTrue); + default: + return(MagickFalse); } + default: + return(MagickFalse); } - return(MagickFalse); } static inline Quantum ReadVIPSPixelNONE(Image *image, @@ -217,7 +220,7 @@ static inline Quantum ReadVIPSPixelNONE(Image *image, case VIPSTypeRGB: { unsigned char - c=0; + c; switch(format) { @@ -239,6 +242,9 @@ static inline Quantum ReadVIPSPixelNONE(Image *image, case VIPSBandFormatDOUBLE: c=(unsigned char) ReadBlobDouble(image); break; + default: + c=0; + break; } return(ScaleCharToQuantum(c)); } @@ -246,7 +252,7 @@ static inline Quantum ReadVIPSPixelNONE(Image *image, case VIPSTypeRGB16: { unsigned short - s=0; + s; switch(format) { @@ -264,6 +270,9 @@ static inline Quantum ReadVIPSPixelNONE(Image *image, case VIPSBandFormatDOUBLE: s=(unsigned short) ReadBlobDouble(image); break; + default: + s=0; + break; } return(ScaleShortToQuantum(s)); } @@ -285,9 +294,12 @@ static inline Quantum ReadVIPSPixelNONE(Image *image, case VIPSBandFormatDOUBLE: return((Quantum) ((double) QuantumRange*(ReadBlobDouble( image)/1.0))); + default: + return((Quantum) 0); } + default: + return((Quantum) 0); } - return((Quantum) 0); } static MagickBooleanType ReadVIPSPixelsNONE(Image *image, -- 2.40.0