File tree Expand file tree Collapse file tree 4 files changed +66
-5
lines changed Expand file tree Collapse file tree 4 files changed +66
-5
lines changed Original file line number Diff line number Diff line change 97
97
% o clone_image: the clone image.
98
98
%
99
99
*/
100
+
101
+ typedef char
102
+ * (* CloneKeyFunc )(const char * ),
103
+ * (* CloneValueFunc )(const char * );
104
+
105
+ static inline void * CloneArtifactKey (void * key )
106
+ {
107
+ return ((void * ) ((CloneKeyFunc ) ConstantString )((const char * ) key ));
108
+ }
109
+
110
+ static inline void * CloneArtifactValue (void * value )
111
+ {
112
+ return ((void * ) ((CloneValueFunc ) ConstantString )((const char * ) value ));
113
+ }
114
+
100
115
MagickExport MagickBooleanType CloneImageArtifacts (Image * image ,
101
116
const Image * clone_image )
102
117
{
@@ -115,7 +130,7 @@ MagickExport MagickBooleanType CloneImageArtifacts(Image *image,
115
130
if (image -> artifacts != (void * ) NULL )
116
131
DestroyImageArtifacts (image );
117
132
image -> artifacts = CloneSplayTree ((SplayTreeInfo * ) clone_image -> artifacts ,
118
- ( void * ( * )( void * )) ConstantString ,( void * ( * )( void * )) ConstantString );
133
+ CloneArtifactKey , CloneArtifactValue );
119
134
}
120
135
return (MagickTrue );
121
136
}
Original file line number Diff line number Diff line change @@ -1790,6 +1790,21 @@ static const OptionInfo
1790
1790
% o clone_info: the clone image info.
1791
1791
%
1792
1792
*/
1793
+
1794
+ typedef char
1795
+ * (* CloneKeyFunc )(const char * ),
1796
+ * (* CloneValueFunc )(const char * );
1797
+
1798
+ static inline void * CloneOptionKey (void * key )
1799
+ {
1800
+ return ((void * ) ((CloneKeyFunc ) ConstantString )((const char * ) key ));
1801
+ }
1802
+
1803
+ static inline void * CloneOptionValue (void * value )
1804
+ {
1805
+ return ((void * ) ((CloneValueFunc ) ConstantString )((const char * ) value ));
1806
+ }
1807
+
1793
1808
MagickExport MagickBooleanType CloneImageOptions (ImageInfo * image_info ,
1794
1809
const ImageInfo * clone_info )
1795
1810
{
@@ -1805,7 +1820,7 @@ MagickExport MagickBooleanType CloneImageOptions(ImageInfo *image_info,
1805
1820
if (image_info -> options != (void * ) NULL )
1806
1821
DestroyImageOptions (image_info );
1807
1822
image_info -> options = CloneSplayTree ((SplayTreeInfo * ) clone_info -> options ,
1808
- ( void * ( * )( void * )) ConstantString ,( void * ( * )( void * )) ConstantString );
1823
+ CloneOptionKey , CloneOptionValue );
1809
1824
}
1810
1825
return (MagickTrue );
1811
1826
}
Original file line number Diff line number Diff line change @@ -115,6 +115,23 @@ static void
115
115
% o clone_image: the clone image.
116
116
%
117
117
*/
118
+
119
+ typedef char
120
+ * (* CloneKeyFunc )(const char * );
121
+
122
+ typedef StringInfo
123
+ * (* CloneValueFunc )(const StringInfo * );
124
+
125
+ static inline void * CloneProfileKey (void * key )
126
+ {
127
+ return ((void * ) ((CloneKeyFunc ) ConstantString )((const char * ) key ));
128
+ }
129
+
130
+ static inline void * CloneProfileValue (void * value )
131
+ {
132
+ return ((void * ) ((CloneValueFunc ) CloneStringInfo )((const StringInfo * ) value ));
133
+ }
134
+
118
135
MagickExport MagickBooleanType CloneImageProfiles (Image * image ,
119
136
const Image * clone_image )
120
137
{
@@ -133,7 +150,7 @@ MagickExport MagickBooleanType CloneImageProfiles(Image *image,
133
150
if (image -> profiles != (void * ) NULL )
134
151
DestroyImageProfiles (image );
135
152
image -> profiles = CloneSplayTree ((SplayTreeInfo * ) clone_image -> profiles ,
136
- ( void * ( * )( void * )) ConstantString ,( void * ( * )( void * )) CloneStringInfo );
153
+ CloneProfileKey , CloneProfileValue );
137
154
}
138
155
return (MagickTrue );
139
156
}
Original file line number Diff line number Diff line change 127
127
% o clone_image: the clone image.
128
128
%
129
129
*/
130
+
131
+ typedef char
132
+ * (* CloneKeyFunc )(const char * ),
133
+ * (* CloneValueFunc )(const char * );
134
+
135
+ static inline void * ClonePropertyKey (void * key )
136
+ {
137
+ return ((void * ) ((CloneKeyFunc ) ConstantString )((const char * ) key ));
138
+ }
139
+
140
+ static inline void * ClonePropertyValue (void * value )
141
+ {
142
+ return ((void * ) ((CloneValueFunc ) ConstantString )((const char * ) value ));
143
+ }
144
+
130
145
MagickExport MagickBooleanType CloneImageProperties (Image * image ,
131
146
const Image * clone_image )
132
147
{
@@ -192,8 +207,7 @@ MagickExport MagickBooleanType CloneImageProperties(Image *image,
192
207
if (image -> properties != (void * ) NULL )
193
208
DestroyImageProperties (image );
194
209
image -> properties = CloneSplayTree ((SplayTreeInfo * )
195
- clone_image -> properties ,(void * (* )(void * )) ConstantString ,
196
- (void * (* )(void * )) ConstantString );
210
+ clone_image -> properties ,ClonePropertyKey ,ClonePropertyValue );
197
211
}
198
212
return (MagickTrue );
199
213
}
You can’t perform that action at this time.
0 commit comments