rmagick 1.14.1 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rmagick might be problematic. Click here for more details.
- data/ChangeLog +22 -0
- data/README.html +11 -63
- data/README.txt +8 -56
- data/configure +214 -787
- data/configure.ac +22 -24
- data/doc/comtasks.html +2 -2
- data/doc/constants.html +5 -6
- data/doc/draw.html +33 -14
- data/doc/ex/clip_path.rb +3 -0
- data/doc/ex/path.rb +1 -1
- data/doc/ex/polaroid.rb +23 -0
- data/doc/ex/tspan01.rb +2 -2
- data/doc/ex/tspan02.rb +2 -2
- data/doc/ex/tspan03.rb +3 -3
- data/doc/ex/wet_floor.rb +54 -0
- data/doc/ilist.html +83 -4
- data/doc/image1.html +4 -5
- data/doc/image2.html +395 -266
- data/doc/image3.html +104 -8
- data/doc/imageattrs.html +2 -2
- data/doc/imusage.html +2 -2
- data/doc/index.html +22 -18
- data/doc/info.html +28 -6
- data/doc/magick.html +125 -4
- data/doc/optequiv.html +196 -21
- data/doc/rvg.html +2 -2
- data/doc/rvgclip.html +2 -2
- data/doc/rvggroup.html +2 -2
- data/doc/rvgimage.html +2 -2
- data/doc/rvgpattern.html +2 -2
- data/doc/rvgshape.html +2 -2
- data/doc/rvgstyle.html +2 -2
- data/doc/rvgtext.html +2 -2
- data/doc/rvgtspan.html +2 -2
- data/doc/rvgtut.html +3 -3
- data/doc/rvguse.html +2 -2
- data/doc/rvgxform.html +2 -2
- data/doc/struct.html +2 -2
- data/doc/usage.html +26 -5
- data/ext/RMagick/MANIFEST +3 -1
- data/ext/RMagick/rmagick.h +46 -12
- data/ext/RMagick/rmagick_config.h.in +12 -2
- data/ext/RMagick/rmdraw.c +202 -62
- data/ext/RMagick/rmfill.c +36 -36
- data/ext/RMagick/rmilist.c +75 -31
- data/ext/RMagick/rmimage.c +640 -323
- data/ext/RMagick/rminfo.c +76 -15
- data/ext/RMagick/rmmain.c +107 -30
- data/ext/RMagick/rmutil.c +97 -68
- data/lib/RMagick.rb +11 -11
- data/lib/rvg/clippath.rb +38 -36
- data/lib/rvg/container.rb +120 -118
- data/lib/rvg/deep_equal.rb +44 -42
- data/lib/rvg/describable.rb +49 -47
- data/lib/rvg/embellishable.rb +399 -397
- data/lib/rvg/misc.rb +613 -603
- data/lib/rvg/paint.rb +38 -36
- data/lib/rvg/pathdata.rb +124 -122
- data/lib/rvg/rvg.rb +202 -198
- data/lib/rvg/stretchable.rb +132 -130
- data/lib/rvg/stylable.rb +101 -99
- data/lib/rvg/text.rb +173 -171
- data/lib/rvg/transformable.rb +120 -118
- data/lib/rvg/units.rb +60 -58
- data/rmagick.gemspec +1 -1
- metadata +5 -3
data/ext/RMagick/rmutil.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
/* $Id: rmutil.c,v 1.
|
1
|
+
/* $Id: rmutil.c,v 1.90 2007/01/15 23:32:31 rmagick Exp $ */
|
2
2
|
/*============================================================================\
|
3
|
-
| Copyright (C)
|
3
|
+
| Copyright (C) 2007 by Timothy P. Hunter
|
4
4
|
| Name: rmutil.c
|
5
5
|
| Author: Tim Hunter
|
6
6
|
| Purpose: Utility functions for RMagick
|
@@ -20,6 +20,47 @@ static void handle_exception(ExceptionInfo *, Image *, ErrorRetention);
|
|
20
20
|
static VALUE Pixel_from_MagickPixelPacket(MagickPixelPacket *);
|
21
21
|
#endif
|
22
22
|
|
23
|
+
#if !defined(HAVE_ACQUIREMAGICKMEMORY)
|
24
|
+
/*
|
25
|
+
Dummy versions of ImageMagick memory routines for use with GraphicsMagick.
|
26
|
+
*/
|
27
|
+
static void *AcquireMagickMemory(const size_t size)
|
28
|
+
{
|
29
|
+
assert(size > 0);
|
30
|
+
return malloc(size);
|
31
|
+
}
|
32
|
+
|
33
|
+
static void *RelinquishMagickMemory(void *memory)
|
34
|
+
{
|
35
|
+
if (memory)
|
36
|
+
{
|
37
|
+
free(memory);
|
38
|
+
}
|
39
|
+
return NULL;
|
40
|
+
}
|
41
|
+
|
42
|
+
static void *ResizeMagickMemory(void *memory, const size_t size)
|
43
|
+
{
|
44
|
+
void *new;
|
45
|
+
|
46
|
+
if (!memory)
|
47
|
+
{
|
48
|
+
return malloc(size);
|
49
|
+
}
|
50
|
+
if (size == 0)
|
51
|
+
{
|
52
|
+
free(memory);
|
53
|
+
return NULL;
|
54
|
+
}
|
55
|
+
new = realloc(memory, size);
|
56
|
+
if (!new)
|
57
|
+
{
|
58
|
+
free(memory);
|
59
|
+
}
|
60
|
+
return new;
|
61
|
+
}
|
62
|
+
#endif
|
63
|
+
|
23
64
|
/*
|
24
65
|
Extern: magick_malloc, magick_free, magick_realloc
|
25
66
|
Purpose: ****Magick versions of standard memory routines.
|
@@ -30,11 +71,7 @@ static VALUE Pixel_from_MagickPixelPacket(MagickPixelPacket *);
|
|
30
71
|
void *magick_malloc(const size_t size)
|
31
72
|
{
|
32
73
|
void *ptr;
|
33
|
-
#if defined(HAVE_ACQUIREMAGICKMEMORY)
|
34
74
|
ptr = AcquireMagickMemory(size);
|
35
|
-
#else
|
36
|
-
ptr = AcquireMemory(size);
|
37
|
-
#endif
|
38
75
|
if (!ptr)
|
39
76
|
{
|
40
77
|
rb_raise(rb_eNoMemError, "not enough memory to continue");
|
@@ -45,23 +82,13 @@ void *magick_malloc(const size_t size)
|
|
45
82
|
|
46
83
|
void magick_free(void *ptr)
|
47
84
|
{
|
48
|
-
|
49
|
-
RelinquishMagickMemory(ptr);
|
50
|
-
#else
|
51
|
-
void *v = ptr;
|
52
|
-
LiberateMemory(&v);
|
53
|
-
#endif
|
85
|
+
(void) RelinquishMagickMemory(ptr);
|
54
86
|
}
|
55
87
|
|
56
88
|
void *magick_realloc(void *ptr, const size_t size)
|
57
89
|
{
|
58
90
|
void *v;
|
59
|
-
#if defined(HAVE_ACQUIREMAGICKMEMORY)
|
60
91
|
v = ResizeMagickMemory(ptr, size);
|
61
|
-
#else
|
62
|
-
v = ptr;
|
63
|
-
ReacquireMemory(&v, size);
|
64
|
-
#endif
|
65
92
|
if (!v)
|
66
93
|
{
|
67
94
|
rb_raise(rb_eNoMemError, "not enough memory to continue");
|
@@ -79,7 +106,7 @@ void *magick_realloc(void *ptr, const size_t size)
|
|
79
106
|
*/
|
80
107
|
void magick_clone_string(char **new_str, const char *str)
|
81
108
|
{
|
82
|
-
CloneString(new_str, str);
|
109
|
+
(void) CloneString(new_str, str);
|
83
110
|
}
|
84
111
|
|
85
112
|
|
@@ -161,7 +188,7 @@ rm_strcasecmp(const char *s1, const char *s2)
|
|
161
188
|
* Purpose: raise exception if array too short
|
162
189
|
*/
|
163
190
|
void
|
164
|
-
rm_check_ary_len(VALUE ary,
|
191
|
+
rm_check_ary_len(VALUE ary, long len)
|
165
192
|
{
|
166
193
|
if (RARRAY(ary)->len < len)
|
167
194
|
{
|
@@ -237,7 +264,7 @@ rm_percentage(VALUE arg)
|
|
237
264
|
int not_num;
|
238
265
|
|
239
266
|
// Try to convert the argument to a number. If failure, sets not_num to non-zero.
|
240
|
-
rb_protect(arg_is_number, arg, ¬_num);
|
267
|
+
(void) rb_protect(arg_is_number, arg, ¬_num);
|
241
268
|
|
242
269
|
if (not_num)
|
243
270
|
{
|
@@ -287,7 +314,7 @@ rm_percentage(VALUE arg)
|
|
287
314
|
static VALUE
|
288
315
|
check_num2dbl(VALUE obj)
|
289
316
|
{
|
290
|
-
rb_num2dbl(obj);
|
317
|
+
(void) rb_num2dbl(obj);
|
291
318
|
return INT2FIX(1);
|
292
319
|
}
|
293
320
|
|
@@ -360,7 +387,7 @@ rm_fuzz_to_dbl(VALUE fuzz_arg)
|
|
360
387
|
int not_num;
|
361
388
|
|
362
389
|
// Try to convert the argument to a number. If failure, sets not_num to non-zero.
|
363
|
-
rb_protect(arg_is_number, fuzz_arg, ¬_num);
|
390
|
+
(void) rb_protect(arg_is_number, fuzz_arg, ¬_num);
|
364
391
|
|
365
392
|
if (not_num)
|
366
393
|
{
|
@@ -462,7 +489,7 @@ Pixel_to_s(VALUE self)
|
|
462
489
|
|
463
490
|
Data_Get_Struct(self, Pixel, pixel);
|
464
491
|
sprintf(buff, "red=%d, green=%d, blue=%d, opacity=%d"
|
465
|
-
, pixel->red, pixel->green, pixel->blue, pixel->opacity);
|
492
|
+
, (int)pixel->red, (int)pixel->green, (int)pixel->blue, (int)pixel->opacity);
|
466
493
|
return rb_str_new2(buff);
|
467
494
|
}
|
468
495
|
|
@@ -487,7 +514,7 @@ Pixel_from_color(VALUE class, VALUE name)
|
|
487
514
|
GetExceptionInfo(&exception);
|
488
515
|
okay = QueryColorDatabase(STRING_PTR(name), &pp, &exception);
|
489
516
|
CHECK_EXCEPTION()
|
490
|
-
DestroyExceptionInfo(&exception);
|
517
|
+
(void) DestroyExceptionInfo(&exception);
|
491
518
|
|
492
519
|
if (!okay)
|
493
520
|
{
|
@@ -553,12 +580,12 @@ Pixel_to_color(int argc, VALUE *argv, VALUE self)
|
|
553
580
|
image = AllocateImage(info);
|
554
581
|
image->depth = depth;
|
555
582
|
image->matte = matte;
|
556
|
-
DestroyImageInfo(info);
|
583
|
+
(void) DestroyImageInfo(info);
|
557
584
|
GetExceptionInfo(&exception);
|
558
585
|
(void) QueryColorname(image, pixel, compliance, name, &exception);
|
559
|
-
DestroyImage(image);
|
586
|
+
(void) DestroyImage(image);
|
560
587
|
CHECK_EXCEPTION()
|
561
|
-
DestroyExceptionInfo(&exception);
|
588
|
+
(void) DestroyExceptionInfo(&exception);
|
562
589
|
|
563
590
|
// Always return a string, even if it's ""
|
564
591
|
return rb_str_new2(name);
|
@@ -672,7 +699,7 @@ Pixel_fcmp(int argc, VALUE *argv, VALUE self)
|
|
672
699
|
{
|
673
700
|
rb_raise(rb_eNoMemError, "not enough memory to continue");
|
674
701
|
}
|
675
|
-
DestroyImageInfo(info);
|
702
|
+
(void) DestroyImageInfo(info);
|
676
703
|
|
677
704
|
image->colorspace = colorspace;
|
678
705
|
image->fuzz = fuzz;
|
@@ -682,7 +709,7 @@ Pixel_fcmp(int argc, VALUE *argv, VALUE self)
|
|
682
709
|
#else
|
683
710
|
equal = FuzzyColorCompare(image, this, that);
|
684
711
|
#endif
|
685
|
-
DestroyImage(image);
|
712
|
+
(void) DestroyImage(image);
|
686
713
|
|
687
714
|
#else
|
688
715
|
equal = FuzzyColorMatch(this, that, fuzz);
|
@@ -723,14 +750,15 @@ VALUE
|
|
723
750
|
Pixel_intensity(VALUE self)
|
724
751
|
{
|
725
752
|
Pixel *pixel;
|
726
|
-
|
753
|
+
Quantum intensity;
|
727
754
|
|
728
755
|
Data_Get_Struct(self, Pixel, pixel);
|
729
756
|
|
730
|
-
intensity = (
|
731
|
-
|
757
|
+
intensity = RoundToQuantum((0.299*pixel->red)
|
758
|
+
+ (0.587*pixel->green)
|
759
|
+
+ (0.114*pixel->blue));
|
732
760
|
|
733
|
-
return ULONG2NUM(intensity);
|
761
|
+
return ULONG2NUM((unsigned long) intensity);
|
734
762
|
}
|
735
763
|
|
736
764
|
|
@@ -926,7 +954,7 @@ Pixel_dup(VALUE self)
|
|
926
954
|
dup = Data_Wrap_Struct(CLASS_OF(self), NULL, destroy_Pixel, pixel);
|
927
955
|
if (rb_obj_tainted(self))
|
928
956
|
{
|
929
|
-
rb_obj_taint(dup);
|
957
|
+
(void) rb_obj_taint(dup);
|
930
958
|
}
|
931
959
|
return rb_funcall(dup, ID_initialize_copy, 1, self);
|
932
960
|
}
|
@@ -944,7 +972,7 @@ Pixel_clone(VALUE self)
|
|
944
972
|
clone = Pixel_dup(self);
|
945
973
|
if (OBJ_FROZEN(self))
|
946
974
|
{
|
947
|
-
rb_obj_freeze(clone);
|
975
|
+
(void) rb_obj_freeze(clone);
|
948
976
|
}
|
949
977
|
|
950
978
|
return clone;
|
@@ -1018,7 +1046,7 @@ PixelPacket_to_Color_Name(Image *image, PixelPacket *color)
|
|
1018
1046
|
|
1019
1047
|
(void) QueryColorname(image, color, X11Compliance, name, &exception);
|
1020
1048
|
CHECK_EXCEPTION()
|
1021
|
-
DestroyExceptionInfo(&exception);
|
1049
|
+
(void) DestroyExceptionInfo(&exception);
|
1022
1050
|
|
1023
1051
|
return rb_str_new2(name);
|
1024
1052
|
}
|
@@ -1045,12 +1073,12 @@ PixelPacket_to_Color_Name_Info(Info *info, PixelPacket *color)
|
|
1045
1073
|
my_info = info ? info : CloneImageInfo(NULL);
|
1046
1074
|
|
1047
1075
|
image = AllocateImage(info);
|
1048
|
-
image->matte =
|
1076
|
+
image->matte = MagickFalse;
|
1049
1077
|
color_name = PixelPacket_to_Color_Name(image, color);
|
1050
|
-
DestroyImage(image);
|
1078
|
+
(void) DestroyImage(image);
|
1051
1079
|
if (!info)
|
1052
1080
|
{
|
1053
|
-
DestroyImageInfo(my_info);
|
1081
|
+
(void) DestroyImageInfo(my_info);
|
1054
1082
|
}
|
1055
1083
|
|
1056
1084
|
return color_name;
|
@@ -1071,7 +1099,7 @@ Color_Name_to_PixelPacket(PixelPacket *color, VALUE name_arg)
|
|
1071
1099
|
GetExceptionInfo(&exception);
|
1072
1100
|
name = STRING_PTR(name_arg);
|
1073
1101
|
okay = QueryColorDatabase(name, color, &exception);
|
1074
|
-
DestroyExceptionInfo(&exception);
|
1102
|
+
(void) DestroyExceptionInfo(&exception);
|
1075
1103
|
if (!okay)
|
1076
1104
|
{
|
1077
1105
|
rb_raise(rb_eArgError, "invalid color name %s", name);
|
@@ -1291,12 +1319,10 @@ CompositeOperator_name(CompositeOperator op)
|
|
1291
1319
|
ENUM_TO_NAME(ColorizeCompositeOp)
|
1292
1320
|
ENUM_TO_NAME(CopyBlueCompositeOp)
|
1293
1321
|
ENUM_TO_NAME(CopyCompositeOp)
|
1294
|
-
#if defined(HAVE_COPYCYANCOMPOSITEOP) // CYMK added 5.5.7
|
1295
1322
|
ENUM_TO_NAME(CopyCyanCompositeOp)
|
1296
1323
|
ENUM_TO_NAME(CopyMagentaCompositeOp)
|
1297
1324
|
ENUM_TO_NAME(CopyYellowCompositeOp)
|
1298
1325
|
ENUM_TO_NAME(CopyBlackCompositeOp)
|
1299
|
-
#endif
|
1300
1326
|
ENUM_TO_NAME(CopyGreenCompositeOp)
|
1301
1327
|
ENUM_TO_NAME(CopyOpacityCompositeOp)
|
1302
1328
|
ENUM_TO_NAME(CopyRedCompositeOp)
|
@@ -1520,6 +1546,9 @@ ImageType_name(ImageType type)
|
|
1520
1546
|
ENUM_TO_NAME(ColorSeparationType)
|
1521
1547
|
ENUM_TO_NAME(ColorSeparationMatteType)
|
1522
1548
|
ENUM_TO_NAME(OptimizeType)
|
1549
|
+
#if defined(HAVE_PALETTEBILEVELMATTETYPE)
|
1550
|
+
ENUM_TO_NAME(PaletteBilevelMatteType)
|
1551
|
+
#endif
|
1523
1552
|
}
|
1524
1553
|
|
1525
1554
|
}
|
@@ -1802,7 +1831,7 @@ Color_to_ColorInfo(ColorInfo *ci, VALUE st)
|
|
1802
1831
|
m = rb_ary_entry(members, 0);
|
1803
1832
|
if (m != Qnil)
|
1804
1833
|
{
|
1805
|
-
CloneString((char **)&(ci->name), STRING_PTR(m));
|
1834
|
+
(void) CloneString((char **)&(ci->name), STRING_PTR(m));
|
1806
1835
|
}
|
1807
1836
|
m = rb_ary_entry(members, 1);
|
1808
1837
|
if (m != Qnil)
|
@@ -1970,11 +1999,11 @@ PrimaryInfo_to_PrimaryInfo(PrimaryInfo *pi, VALUE sp)
|
|
1970
1999
|
}
|
1971
2000
|
members = rb_funcall(sp, ID_values, 0);
|
1972
2001
|
m = rb_ary_entry(members, 0);
|
1973
|
-
pi->x = m == Qnil ? 0 :
|
2002
|
+
pi->x = m == Qnil ? 0.0 : NUM2DBL(m);
|
1974
2003
|
m = rb_ary_entry(members, 1);
|
1975
|
-
pi->y = m == Qnil ? 0 :
|
2004
|
+
pi->y = m == Qnil ? 0.0 : NUM2DBL(m);
|
1976
2005
|
m = rb_ary_entry(members, 2);
|
1977
|
-
pi->z = m == Qnil ? 0 :
|
2006
|
+
pi->z = m == Qnil ? 0.0 : NUM2DBL(m);
|
1978
2007
|
}
|
1979
2008
|
|
1980
2009
|
/*
|
@@ -2004,9 +2033,9 @@ Point_to_PointInfo(PointInfo *pi, VALUE sp)
|
|
2004
2033
|
}
|
2005
2034
|
members = rb_funcall(sp, ID_values, 0);
|
2006
2035
|
m = rb_ary_entry(members, 0);
|
2007
|
-
pi->x = m == Qnil ? 0 :
|
2036
|
+
pi->x = m == Qnil ? 0.0 : NUM2DBL(m);
|
2008
2037
|
m = rb_ary_entry(members, 1);
|
2009
|
-
pi->y = m == Qnil ? 0 :
|
2038
|
+
pi->y = m == Qnil ? 0.0 : NUM2DBL(m);
|
2010
2039
|
}
|
2011
2040
|
|
2012
2041
|
|
@@ -2221,7 +2250,7 @@ Font_from_TypeInfo(TypeInfo *ti)
|
|
2221
2250
|
family = rb_str_new2(ti->family);
|
2222
2251
|
style = StyleType_new(ti->style);
|
2223
2252
|
stretch = StretchType_new(ti->stretch);
|
2224
|
-
weight =
|
2253
|
+
weight = UINT2NUM(ti->weight);
|
2225
2254
|
description = ti->description ? rb_str_new2(ti->description) : Qnil;
|
2226
2255
|
encoding = ti->encoding ? rb_str_new2(ti->encoding) : Qnil;
|
2227
2256
|
foundry = ti->foundry ? rb_str_new2(ti->foundry) : Qnil;
|
@@ -2253,17 +2282,17 @@ Font_to_TypeInfo(TypeInfo *ti, VALUE st)
|
|
2253
2282
|
m = rb_ary_entry(members, 0);
|
2254
2283
|
if (m != Qnil)
|
2255
2284
|
{
|
2256
|
-
CloneString((char **)&(ti->name), STRING_PTR(m));
|
2285
|
+
(void) CloneString((char **)&(ti->name), STRING_PTR(m));
|
2257
2286
|
}
|
2258
2287
|
m = rb_ary_entry(members, 1);
|
2259
2288
|
if (m != Qnil)
|
2260
2289
|
{
|
2261
|
-
CloneString((char **)&(ti->description), STRING_PTR(m));
|
2290
|
+
(void) CloneString((char **)&(ti->description), STRING_PTR(m));
|
2262
2291
|
}
|
2263
2292
|
m = rb_ary_entry(members, 2);
|
2264
2293
|
if (m != Qnil)
|
2265
2294
|
{
|
2266
|
-
CloneString((char **)&(ti->family), STRING_PTR(m));
|
2295
|
+
(void) CloneString((char **)&(ti->family), STRING_PTR(m));
|
2267
2296
|
}
|
2268
2297
|
m = rb_ary_entry(members, 3); ti->style = m == Qnil ? 0 : FIX2INT(m);
|
2269
2298
|
m = rb_ary_entry(members, 4); ti->stretch = m == Qnil ? 0 : FIX2INT(m);
|
@@ -2271,13 +2300,13 @@ Font_to_TypeInfo(TypeInfo *ti, VALUE st)
|
|
2271
2300
|
|
2272
2301
|
m = rb_ary_entry(members, 6);
|
2273
2302
|
if (m != Qnil)
|
2274
|
-
CloneString((char **)&(ti->encoding), STRING_PTR(m));
|
2303
|
+
(void) CloneString((char **)&(ti->encoding), STRING_PTR(m));
|
2275
2304
|
m = rb_ary_entry(members, 7);
|
2276
2305
|
if (m != Qnil)
|
2277
|
-
CloneString((char **)&(ti->foundry), STRING_PTR(m));
|
2306
|
+
(void) CloneString((char **)&(ti->foundry), STRING_PTR(m));
|
2278
2307
|
m = rb_ary_entry(members, 8);
|
2279
2308
|
if (m != Qnil)
|
2280
|
-
CloneString((char **)&(ti->format), STRING_PTR(m));
|
2309
|
+
(void) CloneString((char **)&(ti->format), STRING_PTR(m));
|
2281
2310
|
}
|
2282
2311
|
|
2283
2312
|
|
@@ -2655,7 +2684,7 @@ VALUE Enum_type_initialize(VALUE self, VALUE sym, VALUE val)
|
|
2655
2684
|
|
2656
2685
|
super_argv[0] = sym;
|
2657
2686
|
super_argv[1] = val;
|
2658
|
-
rb_call_super(2, (VALUE *)super_argv);
|
2687
|
+
(void) rb_call_super(2, (VALUE *)super_argv);
|
2659
2688
|
|
2660
2689
|
if (rb_cvar_defined(CLASS_OF(self), ID_enumerators) != Qtrue)
|
2661
2690
|
{
|
@@ -2664,7 +2693,7 @@ VALUE Enum_type_initialize(VALUE self, VALUE sym, VALUE val)
|
|
2664
2693
|
}
|
2665
2694
|
|
2666
2695
|
enumerators = rb_cvar_get(CLASS_OF(self), ID_enumerators);
|
2667
|
-
rb_ary_push(enumerators, self);
|
2696
|
+
(void) rb_ary_push(enumerators, self);
|
2668
2697
|
|
2669
2698
|
return self;
|
2670
2699
|
}
|
@@ -2703,7 +2732,7 @@ static VALUE Enum_type_values(VALUE class)
|
|
2703
2732
|
{
|
2704
2733
|
for (x = 0; x < RARRAY(enumerators)->len; x++)
|
2705
2734
|
{
|
2706
|
-
rb_yield(rb_ary_entry(enumerators, x));
|
2735
|
+
(void) rb_yield(rb_ary_entry(enumerators, x));
|
2707
2736
|
}
|
2708
2737
|
rv = class;
|
2709
2738
|
}
|
@@ -2712,7 +2741,7 @@ static VALUE Enum_type_values(VALUE class)
|
|
2712
2741
|
copy = rb_ary_new2(RARRAY(enumerators)->len);
|
2713
2742
|
for (x = 0; x < RARRAY(enumerators)->len; x++)
|
2714
2743
|
{
|
2715
|
-
rb_ary_push(copy, rb_ary_entry(enumerators, x));
|
2744
|
+
(void) rb_ary_push(copy, rb_ary_entry(enumerators, x));
|
2716
2745
|
}
|
2717
2746
|
OBJ_FREEZE(copy);
|
2718
2747
|
rv = copy;
|
@@ -2902,11 +2931,11 @@ rm_write_temp_image(Image *image, char *tmpnam)
|
|
2902
2931
|
long registry_id;
|
2903
2932
|
|
2904
2933
|
registry_id = SetMagickRegistry(ImageRegistryType, image, sizeof(Image), &image->exception);
|
2934
|
+
rm_check_image_exception(image, RetainOnError);
|
2905
2935
|
if (registry_id < 0)
|
2906
2936
|
{
|
2907
2937
|
rb_raise(rb_eRuntimeError, "SetMagickRegistry failed.");
|
2908
2938
|
}
|
2909
|
-
rm_check_image_exception(image, RetainOnError);
|
2910
2939
|
|
2911
2940
|
sprintf(tmpnam, "mpri:%ld", registry_id);
|
2912
2941
|
}
|
@@ -2963,7 +2992,7 @@ rm_magick_error(const char *msg, const char *loc)
|
|
2963
2992
|
extra = loc ? rb_str_new2(loc) : Qnil;
|
2964
2993
|
|
2965
2994
|
exc = rb_funcall(Class_ImageMagickError, ID_new, 2, mesg, extra);
|
2966
|
-
rb_funcall(rb_cObject, rb_intern("raise"), 1, exc);
|
2995
|
+
(void) rb_funcall(rb_cObject, rb_intern("raise"), 1, exc);
|
2967
2996
|
}
|
2968
2997
|
|
2969
2998
|
|
@@ -2992,8 +3021,8 @@ ImageMagickError_initialize(int argc, VALUE *argv, VALUE self)
|
|
2992
3021
|
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0 to 2)", argc);
|
2993
3022
|
}
|
2994
3023
|
|
2995
|
-
rb_call_super(super_argc, (VALUE *)super_argv);
|
2996
|
-
rb_iv_set(self, "@"MAGICK_LOC, extra);
|
3024
|
+
(void) rb_call_super(super_argc, (VALUE *)super_argv);
|
3025
|
+
(void) rb_iv_set(self, "@"MAGICK_LOC, extra);
|
2997
3026
|
|
2998
3027
|
|
2999
3028
|
return self;
|
@@ -3059,13 +3088,13 @@ Image *rm_clone_image(Image *image)
|
|
3059
3088
|
ExceptionInfo exception;
|
3060
3089
|
|
3061
3090
|
GetExceptionInfo(&exception);
|
3062
|
-
clone = CloneImage(image, 0, 0,
|
3091
|
+
clone = CloneImage(image, 0, 0, MagickTrue, &exception);
|
3063
3092
|
if (!clone)
|
3064
3093
|
{
|
3065
3094
|
rb_raise(rb_eNoMemError, "not enough memory to continue");
|
3066
3095
|
}
|
3067
3096
|
rm_check_exception(&exception, clone, DestroyOnError);
|
3068
|
-
DestroyExceptionInfo(&exception);
|
3097
|
+
(void) DestroyExceptionInfo(&exception);
|
3069
3098
|
|
3070
3099
|
return clone;
|
3071
3100
|
}
|
@@ -3267,7 +3296,7 @@ rm_check_image_exception(Image *imglist, ErrorRetention retention)
|
|
3267
3296
|
rm_check_exception(&exception, imglist, retention);
|
3268
3297
|
}
|
3269
3298
|
|
3270
|
-
DestroyExceptionInfo(&exception);
|
3299
|
+
(void) DestroyExceptionInfo(&exception);
|
3271
3300
|
}
|
3272
3301
|
|
3273
3302
|
|
@@ -3407,11 +3436,11 @@ handle_exception(ExceptionInfo *exception, Image *imglist, ErrorRetention retent
|
|
3407
3436
|
|
3408
3437
|
extra[sizeof(extra)-1] = '\0';
|
3409
3438
|
|
3410
|
-
DestroyExceptionInfo(exception);
|
3439
|
+
(void) DestroyExceptionInfo(exception);
|
3411
3440
|
rm_magick_error(msg, extra);
|
3412
3441
|
|
3413
3442
|
#else
|
3414
|
-
DestroyExceptionInfo(exception);
|
3443
|
+
(void) DestroyExceptionInfo(exception);
|
3415
3444
|
rm_magick_error(msg, NULL);
|
3416
3445
|
#endif
|
3417
3446
|
|