From 1f0e7315aae1f00f667079604486a30e649f8376 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Thu, 20 Jul 2017 22:11:15 +0200 Subject: [PATCH] Changed status into errorcode and added #else to fix compiler warnings. --- coders/dng.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/coders/dng.c b/coders/dng.c index 79e705c8a..e9f0ef3aa 100644 --- a/coders/dng.c +++ b/coders/dng.c @@ -189,7 +189,7 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) #if defined(MAGICKCORE_RAW_R_DELEGATE) { int - status; + errcode; libraw_data_t *raw_info; @@ -203,40 +203,40 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) unsigned short *p; - status=0; + errcode=0; raw_info=libraw_init(0); if (raw_info == (libraw_data_t *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(),CoderError, - libraw_strerror(status),"`%s'",image->filename); + libraw_strerror(errcode),"`%s'",image->filename); return(DestroyImageList(image)); } - status=libraw_open_file(raw_info,image->filename); - if (status != LIBRAW_SUCCESS) + errcode=libraw_open_file(raw_info,image->filename); + if (errcode != LIBRAW_SUCCESS) { (void) ThrowMagickException(exception,GetMagickModule(),CoderError, - libraw_strerror(status),"`%s'",image->filename); + libraw_strerror(errcode),"`%s'",image->filename); return(DestroyImageList(image)); } - status=libraw_unpack(raw_info); - if (status != LIBRAW_SUCCESS) + errcode=libraw_unpack(raw_info); + if (errcode != LIBRAW_SUCCESS) { libraw_close(raw_info); (void) ThrowMagickException(exception,GetMagickModule(),CoderError, - libraw_strerror(status),"`%s'",image->filename); + libraw_strerror(errcode),"`%s'",image->filename); return(DestroyImageList(image)); } raw_info->params.output_bps=16; - status=libraw_dcraw_process(raw_info); - if (status != LIBRAW_SUCCESS) + errcode=libraw_dcraw_process(raw_info); + if (errcode != LIBRAW_SUCCESS) { libraw_close(raw_info); (void) ThrowMagickException(exception,GetMagickModule(),CoderError, - libraw_strerror(status),"`%s'",image->filename); + libraw_strerror(errcode),"`%s'",image->filename); return(DestroyImageList(image)); } - raw_image=libraw_dcraw_make_mem_image(raw_info,&status); - if ((status != LIBRAW_SUCCESS) || + raw_image=libraw_dcraw_make_mem_image(raw_info,&errcode); + if ((errcode != LIBRAW_SUCCESS) || (raw_image == (libraw_processed_image_t *) NULL) || (raw_image->type != LIBRAW_IMAGE_BITMAP) || (raw_image->bits != 16) || (raw_image->colors < 3) || (raw_image->colors > 4)) @@ -245,7 +245,7 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) libraw_dcraw_clear_mem(raw_image); libraw_close(raw_info); (void) ThrowMagickException(exception,GetMagickModule(),CoderError, - libraw_strerror(status),"`%s'",image->filename); + libraw_strerror(errcode),"`%s'",image->filename); return(DestroyImageList(image)); } image->columns=raw_image->width; @@ -293,7 +293,7 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) libraw_close(raw_info); return(image); } -#endif +#else (void) DestroyImageList(image); /* Convert DNG to PPM with delegate. @@ -384,6 +384,7 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) } read_info=DestroyImageInfo(read_info); return(image); +#endif } /* -- 2.40.0