From 0740a98dde93dcb39f6d74288c4c64b2eb036df1 Mon Sep 17 00:00:00 2001 From: cristy Date: Thu, 13 Oct 2011 15:01:01 +0000 Subject: [PATCH] --- MagickCore/blob-private.h | 2 ++ MagickCore/image.c | 11 ++++++----- MagickCore/image.h | 4 ++-- MagickCore/magick.c | 4 +--- MagickCore/nt-base-private.h | 1 + MagickCore/nt-base.c | 12 ++++++++++-- MagickCore/nt-base.h | 2 +- MagickCore/shear.c | 1 + MagickCore/timer.c | 1 + MagickCore/type.c | 4 +--- MagickCore/utility-private.h | 31 +++++++++++++++++-------------- MagickCore/utility.c | 1 + MagickCore/xwindow.c | 1 + MagickWand/animate.c | 1 + MagickWand/composite.c | 1 + MagickWand/conjure.c | 1 + MagickWand/convert.c | 1 + MagickWand/display.c | 1 + MagickWand/identify.c | 1 + MagickWand/import.c | 1 + MagickWand/magick-image.c | 9 +++------ MagickWand/mogrify.c | 3 ++- MagickWand/stream.c | 1 + 23 files changed, 58 insertions(+), 37 deletions(-) diff --git a/MagickCore/blob-private.h b/MagickCore/blob-private.h index ba3bba662..13cc36645 100644 --- a/MagickCore/blob-private.h +++ b/MagickCore/blob-private.h @@ -22,6 +22,8 @@ extern "C" { #endif +#include "MagickCore/nt-base-private.h" + #define MagickMinBlobExtent 32767L #if defined(MAGICKCORE_HAVE_FSEEKO) # define fseek fseeko diff --git a/MagickCore/image.c b/MagickCore/image.c index 371d28a43..3d1e5498d 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -2055,7 +2055,8 @@ MagickExport MagickBooleanType ModifyImage(Image **image, % The format of the NewMagickImage method is: % % Image *NewMagickImage(const ImageInfo *image_info, -% const size_t width,const size_t height,const PixelInfo *background) +% const size_t width,const size_t height,const PixelInfo *background, +% ExceptionInfo *exception) % % A description of each parameter follows: % @@ -2067,16 +2068,16 @@ MagickExport MagickBooleanType ModifyImage(Image **image, % % o background: the image color. % +% o exception: return any errors or warnings in this structure. +% */ MagickExport Image *NewMagickImage(const ImageInfo *image_info, - const size_t width,const size_t height,const PixelInfo *background) + const size_t width,const size_t height,const PixelInfo *background, + ExceptionInfo *exception) { CacheView *image_view; - ExceptionInfo - *exception; - Image *image; diff --git a/MagickCore/image.h b/MagickCore/image.h index 288e84467..de79c1eaa 100644 --- a/MagickCore/image.h +++ b/MagickCore/image.h @@ -505,8 +505,8 @@ extern MagickExport Image *DestroyImage(Image *), *GetImageClipMask(const Image *,ExceptionInfo *), *GetImageMask(const Image *,ExceptionInfo *), - *NewMagickImage(const ImageInfo *,const size_t,const size_t, - const PixelInfo *), + *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *, + ExceptionInfo *), *ReferenceImage(Image *), *SeparateImages(const Image *,ExceptionInfo *), *SmushImages(const Image *,const MagickBooleanType,const ssize_t, diff --git a/MagickCore/magick.c b/MagickCore/magick.c index daca3b85d..555b0436d 100644 --- a/MagickCore/magick.c +++ b/MagickCore/magick.c @@ -64,9 +64,7 @@ #include "MagickCore/mime-private.h" #include "MagickCore/module.h" #include "MagickCore/module-private.h" -#if defined(MAGICKCORE_WINDOWS_SUPPORT) -# include "MagickCore/nt-feature.h" -#endif +#include "MagickCore/nt-base-private.h" #include "MagickCore/random-private.h" #include "MagickCore/registry.h" #include "MagickCore/registry-private.h" diff --git a/MagickCore/nt-base-private.h b/MagickCore/nt-base-private.h index fef1dbe8c..c10818a4d 100644 --- a/MagickCore/nt-base-private.h +++ b/MagickCore/nt-base-private.h @@ -27,6 +27,7 @@ extern "C" { #include "MagickCore/delegate.h" #include "MagickCore/delegate-private.h" #include "MagickCore/exception.h" +#include "MagickCore/splay-tree.h" #define WIN32_LEAN_AND_MEAN #define VC_EXTRALEAN diff --git a/MagickCore/nt-base.c b/MagickCore/nt-base.c index a4c1da97b..135571449 100644 --- a/MagickCore/nt-base.c +++ b/MagickCore/nt-base.c @@ -41,15 +41,25 @@ #include "MagickCore/studio.h" #if defined(MAGICKCORE_WINDOWS_SUPPORT) #include "MagickCore/client.h" +#include "MagickCore/cache.h" +#include "MagickCore/color.h" +#include "MagickCore/colorspace.h" +#include "MagickCore/colorspace-private.h" #include "MagickCore/exception-private.h" +#include "MagickCore/image.h" #include "MagickCore/locale_.h" #include "MagickCore/log.h" #include "MagickCore/magick.h" #include "MagickCore/memory_.h" +#include "MagickCore/monitor.h" +#include "MagickCore/monitor-private.h" +#include "MagickCore/pixel-accessor.h" #include "MagickCore/resource_.h" #include "MagickCore/resource-private.h" #include "MagickCore/timer.h" +#include "MagickCore/type.h" #include "MagickCore/string_.h" +#include "MagickCore/token.h" #include "MagickCore/utility.h" #include "MagickCore/version.h" #if defined(MAGICKCORE_LTDL_DELEGATE) @@ -585,8 +595,6 @@ MagickExport void *ImageToHBITMAP(Image *image) return((void *) bitmapH); } -#endif - /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % diff --git a/MagickCore/nt-base.h b/MagickCore/nt-base.h index f0e33a603..c943ed571 100644 --- a/MagickCore/nt-base.h +++ b/MagickCore/nt-base.h @@ -22,7 +22,7 @@ extern "C" { #endif -#include "MagickCore/splay-tree.h" +#include "MagickCore/geometry.h" #if defined(MAGICKCORE_WINDOWS_SUPPORT) extern MagickExport void diff --git a/MagickCore/shear.c b/MagickCore/shear.c index 0aa4268dd..61eb9aea4 100644 --- a/MagickCore/shear.c +++ b/MagickCore/shear.c @@ -67,6 +67,7 @@ #include "MagickCore/list.h" #include "MagickCore/monitor.h" #include "MagickCore/monitor-private.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/pixel-accessor.h" #include "MagickCore/quantum.h" #include "MagickCore/resource_.h" diff --git a/MagickCore/timer.c b/MagickCore/timer.c index c42f23b12..56ee58c69 100644 --- a/MagickCore/timer.c +++ b/MagickCore/timer.c @@ -45,6 +45,7 @@ #include "MagickCore/exception-private.h" #include "MagickCore/log.h" #include "MagickCore/memory_.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/timer.h" /* diff --git a/MagickCore/type.c b/MagickCore/type.c index 3e1cdcf20..8a68ce887 100644 --- a/MagickCore/type.c +++ b/MagickCore/type.c @@ -49,6 +49,7 @@ #include "MagickCore/hashmap.h" #include "MagickCore/log.h" #include "MagickCore/memory_.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/option.h" #include "MagickCore/semaphore.h" #include "MagickCore/splay-tree.h" @@ -92,9 +93,6 @@ #define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK #endif #endif -#if defined(MAGICKCORE_WINDOWS_SUPPORT) -# include "MagickCore/nt-feature.h" -#endif /* Define declarations. diff --git a/MagickCore/utility-private.h b/MagickCore/utility-private.h index c90186c8a..df925ed67 100644 --- a/MagickCore/utility-private.h +++ b/MagickCore/utility-private.h @@ -22,6 +22,9 @@ extern "C" { #endif +#include "MagickCore/memory_.h" +#include "MagickCore/nt-base-private.h" + extern MagickPrivate char **GetPathComponents(const char *,size_t *), **ListFiles(const char *,const char *,size_t *); @@ -60,7 +63,7 @@ static inline int access_utf8(const char *path,int mode) return(-1); count=MultiByteToWideChar(CP_UTF8,0,path,-1,path_wide,count); status=_waccess(path_wide,mode); - path_wide=RelinquishMagickMemory(path_wide); + path_wide=(WCHAR *) RelinquishMagickMemory(path_wide); return(status); #endif } @@ -90,13 +93,13 @@ static inline FILE *fopen_utf8(const char *path,const char *mode) mode_wide=(WCHAR *) AcquireQuantumMemory(count,sizeof(*mode_wide)); if (mode_wide == (WCHAR *) NULL) { - path_wide=RelinquishMagickMemory(path_wide); + path_wide=(WCHAR *) RelinquishMagickMemory(path_wide); return((FILE *) NULL); } count=MultiByteToWideChar(CP_UTF8,0,mode,-1,mode_wide,count); file=_wfopen(path_wide,mode_wide); - mode_wide=RelinquishMagickMemory(mode_wide); - path_wide=RelinquishMagickMemory(path_wide); + mode_wide=(WCHAR *) RelinquishMagickMemory(mode_wide); + path_wide=(WCHAR *) RelinquishMagickMemory(path_wide); return(file); #endif } @@ -120,7 +123,7 @@ static inline int open_utf8(const char *path,int flags,int mode) return(-1); count=MultiByteToWideChar(CP_UTF8,0,path,-1,path_wide,count); status=_wopen(path_wide,flags,mode); - path_wide=RelinquishMagickMemory(path_wide); + path_wide=(WCHAR *) RelinquishMagickMemory(path_wide); return(status); #endif } @@ -150,13 +153,13 @@ static inline FILE *popen_utf8(const char *command,const char *type) type_wide=(WCHAR *) AcquireQuantumMemory(count,sizeof(*type_wide)); if (type_wide == (WCHAR *) NULL) { - command_wide=RelinquishMagickMemory(command_wide); + command_wide=(WCHAR *) RelinquishMagickMemory(command_wide); return((FILE *) NULL); } count=MultiByteToWideChar(CP_UTF8,0,type,-1,type_wide,count); file=_wpopen(command_wide,type_wide); - type_wide=RelinquishMagickMemory(type_wide); - command_wide=RelinquishMagickMemory(command_wide); + type_wide=(WCHAR *) RelinquishMagickMemory(type_wide); + command_wide=(WCHAR *) RelinquishMagickMemory(command_wide); return(file); #endif } @@ -180,7 +183,7 @@ static inline int remove_utf8(const char *path) return(-1); count=MultiByteToWideChar(CP_UTF8,0,path,-1,path_wide,count); status=_wremove(path_wide); - path_wide=RelinquishMagickMemory(path_wide); + path_wide=(WCHAR *) RelinquishMagickMemory(path_wide); return(status); #endif } @@ -209,13 +212,13 @@ static inline int rename_utf8(const char *source,const char *destination) sizeof(*destination_wide)); if (destination_wide == (WCHAR *) NULL) { - source_wide=RelinquishMagickMemory(source_wide); + source_wide=(WCHAR *) RelinquishMagickMemory(source_wide); return(-1); } count=MultiByteToWideChar(CP_UTF8,0,destination,-1,destination_wide,count); status=_wrename(source_wide,destination_wide); - destination_wide=RelinquishMagickMemory(destination_wide); - source_wide=RelinquishMagickMemory(source_wide); + destination_wide=(WCHAR *) RelinquishMagickMemory(destination_wide); + source_wide=(WCHAR *) RelinquishMagickMemory(source_wide); return(status); #endif } @@ -238,8 +241,8 @@ static inline int stat_utf8(const char *path,struct stat *attributes) if (path_wide == (WCHAR *) NULL) return(-1); count=MultiByteToWideChar(CP_UTF8,0,path,-1,path_wide,count); - status=wstat(path_wide,attributes); - path_wide=RelinquishMagickMemory(path_wide); + status=_wstat64(path_wide,attributes); + path_wide=(WCHAR *) RelinquishMagickMemory(path_wide); return(status); #endif } diff --git a/MagickCore/utility.c b/MagickCore/utility.c index 7183bd703..0cfd9b26b 100644 --- a/MagickCore/utility.c +++ b/MagickCore/utility.c @@ -50,6 +50,7 @@ #include "MagickCore/log.h" #include "MagickCore/magick-private.h" #include "MagickCore/memory_.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/option.h" #include "MagickCore/policy.h" #include "MagickCore/resource_.h" diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c index 0654b6585..435496f4e 100644 --- a/MagickCore/xwindow.c +++ b/MagickCore/xwindow.c @@ -62,6 +62,7 @@ #include "MagickCore/magick.h" #include "MagickCore/memory_.h" #include "MagickCore/monitor.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/option.h" #include "MagickCore/pixel-accessor.h" #include "MagickCore/PreRvIcccm.h" diff --git a/MagickWand/animate.c b/MagickWand/animate.c index 2c8c0aee8..0b09f453a 100644 --- a/MagickWand/animate.c +++ b/MagickWand/animate.c @@ -44,6 +44,7 @@ #include "MagickWand/MagickWand.h" #include "MagickWand/mogrify-private.h" #include "MagickCore/animate-private.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/string-private.h" #include "MagickCore/xwindow-private.h" diff --git a/MagickWand/composite.c b/MagickWand/composite.c index d7f08f048..2ddadc182 100644 --- a/MagickWand/composite.c +++ b/MagickWand/composite.c @@ -43,6 +43,7 @@ #include "MagickWand/studio.h" #include "MagickWand/MagickWand.h" #include "MagickWand/mogrify-private.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/string-private.h" /* diff --git a/MagickWand/conjure.c b/MagickWand/conjure.c index ade013729..f75c84cae 100644 --- a/MagickWand/conjure.c +++ b/MagickWand/conjure.c @@ -48,6 +48,7 @@ #include "MagickWand/studio.h" #include "MagickWand/MagickWand.h" #include "MagickWand/mogrify-private.h" +#include "MagickCore/nt-base-private.h" /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/MagickWand/convert.c b/MagickWand/convert.c index 44655487b..2c2d5ec65 100644 --- a/MagickWand/convert.c +++ b/MagickWand/convert.c @@ -45,6 +45,7 @@ #include "MagickWand/studio.h" #include "MagickWand/MagickWand.h" #include "MagickWand/mogrify-private.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/string-private.h" #include "MagickCore/utility-private.h" /* diff --git a/MagickWand/display.c b/MagickWand/display.c index dd164ed98..1c8f6a41f 100644 --- a/MagickWand/display.c +++ b/MagickWand/display.c @@ -45,6 +45,7 @@ #include "MagickWand/MagickWand.h" #include "MagickWand/mogrify-private.h" #include "MagickCore/display-private.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/string-private.h" #include "MagickCore/xwindow-private.h" diff --git a/MagickWand/identify.c b/MagickWand/identify.c index df1c07172..3313f2927 100644 --- a/MagickWand/identify.c +++ b/MagickWand/identify.c @@ -50,6 +50,7 @@ #include "MagickWand/studio.h" #include "MagickWand/MagickWand.h" #include "MagickWand/mogrify-private.h" +#include "MagickCore/nt-base-private.h" /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/MagickWand/import.c b/MagickWand/import.c index c87f3a0b3..d2c31db2d 100644 --- a/MagickWand/import.c +++ b/MagickWand/import.c @@ -44,6 +44,7 @@ #include "MagickWand/studio.h" #include "MagickWand/MagickWand.h" #include "MagickWand/mogrify-private.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/string-private.h" #include "MagickCore/xwindow-private.h" diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index e261aaafd..9392f4cac 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -6732,9 +6732,8 @@ WandExport MagickBooleanType MagickNegateImage(MagickWand *wand, % o background: the image color. % */ -WandExport MagickBooleanType MagickNewImage(MagickWand *wand, - const size_t width,const size_t height, - const PixelWand *background) +WandExport MagickBooleanType MagickNewImage(MagickWand *wand,const size_t width, + const size_t height,const PixelWand *background) { Image *images; @@ -6747,11 +6746,9 @@ WandExport MagickBooleanType MagickNewImage(MagickWand *wand, if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); PixelGetMagickColor(background,&pixel); - images=NewMagickImage(wand->image_info,width,height,&pixel); + images=NewMagickImage(wand->image_info,width,height,&pixel,&wand->exception); if (images == (Image *) NULL) return(MagickFalse); - if (images->exception.severity != UndefinedException) - InheritException(wand->exception,&images->exception); return(InsertImageInWand(wand,images)); } diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index a4d1e2f13..8da0dabcf 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -51,8 +51,9 @@ #undef RadiansToDegrees #include "MagickCore/image-private.h" #include "MagickCore/monitor-private.h" -#include "MagickCore/thread-private.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/string-private.h" +#include "MagickCore/thread-private.h" #include "MagickCore/utility-private.h" /* diff --git a/MagickWand/stream.c b/MagickWand/stream.c index ac14535e3..9ccf43361 100644 --- a/MagickWand/stream.c +++ b/MagickWand/stream.c @@ -47,6 +47,7 @@ #include "MagickWand/studio.h" #include "MagickWand/MagickWand.h" #include "MagickWand/mogrify-private.h" +#include "MagickCore/nt-base-private.h" #include "MagickCore/stream-private.h" /* -- 2.40.0