ext/RMagick/rmutil.c in rmagick-2.13.3 vs ext/RMagick/rmutil.c in rmagick-2.13.4

- old
+ new

@@ -625,17 +625,17 @@ */ VALUE rm_pixelpacket_to_color_name(Image *image, PixelPacket *color) { char name[MaxTextExtent]; - ExceptionInfo exception; + ExceptionInfo *exception; - GetExceptionInfo(&exception); + exception = AcquireExceptionInfo(); - (void) QueryColorname(image, color, X11Compliance, name, &exception); + (void) QueryColorname(image, color, X11Compliance, name, exception); CHECK_EXCEPTION() - (void) DestroyExceptionInfo(&exception); + (void) DestroyExceptionInfo(exception); return rb_str_new2(name); } @@ -696,15 +696,15 @@ { #define TMPNAM_CLASS_VAR "@@_tmpnam_" MagickBooleanType okay; - ExceptionInfo exception; + ExceptionInfo *exception; volatile VALUE id_value; int id; - GetExceptionInfo(&exception); + exception = AcquireExceptionInfo(); // 'id' is always the value of its previous use if (rb_cvar_defined(Module_Magick, rb_intern(TMPNAM_CLASS_VAR)) == Qtrue) { @@ -720,13 +720,13 @@ id += 1; rb_cv_set(Module_Magick, TMPNAM_CLASS_VAR, INT2FIX(id)); sprintf(temp_name, "mpri:%d", id); // Omit "mpri:" from filename to form the key - okay = SetImageRegistry(ImageRegistryType, temp_name+5, image, &exception); + okay = SetImageRegistry(ImageRegistryType, temp_name+5, image, exception); CHECK_EXCEPTION() - DestroyExceptionInfo(&exception); + DestroyExceptionInfo(exception); if (!okay) { rb_raise(rb_eRuntimeError, "SetImageRegistry failed."); } @@ -1387,20 +1387,20 @@ */ Image * rm_clone_image(Image *image) { Image *clone; - ExceptionInfo exception; + ExceptionInfo *exception; - GetExceptionInfo(&exception); - clone = CloneImage(image, 0, 0, MagickTrue, &exception); + exception = AcquireExceptionInfo(); + clone = CloneImage(image, 0, 0, MagickTrue, exception); if (!clone) { rb_raise(rb_eNoMemError, "not enough memory to continue"); } - rm_check_exception(&exception, clone, DestroyOnError); - (void) DestroyExceptionInfo(&exception); + rm_check_exception(exception, clone, DestroyOnError); + (void) DestroyExceptionInfo(exception); return clone; } @@ -1484,43 +1484,43 @@ * or DestroyOnError) */ void rm_check_image_exception(Image *imglist, ErrorRetention retention) { - ExceptionInfo exception; + ExceptionInfo *exception; Image *badboy = NULL; Image *image; if (imglist == NULL) { return; } - GetExceptionInfo(&exception); + exception = AcquireExceptionInfo(); // Find the image with the highest severity image = GetFirstImageInList(imglist); while (image) { if (image->exception.severity != UndefinedException) { if (!badboy || image->exception.severity > badboy->exception.severity) { badboy = image; - InheritException(&exception, &badboy->exception); + InheritException(exception, &badboy->exception); } ClearMagickException(&image->exception); } image = GetNextImageInList(image); } if (badboy) { - rm_check_exception(&exception, imglist, retention); + rm_check_exception(exception, imglist, retention); } - (void) DestroyExceptionInfo(&exception); + (void) DestroyExceptionInfo(exception); } /** * Call handle_exception if there is an exception to handle.