From 0df696d814c8f16c020d5157c85ffeaa66a62045 Mon Sep 17 00:00:00 2001 From: cristy Date: Wed, 18 May 2011 19:55:22 +0000 Subject: [PATCH] --- PerlMagick/Magick.xs | 9 +-- coders/cin.c | 6 +- coders/dpx.c | 28 ++++---- coders/fits.c | 8 +-- coders/hdr.c | 2 +- coders/jbig.c | 2 +- coders/miff.c | 4 +- coders/mpc.c | 8 +-- coders/msl.c | 148 ++++++++++++++++++++-------------------- coders/pnm.c | 2 +- coders/sct.c | 4 +- coders/svg.c | 94 ++++++++++++------------- coders/tiff.c | 2 +- magick/colorspace.c | 18 ++--- magick/display.c | 9 +-- magick/distort.c | 2 +- magick/draw.c | 124 ++++++++++++++++----------------- magick/enhance.c | 20 +++--- magick/fx.c | 10 +-- magick/geometry.c | 36 +++++----- magick/morphology.c | 2 +- magick/quantum.c | 6 +- magick/resize.c | 14 ++-- magick/string-private.h | 7 +- magick/string.c | 31 +++++++++ magick/string_.h | 3 + magick/token.c | 3 +- wand/animate.c | 2 +- wand/compare.c | 4 +- wand/composite.c | 2 +- wand/convert.c | 2 +- wand/display.c | 4 +- wand/drawing-wand.c | 12 ++-- wand/identify.c | 2 +- wand/import.c | 2 +- wand/magick-property.c | 2 +- wand/mogrify.c | 32 ++++----- wand/montage.c | 4 +- wand/stream.c | 2 +- 39 files changed, 350 insertions(+), 322 deletions(-) diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index 99d857df6..70c898bf8 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -1025,7 +1025,7 @@ static struct PackageInfo *GetPackageInfo(pTHX_ void *reference, % */ -static inline double SiPrefixToDouble(const char *string,const double interval) +static double SiPrefixToDouble(const char *string,const double interval) { char *q; @@ -1034,7 +1034,7 @@ static inline double SiPrefixToDouble(const char *string,const double interval) scale, value; - value=strtod(string,&q); + value=StringToDouble(string,&q); scale=1000.0; if ((*q != '\0') && (tolower((int) ((unsigned char) *(q+1))) == 'i')) scale=1024.0; @@ -1054,11 +1054,6 @@ static inline double SiPrefixToDouble(const char *string,const double interval) return(value); } -static inline double StringToDouble(const char *value) -{ - return(strtod(value,(char **) NULL)); -} - static inline ssize_t StringToLong(const char *value) { return(strtol(value,(char **) NULL,10)); diff --git a/coders/cin.c b/coders/cin.c index 66e64b0ed..5cb0588e7 100644 --- a/coders/cin.c +++ b/coders/cin.c @@ -1059,12 +1059,12 @@ static MagickBooleanType WriteCINImage(const ImageInfo *image_info,Image *image) cin.origination.x_pitch=0.0f; value=GetCINProperty(image_info,image,"dpx:origination.x_pitch"); if (value != (const char *) NULL) - cin.origination.x_pitch=StringToDouble(value); + cin.origination.x_pitch=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,cin.origination.x_pitch); cin.origination.y_pitch=0.0f; value=GetCINProperty(image_info,image,"dpx:origination.y_pitch"); if (value != (const char *) NULL) - cin.origination.y_pitch=StringToDouble(value); + cin.origination.y_pitch=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,cin.origination.y_pitch); cin.origination.gamma=image->gamma; offset+=WriteBlobFloat(image,cin.origination.gamma); @@ -1112,7 +1112,7 @@ static MagickBooleanType WriteCINImage(const ImageInfo *image_info,Image *image) cin.film.frame_rate=0.0f; value=GetCINProperty(image_info,image,"dpx:film.frame_rate"); if (value != (const char *) NULL) - cin.film.frame_rate=StringToDouble(value); + cin.film.frame_rate=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,cin.film.frame_rate); value=GetCINProperty(image_info,image,"dpx:film.frame_id"); if (value != (const char *) NULL) diff --git a/coders/dpx.c b/coders/dpx.c index 788e05ee0..9a41efd93 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -1532,12 +1532,12 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image) dpx.orientation.x_center=0.0f; value=GetDPXProperty(image_info,image,"dpx:orientation.x_center"); if (value != (const char *) NULL) - dpx.orientation.x_center=StringToDouble(value); + dpx.orientation.x_center=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.orientation.x_center); dpx.orientation.y_center=0.0f; value=GetDPXProperty(image_info,image,"dpx:orientation.y_center"); if (value != (const char *) NULL) - dpx.orientation.y_center=StringToDouble(value); + dpx.orientation.y_center=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.orientation.y_center); dpx.orientation.x_size=0U; value=GetDPXProperty(image_info,image,"dpx:orientation.x_size"); @@ -1653,12 +1653,12 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image) dpx.film.frame_rate=0.0f; value=GetDPXProperty(image_info,image,"dpx:film.frame_rate"); if (value != (const char *) NULL) - dpx.film.frame_rate=StringToDouble(value); + dpx.film.frame_rate=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.film.frame_rate); dpx.film.shutter_angle=0.0f; value=GetDPXProperty(image_info,image,"dpx:film.shutter_angle"); if (value != (const char *) NULL) - dpx.film.shutter_angle=StringToDouble(value); + dpx.film.shutter_angle=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.film.shutter_angle); *dpx.film.frame_id='\0'; value=GetDPXProperty(image_info,image,"dpx:film.frame_id"); @@ -1706,52 +1706,52 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image) value=GetDPXProperty(image_info,image, "dpx:television.horizontal_sample_rate"); if (value != (const char *) NULL) - dpx.television.horizontal_sample_rate=StringToDouble(value); + dpx.television.horizontal_sample_rate=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.horizontal_sample_rate); dpx.television.vertical_sample_rate=0.0f; value=GetDPXProperty(image_info,image,"dpx:television.vertical_sample_rate"); if (value != (const char *) NULL) - dpx.television.vertical_sample_rate=StringToDouble(value); + dpx.television.vertical_sample_rate=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.vertical_sample_rate); dpx.television.frame_rate=0.0f; value=GetDPXProperty(image_info,image,"dpx:television.frame_rate"); if (value != (const char *) NULL) - dpx.television.frame_rate=StringToDouble(value); + dpx.television.frame_rate=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.frame_rate); dpx.television.time_offset=0.0f; value=GetDPXProperty(image_info,image,"dpx:television.time_offset"); if (value != (const char *) NULL) - dpx.television.time_offset=StringToDouble(value); + dpx.television.time_offset=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.time_offset); dpx.television.gamma=0.0f; value=GetDPXProperty(image_info,image,"dpx:television.gamma"); if (value != (const char *) NULL) - dpx.television.gamma=StringToDouble(value); + dpx.television.gamma=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.gamma); dpx.television.black_level=0.0f; value=GetDPXProperty(image_info,image,"dpx:television.black_level"); if (value != (const char *) NULL) - dpx.television.black_level=StringToDouble(value); + dpx.television.black_level=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.black_level); dpx.television.black_gain=0.0f; value=GetDPXProperty(image_info,image,"dpx:television.black_gain"); if (value != (const char *) NULL) - dpx.television.black_gain=StringToDouble(value); + dpx.television.black_gain=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.black_gain); dpx.television.break_point=0.0f; value=GetDPXProperty(image_info,image,"dpx:television.break_point"); if (value != (const char *) NULL) - dpx.television.break_point=StringToDouble(value); + dpx.television.break_point=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.break_point); dpx.television.white_level=0.0f; value=GetDPXProperty(image_info,image,"dpx:television.white_level"); if (value != (const char *) NULL) - dpx.television.white_level=StringToDouble(value); + dpx.television.white_level=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.white_level); dpx.television.integration_times=0.0f; value=GetDPXProperty(image_info,image,"dpx:television.integration_times"); if (value != (const char *) NULL) - dpx.television.integration_times=StringToDouble(value); + dpx.television.integration_times=StringToDouble(value,(char **) NULL); offset+=WriteBlobFloat(image,dpx.television.integration_times); offset+=WriteBlob(image,sizeof(dpx.television.reserve),(unsigned char *) dpx.television.reserve); diff --git a/coders/fits.c b/coders/fits.c index 1f4dd9efb..294c2b2e6 100644 --- a/coders/fits.c +++ b/coders/fits.c @@ -358,13 +358,13 @@ static Image *ReadFITSImage(const ImageInfo *image_info, if (LocaleCompare(keyword,"naxis3") == 0) fits_info.number_planes=StringToLong(p); if (LocaleCompare(keyword,"datamax") == 0) - fits_info.max_data=StringToDouble(p); + fits_info.max_data=StringToDouble(p,(char **) NULL); if (LocaleCompare(keyword,"datamin") == 0) - fits_info.min_data=StringToDouble(p); + fits_info.min_data=StringToDouble(p,(char **) NULL); if (LocaleCompare(keyword,"bzero") == 0) - fits_info.zero=StringToDouble(p); + fits_info.zero=StringToDouble(p,(char **) NULL); if (LocaleCompare(keyword,"bscale") == 0) - fits_info.scale=StringToDouble(p); + fits_info.scale=StringToDouble(p,(char **) NULL); if (LocaleCompare(keyword,"comment") == 0) { if (comment == (char *) NULL) diff --git a/coders/hdr.c b/coders/hdr.c index aa18c30f9..1461fc41a 100644 --- a/coders/hdr.c +++ b/coders/hdr.c @@ -301,7 +301,7 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception) { if (LocaleCompare(keyword,"gamma") == 0) { - image->gamma=StringToDouble(value); + image->gamma=StringToDouble(value,(char **) NULL); break; } (void) FormatMagickString(tag,MaxTextExtent,"hdr:%s",keyword); diff --git a/coders/jbig.c b/coders/jbig.c index 3fc1cb060..da1e447ec 100644 --- a/coders/jbig.c +++ b/coders/jbig.c @@ -443,7 +443,7 @@ static MagickBooleanType WriteJBIGImage(const ImageInfo *image_info, status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception); if (status == MagickFalse) return(status); - version=strtod(JBG_VERSION,(char **) NULL); + version=StringToDouble(JBG_VERSION,(char **) NULL); scene=0; do { diff --git a/coders/miff.c b/coders/miff.c index e63fa9156..661419fe2 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -747,7 +747,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, { if (LocaleCompare(keyword,"gamma") == 0) { - image->gamma=StringToDouble(options); + image->gamma=StringToDouble(options,(char **) NULL); break; } if (LocaleCompare(keyword,"gravity") == 0) @@ -1014,7 +1014,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, { if (LocaleCompare(keyword,"version") == 0) { - version=StringToDouble(options); + version=StringToDouble(options,(char **) NULL); break; } (void) SetImageProperty(image,keyword,options); diff --git a/coders/mpc.c b/coders/mpc.c index a788536cf..645a9e9a8 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -444,7 +444,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (LocaleCompare(keyword,"error") == 0) { - image->error.mean_error_per_pixel=StringToDouble(options); + image->error.mean_error_per_pixel=StringToDouble(options,(char **) NULL); break; } (void) SetImageProperty(image,keyword,options); @@ -455,7 +455,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) { if (LocaleCompare(keyword,"gamma") == 0) { - image->gamma=StringToDouble(options); + image->gamma=StringToDouble(options,(char **) NULL); break; } if (LocaleCompare(keyword,"green-primary") == 0) @@ -511,12 +511,12 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) if (LocaleCompare(keyword,"maximum-error") == 0) { image->error.normalized_maximum_error= - StringToDouble(options); + StringToDouble(options,(char **) NULL); break; } if (LocaleCompare(keyword,"mean-error") == 0) { - image->error.normalized_mean_error=StringToDouble(options); + image->error.normalized_mean_error=StringToDouble(options,(char **) NULL); break; } if (LocaleCompare(keyword,"montage") == 0) diff --git a/coders/msl.c b/coders/msl.c index 11b8a0bea..77cc40d43 100644 --- a/coders/msl.c +++ b/coders/msl.c @@ -780,22 +780,22 @@ static void MSLStartElement(void *context,const xmlChar *tag, *p; p=value; - draw_info->affine.sx=strtod(p,&p); + draw_info->affine.sx=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.rx=strtod(p,&p); + draw_info->affine.rx=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.ry=strtod(p,&p); + draw_info->affine.ry=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.sy=strtod(p,&p); + draw_info->affine.sy=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.tx=strtod(p,&p); + draw_info->affine.tx=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.ty=strtod(p,&p); + draw_info->affine.ty=StringToDouble(p,&p); break; } if (LocaleCompare(keyword,"align") == 0) @@ -900,7 +900,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"pointsize") == 0) { - draw_info->pointsize=StringToDouble(value); + draw_info->pointsize=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -912,7 +912,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"rotate") == 0) { - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); affine.sx=cos(DegreesToRadians(fmod(angle,360.0))); affine.rx=sin(DegreesToRadians(fmod(angle,360.0))); affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0)))); @@ -937,14 +937,14 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"skewX") == 0) { - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); affine.ry=tan(DegreesToRadians(fmod((double) angle, 360.0))); break; } if (LocaleCompare(keyword,"skewY") == 0) { - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); affine.rx=tan(DegreesToRadians(fmod((double) angle, 360.0))); break; @@ -1199,7 +1199,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"radius") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -1449,7 +1449,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword, "radius") == 0) { - radius = StringToDouble( value ); + radius = StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -1648,7 +1648,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"fuzz") == 0) { - msl_info->image[n]->fuzz=StringToDouble(value); + msl_info->image[n]->fuzz=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -1954,7 +1954,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"rotate") == 0) { - rotate_image=RotateImage(composite_image,StringToDouble(value), + rotate_image=RotateImage(composite_image,StringToDouble(value,(char **) NULL), &exception); break; } @@ -2368,22 +2368,22 @@ static void MSLStartElement(void *context,const xmlChar *tag, *p; p=value; - draw_info->affine.sx=strtod(p,&p); + draw_info->affine.sx=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.rx=strtod(p,&p); + draw_info->affine.rx=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.ry=strtod(p,&p); + draw_info->affine.ry=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.sy=strtod(p,&p); + draw_info->affine.sy=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.tx=strtod(p,&p); + draw_info->affine.tx=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.ty=strtod(p,&p); + draw_info->affine.ty=StringToDouble(p,&p); break; } if (LocaleCompare(keyword,"align") == 0) @@ -2493,7 +2493,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"pointsize") == 0) { - draw_info->pointsize=StringToDouble(value); + draw_info->pointsize=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -2505,7 +2505,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"rotate") == 0) { - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); affine.sx=cos(DegreesToRadians(fmod(angle,360.0))); affine.rx=sin(DegreesToRadians(fmod(angle,360.0))); affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0)))); @@ -2530,13 +2530,13 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"skewX") == 0) { - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); affine.ry=cos(DegreesToRadians(fmod(angle,360.0))); break; } if (LocaleCompare(keyword,"skewY") == 0) { - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); affine.rx=cos(DegreesToRadians(fmod(angle,360.0))); break; } @@ -2716,7 +2716,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"radius") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -2781,7 +2781,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"radius") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3155,7 +3155,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"blue") == 0) { - pixel.blue=StringToDouble(value); + pixel.blue=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3188,7 +3188,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"green") == 0) { - pixel.green=StringToDouble(value); + pixel.green=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3200,7 +3200,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"red") == 0) { - pixel.red=StringToDouble(value); + pixel.red=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3394,7 +3394,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"amount") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3463,7 +3463,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"black") == 0) { - levelBlack = StringToDouble( value ); + levelBlack = StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -3474,7 +3474,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"gamma") == 0) { - levelGamma = StringToDouble( value ); + levelGamma = StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -3485,7 +3485,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"white") == 0) { - levelWhite = StringToDouble( value ); + levelWhite = StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -3677,7 +3677,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"fuzz") == 0) { - msl_info->image[n]->fuzz=StringToDouble(value); + msl_info->image[n]->fuzz=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3706,7 +3706,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"opacity") == 0) { - opacity=StringToDouble(value); + opacity=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3800,7 +3800,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"radius") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3888,12 +3888,12 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"blackness") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } if (LocaleCompare(keyword,"brightness") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3917,7 +3917,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"hue") == 0) { - geometry_info.xi=StringToDouble(value); + geometry_info.xi=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3929,7 +3929,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"lightness") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3941,7 +3941,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"saturation") == 0) { - geometry_info.sigma=StringToDouble(value); + geometry_info.sigma=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3953,7 +3953,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"whiteness") == 0) { - geometry_info.sigma=StringToDouble(value); + geometry_info.sigma=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -4140,7 +4140,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"radius") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -4215,7 +4215,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"fuzz") == 0) { - msl_info->image[n]->fuzz=StringToDouble(value); + msl_info->image[n]->fuzz=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -4517,22 +4517,22 @@ static void MSLStartElement(void *context,const xmlChar *tag, *p; p=value; - draw_info->affine.sx=strtod(p,&p); + draw_info->affine.sx=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.rx=strtod(p,&p); + draw_info->affine.rx=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.ry=strtod(p,&p); + draw_info->affine.ry=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.sy=strtod(p,&p); + draw_info->affine.sy=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.tx=strtod(p,&p); + draw_info->affine.tx=StringToDouble(p,&p); if (*p ==',') p++; - draw_info->affine.ty=strtod(p,&p); + draw_info->affine.ty=StringToDouble(p,&p); break; } if (LocaleCompare(keyword,"align") == 0) @@ -4637,7 +4637,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"pointsize") == 0) { - draw_info->pointsize=StringToDouble(value); + draw_info->pointsize=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -4649,7 +4649,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"rotate") == 0) { - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); affine.sx=cos(DegreesToRadians(fmod(angle,360.0))); affine.rx=sin(DegreesToRadians(fmod(angle,360.0))); affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0)))); @@ -4674,13 +4674,13 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"skewX") == 0) { - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); affine.ry=cos(DegreesToRadians(fmod(angle,360.0))); break; } if (LocaleCompare(keyword,"skewY") == 0) { - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); affine.rx=cos(DegreesToRadians(fmod(angle,360.0))); break; } @@ -5025,7 +5025,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"radius") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5203,7 +5203,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"blur") == 0) { - msl_info->image[n]->blur=StringToDouble(value); + msl_info->image[n]->blur=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -5232,7 +5232,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"x-resolution") == 0) { - x_resolution=StringToDouble(value); + x_resolution=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -5243,7 +5243,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"y-resolution") == 0) { - y_resolution=StringToDouble(value); + y_resolution=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -5363,7 +5363,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"support") == 0) { - blur=StringToDouble(value); + blur=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5584,7 +5584,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"degrees") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5646,7 +5646,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"degrees") == 0) { - degrees = StringToDouble( value ); + degrees = StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -5868,7 +5868,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"cluster-threshold") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } if (LocaleCompare(keyword,"colorspace") == 0) @@ -5904,7 +5904,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"smoothing-threshold") == 0) { - geometry_info.sigma=StringToDouble(value); + geometry_info.sigma=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -6107,7 +6107,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"azimuth") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -6119,7 +6119,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"elevation") == 0) { - geometry_info.sigma=StringToDouble(value); + geometry_info.sigma=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -6230,7 +6230,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"x") == 0) { - geometry_info.xi=StringToDouble(value); + geometry_info.xi=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -6294,7 +6294,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword, "radius") == 0) { - radius = StringToDouble( value ); + radius = StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -6477,7 +6477,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"x") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -6581,7 +6581,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"threshold") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -6641,7 +6641,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"radius") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -6888,7 +6888,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"degrees") == 0) { - geometry_info.rho=StringToDouble(value); + geometry_info.rho=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -7041,7 +7041,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"threshold") == 0) { - threshold = StringToDouble( value ); + threshold = StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -7990,8 +7990,8 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword, { if (LocaleCompare(keyword,"pointsize") == 0) { - image_info->pointsize=StringToDouble(value); - draw_info->pointsize=StringToDouble(value); + image_info->pointsize=StringToDouble(value,(char **) NULL); + draw_info->pointsize=StringToDouble(value,(char **) NULL); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); diff --git a/coders/pnm.c b/coders/pnm.c index b7981a2a7..85d6252b8 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -304,7 +304,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) scale[MaxTextExtent]; (void) ReadBlobString(image,scale); - quantum_scale=StringToDouble(scale); + quantum_scale=StringToDouble(scale,(char **) NULL); } else { diff --git a/coders/sct.c b/coders/sct.c index 66c601950..528dbac39 100644 --- a/coders/sct.c +++ b/coders/sct.c @@ -204,9 +204,9 @@ static Image *ReadSCTImage(const ImageInfo *image_info,ExceptionInfo *exception) separations_mask=ReadBlobMSBShort(image); count=ReadBlob(image,14,buffer); buffer[14]='\0'; - height=StringToDouble((char *) buffer); + height=StringToDouble((char *) buffer,(char **) NULL); count=ReadBlob(image,14,buffer); - width=StringToDouble((char *) buffer); + width=StringToDouble((char *) buffer,(char **) NULL); count=ReadBlob(image,12,buffer); buffer[12]='\0'; image->rows=StringToUnsignedLong((char *) buffer); diff --git a/coders/svg.c b/coders/svg.c index 05be3deb3..462e04516 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -302,7 +302,7 @@ static double GetUserSpaceCoordinateValue(const SVGInfo *svg_info,int type, assert(string != (const char *) NULL); p=(const char *) string; GetMagickToken(p,&p,token); - value=StringToDouble(token); + value=StringToDouble(token,(char **) NULL); if (strchr(token,'%') != (char *) NULL) { double @@ -1301,27 +1301,27 @@ static void SVGStartElement(void *context,const xmlChar *name, { p=(const char *) value; GetMagickToken(p,&p,token); - affine.sx=StringToDouble(value); + affine.sx=StringToDouble(value,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.rx=StringToDouble(token); + affine.rx=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.ry=StringToDouble(token); + affine.ry=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.sy=StringToDouble(token); + affine.sy=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.tx=StringToDouble(token); + affine.tx=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.ty=StringToDouble(token); + affine.ty=StringToDouble(token,(char **) NULL); break; } break; @@ -1877,27 +1877,27 @@ static void SVGStartElement(void *context,const xmlChar *name, { p=(const char *) value; GetMagickToken(p,&p,token); - affine.sx=StringToDouble(value); + affine.sx=StringToDouble(value,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.rx=StringToDouble(token); + affine.rx=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.ry=StringToDouble(token); + affine.ry=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.sy=StringToDouble(token); + affine.sy=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.tx=StringToDouble(token); + affine.tx=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - affine.ty=StringToDouble(token); + affine.ty=StringToDouble(token,(char **) NULL); break; } break; @@ -1914,15 +1914,15 @@ static void SVGStartElement(void *context,const xmlChar *name, p=(const char *) value; GetMagickToken(p,&p,token); - angle=StringToDouble(value); + angle=StringToDouble(value,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - x=StringToDouble(token); + x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - y=StringToDouble(token); + y=StringToDouble(token,(char **) NULL); affine.sx=cos(DegreesToRadians(fmod(angle,360.0))); affine.rx=sin(DegreesToRadians(fmod(angle,360.0))); affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0)))); @@ -2025,21 +2025,21 @@ static void SVGStartElement(void *context,const xmlChar *name, { p=(const char *) value; GetMagickToken(p,&p,token); - svg_info->view_box.x=StringToDouble(token); + svg_info->view_box.x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - svg_info->view_box.y=StringToDouble(token); + svg_info->view_box.y=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - svg_info->view_box.width=StringToDouble(token); + svg_info->view_box.width=StringToDouble(token,(char **) NULL); if (svg_info->bounds.width == 0) svg_info->bounds.width=svg_info->view_box.width; GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - svg_info->view_box.height=StringToDouble(token); + svg_info->view_box.height=StringToDouble(token,(char **) NULL); if (svg_info->bounds.height == 0) svg_info->bounds.height=svg_info->view_box.height; break; @@ -3509,34 +3509,34 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image) if (LocaleCompare("affine",keyword) == 0) { GetMagickToken(q,&q,token); - affine.sx=StringToDouble(token); + affine.sx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.rx=StringToDouble(token); + affine.rx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.ry=StringToDouble(token); + affine.ry=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.sy=StringToDouble(token); + affine.sy=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.tx=StringToDouble(token); + affine.tx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.ty=StringToDouble(token); + affine.ty=StringToDouble(token,(char **) NULL); break; } if (LocaleCompare("angle",keyword) == 0) { GetMagickToken(q,&q,token); - affine.rx=StringToDouble(token); - affine.ry=StringToDouble(token); + affine.rx=StringToDouble(token,(char **) NULL); + affine.ry=StringToDouble(token,(char **) NULL); break; } if (LocaleCompare("arc",keyword) == 0) @@ -3851,23 +3851,23 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image) GetMagickToken(q,&q,token); (void) CopyMagickString(type,token,MaxTextExtent); GetMagickToken(q,&q,token); - svg_info.segment.x1=StringToDouble(token); - svg_info.element.cx=StringToDouble(token); + svg_info.segment.x1=StringToDouble(token,(char **) NULL); + svg_info.element.cx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - svg_info.segment.y1=StringToDouble(token); - svg_info.element.cy=StringToDouble(token); + svg_info.segment.y1=StringToDouble(token,(char **) NULL); + svg_info.element.cy=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - svg_info.segment.x2=StringToDouble(token); - svg_info.element.major=StringToDouble(token); + svg_info.segment.x2=StringToDouble(token,(char **) NULL); + svg_info.element.major=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - svg_info.segment.y2=StringToDouble(token); - svg_info.element.minor=StringToDouble(token); + svg_info.segment.y2=StringToDouble(token,(char **) NULL); + svg_info.element.minor=StringToDouble(token,(char **) NULL); (void) FormatMagickString(message,MaxTextExtent, "<%sGradient id=\"%s\" x1=\"%g\" y1=\"%g\" x2=\"%g\" " "y2=\"%g\">\n",type,name,svg_info.segment.x1, @@ -3877,7 +3877,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image) GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - svg_info.element.angle=StringToDouble(token); + svg_info.element.angle=StringToDouble(token,(char **) NULL); (void) FormatMagickString(message,MaxTextExtent, "<%sGradient id=\"%s\" cx=\"%g\" cy=\"%g\" r=\"%g\" " "fx=\"%g\" fy=\"%g\">\n",type,name, @@ -3904,19 +3904,19 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image) GetMagickToken(q,&q,token); (void) CopyMagickString(name,token,MaxTextExtent); GetMagickToken(q,&q,token); - svg_info.bounds.x=StringToDouble(token); + svg_info.bounds.x=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - svg_info.bounds.y=StringToDouble(token); + svg_info.bounds.y=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - svg_info.bounds.width=StringToDouble(token); + svg_info.bounds.width=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - svg_info.bounds.height=StringToDouble(token); + svg_info.bounds.height=StringToDouble(token,(char **) NULL); (void) FormatMagickString(message,MaxTextExtent, "\n",name,svg_info.bounds.x, @@ -3960,11 +3960,11 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image) if (LocaleCompare("scale",keyword) == 0) { GetMagickToken(q,&q,token); - affine.sx=StringToDouble(token); + affine.sx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.sy=StringToDouble(token); + affine.sy=StringToDouble(token,(char **) NULL); break; } if (LocaleCompare("skewX",keyword) == 0) @@ -4115,11 +4115,11 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image) if (LocaleCompare("translate",keyword) == 0) { GetMagickToken(q,&q,token); - affine.tx=StringToDouble(token); + affine.tx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.ty=StringToDouble(token); + affine.ty=StringToDouble(token,(char **) NULL); break; } status=MagickFalse; @@ -4168,11 +4168,11 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image) if (IsPoint(q) == MagickFalse) break; GetMagickToken(q,&q,token); - point.x=StringToDouble(token); + point.x=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - point.y=StringToDouble(token); + point.y=StringToDouble(token,(char **) NULL); GetMagickToken(q,(const char **) NULL,token); if (*token == ',') GetMagickToken(q,&q,token); diff --git a/coders/tiff.c b/coders/tiff.c index d394e2a53..d2d6928f5 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -2390,7 +2390,7 @@ static void TIFFSetEXIFProperties(TIFF *tiff,Image *image) float rational; - rational=StringToDouble(value); + rational=StringToDouble(value,(char **) NULL); (void) TIFFSetField(tiff,exif_info[i].tag,rational); break; } diff --git a/magick/colorspace.c b/magick/colorspace.c index 9584a4c26..66c847f65 100644 --- a/magick/colorspace.c +++ b/magick/colorspace.c @@ -622,19 +622,20 @@ MagickExport MagickBooleanType RGBTransformImage(Image *image, gamma=DisplayGamma; value=GetImageProperty(image,"gamma"); if (value != (const char *) NULL) - gamma=1.0/StringToDouble(value) != 0.0 ? StringToDouble(value) : 1.0; + gamma=1.0/StringToDouble(value,(char **) NULL) != 0.0 ? + StringToDouble(value,(char **) NULL) : 1.0; film_gamma=FilmGamma; value=GetImageProperty(image,"film-gamma"); if (value != (const char *) NULL) - film_gamma=StringToDouble(value); + film_gamma=StringToDouble(value,(char **) NULL); reference_black=ReferenceBlack; value=GetImageProperty(image,"reference-black"); if (value != (const char *) NULL) - reference_black=StringToDouble(value); + reference_black=StringToDouble(value,(char **) NULL); reference_white=ReferenceWhite; value=GetImageProperty(image,"reference-white"); if (value != (const char *) NULL) - reference_white=StringToDouble(value); + reference_white=StringToDouble(value,(char **) NULL); logmap=(Quantum *) AcquireQuantumMemory((size_t) MaxMap+1UL, sizeof(*logmap)); if (logmap == (Quantum *) NULL) @@ -2075,19 +2076,20 @@ MagickExport MagickBooleanType TransformRGBImage(Image *image, gamma=DisplayGamma; value=GetImageProperty(image,"gamma"); if (value != (const char *) NULL) - gamma=1.0/StringToDouble(value) != 0.0 ? StringToDouble(value) : 1.0; + gamma=1.0/StringToDouble(value,(char **) NULL) != 0.0 ? + StringToDouble(value,(char **) NULL) : 1.0; film_gamma=FilmGamma; value=GetImageProperty(image,"film-gamma"); if (value != (const char *) NULL) - film_gamma=StringToDouble(value); + film_gamma=StringToDouble(value,(char **) NULL); reference_black=ReferenceBlack; value=GetImageProperty(image,"reference-black"); if (value != (const char *) NULL) - reference_black=StringToDouble(value); + reference_black=StringToDouble(value,(char **) NULL); reference_white=ReferenceWhite; value=GetImageProperty(image,"reference-white"); if (value != (const char *) NULL) - reference_white=StringToDouble(value); + reference_white=StringToDouble(value,(char **) NULL); logmap=(Quantum *) AcquireQuantumMemory((size_t) MaxMap+1UL, sizeof(*logmap)); if (logmap == (Quantum *) NULL) diff --git a/magick/display.c b/magick/display.c index c96890452..ad31ba6f0 100644 --- a/magick/display.c +++ b/magick/display.c @@ -2105,14 +2105,14 @@ static MagickBooleanType XAnnotateEditImage(Display *display, break; if (entry != 8) { - degrees=StringToDouble(RotateMenu[entry]); + degrees=StringToDouble(RotateMenu[entry],(char **) NULL); break; } (void) XDialogWidget(display,windows,"OK","Enter rotation angle:", angle); if (*angle == '\0') break; - degrees=StringToDouble(angle); + degrees=StringToDouble(angle,(char **) NULL); break; } case AnnotateHelpCommand: @@ -4042,7 +4042,7 @@ static MagickBooleanType XCompositeImage(Display *display, GXinvert); if (*factor == '\0') break; - blend=StringToDouble(factor); + blend=StringToDouble(factor,(char **) NULL); compose=DissolveCompositeOp; break; } @@ -10055,7 +10055,8 @@ static MagickBooleanType XMatteEditImage(Display *display, } draw_info=CloneDrawInfo(resource_info->image_info, (DrawInfo *) NULL); - draw_info->fill.opacity=ClampToQuantum(StringToDouble(matte)); + draw_info->fill.opacity=ClampToQuantum(StringToDouble(matte, + (char **) NULL)); (void) FloodfillPaintImage(*image,OpacityChannel,draw_info,&target, (ssize_t) x_offset,(ssize_t) y_offset, method == FloodfillMethod ? MagickFalse : MagickTrue); diff --git a/magick/distort.c b/magick/distort.c index 5e86b488e..6cbb35375 100644 --- a/magick/distort.c +++ b/magick/distort.c @@ -2075,7 +2075,7 @@ MagickExport Image *DistortImage(const Image *image,DistortImageMethod method, artifact=GetImageArtifact(image,"distort:scale"); output_scaling = 1.0; if (artifact != (const char *) NULL) { - output_scaling = fabs(StringToDouble(artifact)); + output_scaling = fabs(StringToDouble(artifact,(char **) NULL)); geometry.width *= output_scaling; geometry.height *= output_scaling; geometry.x *= output_scaling; diff --git a/magick/draw.c b/magick/draw.c index 0e76778e6..63c30bbf2 100644 --- a/magick/draw.c +++ b/magick/draw.c @@ -1657,7 +1657,7 @@ static inline MagickBooleanType IsPoint(const char *point) double value; - value=strtod(point,&p); + value=StringToDouble(point,&p); return((value == 0.0) && (p == point) ? MagickFalse : MagickTrue); } @@ -1822,27 +1822,27 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("affine",keyword) == 0) { GetMagickToken(q,&q,token); - affine.sx=StringToDouble(token); + affine.sx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.rx=StringToDouble(token); + affine.rx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.ry=StringToDouble(token); + affine.ry=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.sy=StringToDouble(token); + affine.sy=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.tx=StringToDouble(token); + affine.tx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.ty=StringToDouble(token); + affine.ty=StringToDouble(token,(char **) NULL); break; } if (LocaleCompare("arc",keyword) == 0) @@ -2013,7 +2013,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) GetMagickToken(q,&q,token); factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0; graphic_context[n]->fill.opacity=ClampToQuantum((MagickRealType) - QuantumRange*(1.0-factor*StringToDouble(token))); + QuantumRange*(1.0-factor*StringToDouble(token,(char **) NULL))); break; } if (LocaleCompare("fill-rule",keyword) == 0) @@ -2050,7 +2050,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("font-size",keyword) == 0) { GetMagickToken(q,&q,token); - graphic_context[n]->pointsize=StringToDouble(token); + graphic_context[n]->pointsize=StringToDouble(token,(char **) NULL); break; } if (LocaleCompare("font-stretch",keyword) == 0) @@ -2152,13 +2152,13 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("interline-spacing",keyword) == 0) { GetMagickToken(q,&q,token); - graphic_context[n]->interline_spacing=StringToDouble(token); + graphic_context[n]->interline_spacing=StringToDouble(token,(char **) NULL); break; } if (LocaleCompare("interword-spacing",keyword) == 0) { GetMagickToken(q,&q,token); - graphic_context[n]->interword_spacing=StringToDouble(token); + graphic_context[n]->interword_spacing=StringToDouble(token,(char **) NULL); break; } status=MagickFalse; @@ -2170,7 +2170,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("kerning",keyword) == 0) { GetMagickToken(q,&q,token); - graphic_context[n]->kerning=StringToDouble(token); + graphic_context[n]->kerning=StringToDouble(token,(char **) NULL); break; } status=MagickFalse; @@ -2212,7 +2212,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0; graphic_context[n]->opacity=ClampToQuantum((MagickRealType) QuantumRange*(1.0-((1.0-QuantumScale*graphic_context[n]->opacity)* - factor*StringToDouble(token)))); + factor*StringToDouble(token,(char **) NULL)))); graphic_context[n]->fill.opacity=graphic_context[n]->opacity; graphic_context[n]->stroke.opacity=graphic_context[n]->opacity; break; @@ -2315,19 +2315,19 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) GetMagickToken(q,&q,token); (void) CopyMagickString(type,token,MaxTextExtent); GetMagickToken(q,&q,token); - segment.x1=StringToDouble(token); + segment.x1=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - segment.y1=StringToDouble(token); + segment.y1=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - segment.x2=StringToDouble(token); + segment.x2=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - segment.y2=StringToDouble(token); + segment.y2=StringToDouble(token,(char **) NULL); if (LocaleCompare(type,"radial") == 0) { GetMagickToken(q,&q,token); @@ -2377,19 +2377,19 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) GetMagickToken(q,&q,token); (void) CopyMagickString(name,token,MaxTextExtent); GetMagickToken(q,&q,token); - bounds.x=(ssize_t) ceil(StringToDouble(token)-0.5); + bounds.x=(ssize_t) ceil(StringToDouble(token,(char **) NULL)-0.5); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - bounds.y=(ssize_t) ceil(StringToDouble(token)-0.5); + bounds.y=(ssize_t) ceil(StringToDouble(token,(char **) NULL)-0.5); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - bounds.width=(size_t) floor(StringToDouble(token)+0.5); + bounds.width=(size_t) floor(StringToDouble(token,(char **) NULL)+0.5); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - bounds.height=(size_t) floor(StringToDouble(token)+0.5); + bounds.height=(size_t) floor(StringToDouble(token,(char **) NULL)+0.5); for (p=q; *q != '\0'; ) { GetMagickToken(q,&q,token); @@ -2446,7 +2446,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("rotate",keyword) == 0) { GetMagickToken(q,&q,token); - angle=StringToDouble(token); + angle=StringToDouble(token,(char **) NULL); affine.sx=cos(DegreesToRadians(fmod((double) angle,360.0))); affine.rx=sin(DegreesToRadians(fmod((double) angle,360.0))); affine.ry=(-sin(DegreesToRadians(fmod((double) angle,360.0)))); @@ -2467,24 +2467,24 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("scale",keyword) == 0) { GetMagickToken(q,&q,token); - affine.sx=StringToDouble(token); + affine.sx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.sy=StringToDouble(token); + affine.sy=StringToDouble(token,(char **) NULL); break; } if (LocaleCompare("skewX",keyword) == 0) { GetMagickToken(q,&q,token); - angle=StringToDouble(token); + angle=StringToDouble(token,(char **) NULL); affine.ry=sin(DegreesToRadians(angle)); break; } if (LocaleCompare("skewY",keyword) == 0) { GetMagickToken(q,&q,token); - angle=StringToDouble(token); + angle=StringToDouble(token,(char **) NULL); affine.rx=(-tan(DegreesToRadians(angle)/2.0)); break; } @@ -2570,7 +2570,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - graphic_context[n]->dash_pattern[j]=StringToDouble(token); + graphic_context[n]->dash_pattern[j]=StringToDouble(token,(char **) NULL); } if ((x & 0x01) != 0) for ( ; j < (2*x); j++) @@ -2585,7 +2585,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("stroke-dashoffset",keyword) == 0) { GetMagickToken(q,&q,token); - graphic_context[n]->dash_offset=StringToDouble(token); + graphic_context[n]->dash_offset=StringToDouble(token,(char **) NULL); break; } if (LocaleCompare("stroke-linecap",keyword) == 0) @@ -2629,13 +2629,13 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) GetMagickToken(q,&q,token); factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0; graphic_context[n]->stroke.opacity=ClampToQuantum((MagickRealType) - QuantumRange*(1.0-factor*StringToDouble(token))); + QuantumRange*(1.0-factor*StringToDouble(token,(char **) NULL))); break; } if (LocaleCompare("stroke-width",keyword) == 0) { GetMagickToken(q,&q,token); - graphic_context[n]->stroke_width=StringToDouble(token); + graphic_context[n]->stroke_width=StringToDouble(token,(char **) NULL); break; } status=MagickFalse; @@ -2696,11 +2696,11 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("translate",keyword) == 0) { GetMagickToken(q,&q,token); - affine.tx=StringToDouble(token); + affine.tx=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - affine.ty=StringToDouble(token); + affine.ty=StringToDouble(token,(char **) NULL); break; } status=MagickFalse; @@ -2712,23 +2712,23 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("viewbox",keyword) == 0) { GetMagickToken(q,&q,token); - graphic_context[n]->viewbox.x=(ssize_t) ceil(StringToDouble(token)- + graphic_context[n]->viewbox.x=(ssize_t) ceil(StringToDouble(token,(char **) NULL)- 0.5); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - graphic_context[n]->viewbox.y=(ssize_t) ceil(StringToDouble(token)- + graphic_context[n]->viewbox.y=(ssize_t) ceil(StringToDouble(token,(char **) NULL)- 0.5); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); graphic_context[n]->viewbox.width=(size_t) floor( - StringToDouble(token)+0.5); + StringToDouble(token,(char **) NULL)+0.5); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); graphic_context[n]->viewbox.height=(size_t) floor( - StringToDouble(token)+0.5); + StringToDouble(token,(char **) NULL)+0.5); break; } status=MagickFalse; @@ -2776,11 +2776,11 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) if (IsPoint(q) == MagickFalse) break; GetMagickToken(q,&q,token); - point.x=StringToDouble(token); + point.x=StringToDouble(token,(char **) NULL); GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - point.y=StringToDouble(token); + point.y=StringToDouble(token,(char **) NULL); GetMagickToken(q,(const char **) NULL,token); if (*token == ',') GetMagickToken(q,&q,token); @@ -2862,7 +2862,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) double value; - value=strtod(s,&t); + value=StringToDouble(s,&t); (void) value; if (s == t) { @@ -4759,14 +4759,14 @@ MagickExport void GetDrawInfo(const ImageInfo *image_info,DrawInfo *draw_info) (void) CloneString(&draw_info->encoding,option); option=GetImageOption(clone_info,"kerning"); if (option != (const char *) NULL) - draw_info->kerning=StringToDouble(option); + draw_info->kerning=StringToDouble(option,(char **) NULL); option=GetImageOption(clone_info,"interline-spacing"); if (option != (const char *) NULL) - draw_info->interline_spacing=StringToDouble(option); + draw_info->interline_spacing=StringToDouble(option,(char **) NULL); draw_info->direction=UndefinedDirection; option=GetImageOption(clone_info,"interword-spacing"); if (option != (const char *) NULL) - draw_info->interword_spacing=StringToDouble(option); + draw_info->interword_spacing=StringToDouble(option,(char **) NULL); option=GetImageOption(clone_info,"direction"); if (option != (const char *) NULL) draw_info->direction=(DirectionType) ParseCommandOption( @@ -4779,7 +4779,7 @@ MagickExport void GetDrawInfo(const ImageInfo *image_info,DrawInfo *draw_info) (void) QueryColorDatabase(option,&draw_info->stroke,exception); option=GetImageOption(clone_info,"strokewidth"); if (option != (const char *) NULL) - draw_info->stroke_width=StringToDouble(option); + draw_info->stroke_width=StringToDouble(option,(char **) NULL); option=GetImageOption(clone_info,"undercolor"); if (option != (const char *) NULL) (void) QueryColorDatabase(option,&draw_info->undercolor,exception); @@ -5256,15 +5256,15 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - arc.x=StringToDouble(token); + arc.x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - arc.y=StringToDouble(token); + arc.y=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - angle=StringToDouble(token); + angle=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); @@ -5276,11 +5276,11 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - x=StringToDouble(token); + x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - y=StringToDouble(token); + y=StringToDouble(token,(char **) NULL); end.x=(double) (attribute == (int) 'A' ? x : point.x+x); end.y=(double) (attribute == (int) 'A' ? y : point.y+y); TraceArcPath(q,point,end,arc,angle,large_arc,sweep); @@ -5303,11 +5303,11 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - x=StringToDouble(token); + x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - y=StringToDouble(token); + y=StringToDouble(token,(char **) NULL); end.x=(double) (attribute == (int) 'C' ? x : point.x+x); end.y=(double) (attribute == (int) 'C' ? y : point.y+y); points[i]=end; @@ -5328,7 +5328,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - x=StringToDouble(token); + x=StringToDouble(token,(char **) NULL); point.x=(double) (attribute == (int) 'H' ? x: point.x+x); TracePoint(q,point); q+=q->coordinates; @@ -5343,11 +5343,11 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - x=StringToDouble(token); + x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - y=StringToDouble(token); + y=StringToDouble(token,(char **) NULL); point.x=(double) (attribute == (int) 'L' ? x : point.x+x); point.y=(double) (attribute == (int) 'L' ? y : point.y+y); TracePoint(q,point); @@ -5370,11 +5370,11 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - x=StringToDouble(token); + x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - y=StringToDouble(token); + y=StringToDouble(token,(char **) NULL); point.x=(double) (attribute == (int) 'M' ? x : point.x+x); point.y=(double) (attribute == (int) 'M' ? y : point.y+y); if (i == 0) @@ -5404,11 +5404,11 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - x=StringToDouble(token); + x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - y=StringToDouble(token); + y=StringToDouble(token,(char **) NULL); if (*p == ',') p++; end.x=(double) (attribute == (int) 'Q' ? x : point.x+x); @@ -5439,11 +5439,11 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - x=StringToDouble(token); + x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - y=StringToDouble(token); + y=StringToDouble(token,(char **) NULL); if (*p == ',') p++; end.x=(double) (attribute == (int) 'S' ? x : point.x+x); @@ -5479,11 +5479,11 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - x=StringToDouble(token); + x=StringToDouble(token,(char **) NULL); GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - y=StringToDouble(token); + y=StringToDouble(token,(char **) NULL); end.x=(double) (attribute == (int) 'T' ? x : point.x+x); end.y=(double) (attribute == (int) 'T' ? y : point.y+y); points[i]=end; @@ -5509,7 +5509,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - y=StringToDouble(token); + y=StringToDouble(token,(char **) NULL); point.y=(double) (attribute == (int) 'V' ? y : point.y+y); TracePoint(q,point); q+=q->coordinates; diff --git a/magick/enhance.c b/magick/enhance.c index ac1ab4c5a..81732adde 100644 --- a/magick/enhance.c +++ b/magick/enhance.c @@ -454,9 +454,9 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image, GetMagickToken(p,&p,token); switch (i) { - case 0: color_correction.red.slope=StringToDouble(token); break; - case 1: color_correction.green.slope=StringToDouble(token); break; - case 2: color_correction.blue.slope=StringToDouble(token); break; + case 0: color_correction.red.slope=StringToDouble(token,(char **) NULL); break; + case 1: color_correction.green.slope=StringToDouble(token,(char **) NULL); break; + case 2: color_correction.blue.slope=StringToDouble(token,(char **) NULL); break; } } } @@ -472,9 +472,9 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image, GetMagickToken(p,&p,token); switch (i) { - case 0: color_correction.red.offset=StringToDouble(token); break; - case 1: color_correction.green.offset=StringToDouble(token); break; - case 2: color_correction.blue.offset=StringToDouble(token); break; + case 0: color_correction.red.offset=StringToDouble(token,(char **) NULL); break; + case 1: color_correction.green.offset=StringToDouble(token,(char **) NULL); break; + case 2: color_correction.blue.offset=StringToDouble(token,(char **) NULL); break; } } } @@ -490,9 +490,9 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image, GetMagickToken(p,&p,token); switch (i) { - case 0: color_correction.red.power=StringToDouble(token); break; - case 1: color_correction.green.power=StringToDouble(token); break; - case 2: color_correction.blue.power=StringToDouble(token); break; + case 0: color_correction.red.power=StringToDouble(token,(char **) NULL); break; + case 1: color_correction.green.power=StringToDouble(token,(char **) NULL); break; + case 2: color_correction.blue.power=StringToDouble(token,(char **) NULL); break; } } } @@ -509,7 +509,7 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image, content=GetXMLTreeContent(saturation); p=(const char *) content; GetMagickToken(p,&p,token); - color_correction.saturation=StringToDouble(token); + color_correction.saturation=StringToDouble(token,(char **) NULL); } } ccc=DestroyXMLTree(ccc); diff --git a/magick/fx.c b/magick/fx.c index f9f142c16..1dc1e18f9 100644 --- a/magick/fx.c +++ b/magick/fx.c @@ -340,7 +340,7 @@ MagickExport Image *AddNoiseImageChannel(const Image *image, attenuate=1.0; option=GetImageArtifact(image,"attenuate"); if (option != (char *) NULL) - attenuate=StringToDouble(option); + attenuate=StringToDouble(option,(char **) NULL); status=MagickTrue; progress=0; random_info=AcquireRandomInfoThreadSet(); @@ -1165,7 +1165,7 @@ static MagickRealType FxChannelStatistics(FxInfo *fx_info,const Image *image, (double) channel,symbol); value=(const char *) GetValueFromSplayTree(fx_info->symbols,key); if (value != (const char *) NULL) - return(QuantumScale*StringToDouble(value)); + return(QuantumScale*StringToDouble(value,(char **) NULL)); (void) DeleteNodeFromSplayTree(fx_info->symbols,key); if (LocaleNCompare(symbol,"depth",5) == 0) { @@ -1237,7 +1237,7 @@ static MagickRealType FxChannelStatistics(FxInfo *fx_info,const Image *image, } (void) AddValueToSplayTree(fx_info->symbols,ConstantString(key), ConstantString(statistic)); - return(QuantumScale*StringToDouble(statistic)); + return(QuantumScale*StringToDouble(statistic,(char **) NULL)); } static MagickRealType @@ -1849,7 +1849,7 @@ static MagickRealType FxGetSymbol(FxInfo *fx_info,const ChannelType channel, } value=(const char *) GetValueFromSplayTree(fx_info->symbols,symbol); if (value != (const char *) NULL) - return((MagickRealType) StringToDouble(value)); + return((MagickRealType) StringToDouble(value,(char **) NULL)); (void) ThrowMagickException(exception,GetMagickModule(),OptionError, "UnableToParseExpression","`%s'",symbol); return(0.0); @@ -2777,7 +2777,7 @@ static MagickRealType FxEvaluateSubexpression(FxInfo *fx_info, break; } q=(char *) expression; - alpha=strtod(expression,&q); + alpha=StringToDouble(expression,&q); if (q == expression) return(FxGetSymbol(fx_info,channel,x,y,expression,exception)); return(alpha); diff --git a/magick/geometry.c b/magick/geometry.c index e5f93b719..e75303ab3 100644 --- a/magick/geometry.c +++ b/magick/geometry.c @@ -188,7 +188,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x, if (*p == '\0') return(flags); q=p; - value=strtod(p,&q); + value=StringToDouble(p,&q); (void) value; if (LocaleNCompare(p,"0x",2) == 0) value=(double) strtol(p,&q,10); @@ -201,7 +201,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x, if (LocaleNCompare(p,"0x",2) == 0) *width=(size_t) strtol(p,&p,10); else - *width=(size_t) floor(strtod(p,&p)+0.5); + *width=(size_t) floor(StringToDouble(p,&p)+0.5); if (p != q) flags|=WidthValue; } @@ -214,7 +214,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x, Parse height. */ q=p; - *height=(size_t) floor(strtod(p,&p)+0.5); + *height=(size_t) floor(StringToDouble(p,&p)+0.5); if (p != q) flags|=HeightValue; } @@ -227,7 +227,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x, if (*p == '-') flags|=XNegative; q=p; - *x=(ssize_t) ceil(strtod(p,&p)-0.5); + *x=(ssize_t) ceil(StringToDouble(p,&p)-0.5); if (p != q) flags|=XValue; if ((*p == '+') || (*p == '-')) @@ -238,7 +238,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x, if (*p == '-') flags|=YNegative; q=p; - *y=(ssize_t) ceil(strtod(p,&p)-0.5); + *y=(ssize_t) ceil(StringToDouble(p,&p)-0.5); if (p != q) flags|=YValue; } @@ -553,7 +553,7 @@ MagickExport MagickBooleanType IsSceneGeometry(const char *geometry, if (geometry == (const char *) NULL) return(MagickFalse); p=(char *) geometry; - value=strtod(geometry,&p); + value=StringToDouble(geometry,&p); (void) value; if (p == geometry) return(MagickFalse); @@ -662,12 +662,12 @@ MagickExport MagickStatusType ParseAffineGeometry(const char *geometry, GetMagickToken(p,&p,token); switch (i) { - case 0: affine_matrix->sx=StringToDouble(token); break; - case 1: affine_matrix->rx=StringToDouble(token); break; - case 2: affine_matrix->ry=StringToDouble(token); break; - case 3: affine_matrix->sy=StringToDouble(token); break; - case 4: affine_matrix->tx=StringToDouble(token); flags|=XValue; break; - case 5: affine_matrix->ty=StringToDouble(token); flags|=YValue; break; + case 0: affine_matrix->sx=StringToDouble(token,(char **) NULL); break; + case 1: affine_matrix->rx=StringToDouble(token,(char **) NULL); break; + case 2: affine_matrix->ry=StringToDouble(token,(char **) NULL); break; + case 3: affine_matrix->sy=StringToDouble(token,(char **) NULL); break; + case 4: affine_matrix->tx=StringToDouble(token,(char **) NULL); flags|=XValue; break; + case 5: affine_matrix->ty=StringToDouble(token,(char **) NULL); flags|=YValue; break; } } determinant=(affine_matrix->sx*affine_matrix->sy-affine_matrix->rx* @@ -824,7 +824,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, if (*p == '\0') return(flags); q=p; - value=strtod(p,&q); + value=StringToDouble(p,&q); if (LocaleNCompare(p,"0x",2) == 0) value=(double) strtol(p,&q,10); if ((((int) *q) == -41) || (*q == 'x') || (*q == 'X') || (*q == ',') || @@ -837,7 +837,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, if (LocaleNCompare(p,"0x",2) == 0) value=(double) strtol(p,&p,10); else - value=strtod(p,&p); + value=StringToDouble(p,&p); if (p != q) { flags|=RhoValue; @@ -858,7 +858,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, ((*p != '+') && (*p != '-'))) { q=p; - value=strtod(p,&p); + value=StringToDouble(p,&p); if (p != q) { flags|=SigmaValue; @@ -876,7 +876,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, if ((*p == ',') || (*p == '/') || (*p == ':')) p++; q=p; - value=strtod(p,&p); + value=StringToDouble(p,&p); if (p != q) { flags|=XiValue; @@ -895,7 +895,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, if ((*p == ',') || (*p == '/') || (*p == ':')) p++; q=p; - value=strtod(p,&p); + value=StringToDouble(p,&p); if (p != q) { flags|=PsiValue; @@ -915,7 +915,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, if ((*p == ',') || (*p == '/') || (*p == ':')) p++; q=p; - value=strtod(p,&p); + value=StringToDouble(p,&p); if (p != q) { flags|=ChiValue; diff --git a/magick/morphology.c b/magick/morphology.c index 351d31bab..db3175c8a 100644 --- a/magick/morphology.c +++ b/magick/morphology.c @@ -329,7 +329,7 @@ static KernelInfo *ParseKernelArray(const char *kernel_string) kernel->values[i] = nan; /* do not include this value in kernel */ } else { - kernel->values[i] = StringToDouble(token); + kernel->values[i] = StringToDouble(token,(char **) NULL); ( kernel->values[i] < 0) ? ( kernel->negative_range += kernel->values[i] ) : ( kernel->positive_range += kernel->values[i] ); diff --git a/magick/quantum.c b/magick/quantum.c index 3b8754b5a..cf84a4288 100644 --- a/magick/quantum.c +++ b/magick/quantum.c @@ -372,10 +372,10 @@ MagickExport void GetQuantumInfo(const ImageInfo *image_info, MagickQuantumFormatOptions,MagickFalse,option); option=GetImageOption(image_info,"quantum:minimum"); if (option != (char *) NULL) - quantum_info->minimum=StringToDouble(option); + quantum_info->minimum=StringToDouble(option,(char **) NULL); option=GetImageOption(image_info,"quantum:maximum"); if (option != (char *) NULL) - quantum_info->maximum=StringToDouble(option); + quantum_info->maximum=StringToDouble(option,(char **) NULL); if ((quantum_info->minimum == 0.0) && (quantum_info->maximum == 0.0)) quantum_info->scale=0.0; else @@ -389,7 +389,7 @@ MagickExport void GetQuantumInfo(const ImageInfo *image_info, quantum_info->minimum); option=GetImageOption(image_info,"quantum:scale"); if (option != (char *) NULL) - quantum_info->scale=StringToDouble(option); + quantum_info->scale=StringToDouble(option,(char **) NULL); option=GetImageOption(image_info,"quantum:polarity"); if (option != (char *) NULL) quantum_info->min_is_white=LocaleCompare(option,"min-is-white") == 0 ? diff --git a/magick/resize.c b/magick/resize.c index a9feced0c..84ecaa6bd 100644 --- a/magick/resize.c +++ b/magick/resize.c @@ -922,7 +922,7 @@ MagickExport ResizeFilter *AcquireResizeFilter(const Image *image, /* User Sigma Override - no support change */ artifact=GetImageArtifact(image,"filter:sigma"); if (artifact != (const char *) NULL) - sigma=StringToDouble(artifact); + sigma=StringToDouble(artifact,(char **) NULL); /* Define coefficents for Gaussian */ if ( GaussianFilter ) { resize_filter->coefficient[0]=1.0/(2.0*sigma*sigma); @@ -933,7 +933,7 @@ MagickExport ResizeFilter *AcquireResizeFilter(const Image *image, /* Blur Override */ artifact=GetImageArtifact(image,"filter:blur"); if (artifact != (const char *) NULL) - resize_filter->blur *= StringToDouble(artifact); + resize_filter->blur *= StringToDouble(artifact,(char **) NULL); if (resize_filter->blur < MagickEpsilon) resize_filter->blur=(MagickRealType) MagickEpsilon; @@ -960,7 +960,7 @@ MagickExport ResizeFilter *AcquireResizeFilter(const Image *image, /* expert override of the support setting */ artifact=GetImageArtifact(image,"filter:support"); if (artifact != (const char *) NULL) - resize_filter->support=fabs(StringToDouble(artifact)); + resize_filter->support=fabs(StringToDouble(artifact,(char **) NULL)); /* Scale windowing function separatally to the support 'clipping' window that calling operator is planning to actually use. (Expert @@ -969,7 +969,7 @@ MagickExport ResizeFilter *AcquireResizeFilter(const Image *image, resize_filter->window_support=resize_filter->support; /* default */ artifact=GetImageArtifact(image,"filter:win-support"); if (artifact != (const char *) NULL) - resize_filter->window_support=fabs(StringToDouble(artifact)); + resize_filter->window_support=fabs(StringToDouble(artifact,(char **) NULL)); /* Adjust window function scaling to match windowing support for weighting function. This avoids a division on every filter call. @@ -994,18 +994,18 @@ MagickExport ResizeFilter *AcquireResizeFilter(const Image *image, artifact=GetImageArtifact(image,"filter:b"); if (artifact != (const char *) NULL) { - B=StringToDouble(artifact); + B=StringToDouble(artifact,(char **) NULL); C=(1.0-B)/2.0; /* Calculate C to get a Keys cubic filter. */ artifact=GetImageArtifact(image,"filter:c"); /* user C override */ if (artifact != (const char *) NULL) - C=StringToDouble(artifact); + C=StringToDouble(artifact,(char **) NULL); } else { artifact=GetImageArtifact(image,"filter:c"); if (artifact != (const char *) NULL) { - C=StringToDouble(artifact); + C=StringToDouble(artifact,(char **) NULL); B=1.0-2.0*C; /* Calculate B to get a Keys cubic filter. */ } } diff --git a/magick/string-private.h b/magick/string-private.h index ebe214a03..6b92dd0b6 100644 --- a/magick/string-private.h +++ b/magick/string-private.h @@ -31,7 +31,7 @@ static inline double SiPrefixToDouble(const char *string,const double interval) scale, value; - value=strtod(string,&q); + value=StringToDouble(string,&q); scale=1000.0; if ((*q != '\0') && (tolower((int) ((unsigned char) *(q+1))) == 'i')) scale=1024.0; @@ -51,11 +51,6 @@ static inline double SiPrefixToDouble(const char *string,const double interval) return(value); } -static inline double StringToDouble(const char *value) -{ - return(strtod(value,(char **) NULL)); -} - static inline int StringToInteger(const char *value) { return((int) strtol(value,(char **) NULL,10)); diff --git a/magick/string.c b/magick/string.c index 70322f26a..e91d98771 100644 --- a/magick/string.c +++ b/magick/string.c @@ -1977,6 +1977,37 @@ MagickExport char **StringToArgv(const char *text,int *argc) % % % % % % +% S t r i n g T o D o u b l e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% StringToDouble() returns the contents of a file as a string. +% +% The format of the StringToDouble method is: +% +% double StringToDouble(const char *value,char **sentinal) +% +% A description of each parameter follows: +% +% o value: the string value. +% +% o sentinal: if sentinal is not NULL, a pointer to the character after the +% last character used in the conversion is stored in the location +% referenced by sentinal. +% +*/ +MagickExport double StringToDouble(const char *value,char **sentinal) +{ + return(strtod(value,sentinal)); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % S t r i n g I n f o T o H e x S t r i n g % % % % % diff --git a/magick/string_.h b/magick/string_.h index a2f9c3569..3787e4709 100644 --- a/magick/string_.h +++ b/magick/string_.h @@ -57,6 +57,9 @@ extern MagickExport char extern MagickExport const char *GetStringInfoPath(const StringInfo *); +extern MagickExport double + StringToDouble(const char *,char **); + extern MagickExport int CompareStringInfo(const StringInfo *,const StringInfo *), LocaleCompare(const char *,const char *), diff --git a/magick/token.c b/magick/token.c index d318470e9..5cb89da3f 100644 --- a/magick/token.c +++ b/magick/token.c @@ -46,6 +46,7 @@ #include "magick/image.h" #include "magick/memory_.h" #include "magick/string_.h" +#include "magick/string-private.h" #include "magick/token.h" #include "magick/token-private.h" #include "magick/utility.h" @@ -228,7 +229,7 @@ MagickExport void GetMagickToken(const char *start,const char **end,char *token) char *q; - value=strtod(p,&q); + value=StringToDouble(p,&q); (void) value; if ((p != q) && (*p != ',')) { diff --git a/wand/animate.c b/wand/animate.c index 1403ba758..bc97adaef 100644 --- a/wand/animate.c +++ b/wand/animate.c @@ -1004,7 +1004,7 @@ WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowAnimateException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowAnimateInvalidArgumentException(option,argv[i]); diff --git a/wand/compare.c b/wand/compare.c index f1cdd3f18..a3685a436 100644 --- a/wand/compare.c +++ b/wand/compare.c @@ -531,7 +531,7 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, if (*option == '+') dissimilarity_threshold=DefaultDissimilarityThreshold; else - dissimilarity_threshold=StringToDouble(argv[i]); + dissimilarity_threshold=StringToDouble(argv[i],(char **) NULL); break; } if (LocaleCompare("duration",option+1) == 0) @@ -661,7 +661,7 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowCompareException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowCompareInvalidArgumentException(option,argv[i]); diff --git a/wand/composite.c b/wand/composite.c index c75d3fe12..8761f1744 100644 --- a/wand/composite.c +++ b/wand/composite.c @@ -1131,7 +1131,7 @@ WandExport MagickBooleanType CompositeImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowCompositeException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowCompositeInvalidArgumentException(option,argv[i]); diff --git a/wand/convert.c b/wand/convert.c index 302fb86cc..e2f6c156f 100644 --- a/wand/convert.c +++ b/wand/convert.c @@ -1847,7 +1847,7 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowConvertException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowConvertInvalidArgumentException(option,argv[i]); diff --git a/wand/display.c b/wand/display.c index a466c9469..a63b3c6f3 100644 --- a/wand/display.c +++ b/wand/display.c @@ -1310,7 +1310,7 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowDisplayException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowDisplayInvalidArgumentException(option,argv[i]); @@ -1844,7 +1844,7 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowDisplayException(OptionError,"MissingArgument",option); - if (strtod(argv[i],(char **) NULL) != 0) + if (StringToDouble(argv[i],(char **) NULL) != 0) resource_info.window_group=argv[i]; break; } diff --git a/wand/drawing-wand.c b/wand/drawing-wand.c index 29511cc9a..108a98cd0 100644 --- a/wand/drawing-wand.c +++ b/wand/drawing-wand.c @@ -6222,7 +6222,7 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand, value=GetXMLTreeContent(child); if (value != (const char *) NULL) CurrentContext->fill.opacity=ClampToQuantum((MagickRealType) - QuantumRange*(1.0-StringToDouble(value))); + QuantumRange*(1.0-StringToDouble(value,(char **) NULL))); } child=GetXMLTreeChild(xml_info,"fill-rule"); if (child != (XMLTreeInfo *) NULL) @@ -6243,7 +6243,7 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand, { value=GetXMLTreeContent(child); if (value != (const char *) NULL) - CurrentContext->pointsize=StringToDouble(value); + CurrentContext->pointsize=StringToDouble(value,(char **) NULL); } child=GetXMLTreeChild(xml_info,"font-stretch"); if (child != (XMLTreeInfo *) NULL) @@ -6339,7 +6339,7 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand, GetMagickToken(q,&q,token); if (*token == ',') GetMagickToken(q,&q,token); - CurrentContext->dash_pattern[j]=StringToDouble(token); + CurrentContext->dash_pattern[j]=StringToDouble(token,(char **) NULL); } if ((x & 0x01) != 0) for ( ; j < (2*x); j++) @@ -6354,7 +6354,7 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand, { value=GetXMLTreeContent(child); if (value != (const char *) NULL) - CurrentContext->dash_offset=StringToDouble(value); + CurrentContext->dash_offset=StringToDouble(value,(char **) NULL); } child=GetXMLTreeChild(xml_info,"stroke-linecap"); if (child != (XMLTreeInfo *) NULL) @@ -6385,14 +6385,14 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand, value=GetXMLTreeContent(child); if (value != (const char *) NULL) CurrentContext->stroke.opacity=ClampToQuantum((MagickRealType) - QuantumRange*(1.0-StringToDouble(value))); + QuantumRange*(1.0-StringToDouble(value,(char **) NULL))); } child=GetXMLTreeChild(xml_info,"stroke-width"); if (child != (XMLTreeInfo *) NULL) { value=GetXMLTreeContent(child); if (value != (const char *) NULL) - CurrentContext->stroke_width=StringToDouble(value); + CurrentContext->stroke_width=StringToDouble(value,(char **) NULL); } child=GetXMLTreeChild(xml_info,"text-align"); if (child != (XMLTreeInfo *) NULL) diff --git a/wand/identify.c b/wand/identify.c index 2a0015782..a71e4c6b1 100644 --- a/wand/identify.c +++ b/wand/identify.c @@ -637,7 +637,7 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowIdentifyException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowIdentifyInvalidArgumentException(option,argv[i]); diff --git a/wand/import.c b/wand/import.c index 42f82974a..decefa918 100644 --- a/wand/import.c +++ b/wand/import.c @@ -942,7 +942,7 @@ WandExport MagickBooleanType ImportImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowImportException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowImportInvalidArgumentException(option,argv[i]); diff --git a/wand/magick-property.c b/wand/magick-property.c index 77d105d06..e090309dd 100644 --- a/wand/magick-property.c +++ b/wand/magick-property.c @@ -1538,7 +1538,7 @@ WandExport double *MagickGetSamplingFactors(MagickWand *wand, while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ','))) p++; - sampling_factors[i]=StringToDouble(p); + sampling_factors[i]=StringToDouble(p,(char **) NULL); i++; } *number_factors=(size_t) i; diff --git a/wand/mogrify.c b/wand/mogrify.c index 6be9a7008..1df9691d7 100644 --- a/wand/mogrify.c +++ b/wand/mogrify.c @@ -149,7 +149,7 @@ WandExport MagickBooleanType MagickCommandGenesis(ImageInfo *image_info, if (LocaleCompare("debug",option+1) == 0) (void) SetLogEventMask(argv[++i]); if (LocaleCompare("duration",option+1) == 0) - duration=StringToDouble(argv[++i]); + duration=StringToDouble(argv[++i],(char **) NULL); if (LocaleCompare("regard-warnings",option+1) == 0) regard_warnings=MagickTrue; } @@ -511,7 +511,7 @@ static Image *SparseColorOption(const Image *image,const ChannelType channel, error = MagickTrue; break; } - sparse_arguments[x++]=StringToDouble(token); + sparse_arguments[x++]=StringToDouble(token,(char **) NULL); /* Y coordinate */ token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,token); if ( token[0] == '\0' ) break; @@ -522,7 +522,7 @@ static Image *SparseColorOption(const Image *image,const ChannelType channel, error = MagickTrue; break; } - sparse_arguments[x++]=StringToDouble(token); + sparse_arguments[x++]=StringToDouble(token,(char **) NULL); /* color values for this control point */ #if 0 if ( (color_from_image ) { @@ -556,35 +556,35 @@ static Image *SparseColorOption(const Image *image,const ChannelType channel, while ( token[0] == ',' ) GetMagickToken(p,&p,token); if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' ) break; - sparse_arguments[x++]=StringToDouble(token); + sparse_arguments[x++]=StringToDouble(token,(char **) NULL); token[0] = ','; /* used this token - get another */ } if ( channels & GreenChannel ) { while ( token[0] == ',' ) GetMagickToken(p,&p,token); if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' ) break; - sparse_arguments[x++]=StringToDouble(token); + sparse_arguments[x++]=StringToDouble(token,(char **) NULL); token[0] = ','; /* used this token - get another */ } if ( channels & BlueChannel ) { while ( token[0] == ',' ) GetMagickToken(p,&p,token); if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' ) break; - sparse_arguments[x++]=StringToDouble(token); + sparse_arguments[x++]=StringToDouble(token,(char **) NULL); token[0] = ','; /* used this token - get another */ } if ( channels & IndexChannel ) { while ( token[0] == ',' ) GetMagickToken(p,&p,token); if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' ) break; - sparse_arguments[x++]=StringToDouble(token); + sparse_arguments[x++]=StringToDouble(token,(char **) NULL); token[0] = ','; /* used this token - get another */ } if ( channels & OpacityChannel ) { while ( token[0] == ',' ) GetMagickToken(p,&p,token); if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' ) break; - sparse_arguments[x++]=StringToDouble(token); + sparse_arguments[x++]=StringToDouble(token,(char **) NULL); token[0] = ','; /* used this token - get another */ } } @@ -1392,7 +1392,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - arguments[x]=StringToDouble(token); + arguments[x]=StringToDouble(token,(char **) NULL); } args=DestroyString(args); mogrify_image=DistortImage(*image,method,number_arguments,arguments, @@ -1697,7 +1697,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, GetMagickToken(p,&p,token); if (*token == ',') GetMagickToken(p,&p,token); - parameters[x]=StringToDouble(token); + parameters[x]=StringToDouble(token,(char **) NULL); } arguments=DestroyString(arguments); (void) FunctionImageChannel(*image,channel,function, @@ -1716,14 +1716,14 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, */ (void) SyncImageSettings(mogrify_info,*image); if (*option == '+') - (*image)->gamma=StringToDouble(argv[i+1]); + (*image)->gamma=StringToDouble(argv[i+1],(char **) NULL); else { if (strchr(argv[i+1],',') != (char *) NULL) (void) GammaImage(*image,argv[i+1]); else (void) GammaImageChannel(*image,channel, - StringToDouble(argv[i+1])); + StringToDouble(argv[i+1],(char **) NULL)); InheritException(exception,&(*image)->exception); } break; @@ -1968,7 +1968,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, } if (LocaleCompare("linewidth",option+1) == 0) { - draw_info->stroke_width=StringToDouble(argv[i+1]); + draw_info->stroke_width=StringToDouble(argv[i+1],(char **) NULL); break; } if (LocaleCompare("liquid-rescale",option+1) == 0) @@ -2389,7 +2389,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, */ (void) SyncImageSettings(mogrify_info,*image); mogrify_image=RadialBlurImageChannel(*image,channel, - StringToDouble(argv[i+1]),exception); + StringToDouble(argv[i+1],(char **) NULL),exception); break; } if (LocaleCompare("raise",option+1) == 0) @@ -2880,7 +2880,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, } if (LocaleCompare("strokewidth",option+1) == 0) { - draw_info->stroke_width=StringToDouble(argv[i+1]); + draw_info->stroke_width=StringToDouble(argv[i+1],(char **) NULL); break; } if (LocaleCompare("style",option+1) == 0) @@ -4922,7 +4922,7 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowMogrifyException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowMogrifyInvalidArgumentException(option,argv[i]); diff --git a/wand/montage.c b/wand/montage.c index 48b5cabc3..6235350a1 100644 --- a/wand/montage.c +++ b/wand/montage.c @@ -1134,7 +1134,7 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowMontageException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowMontageInvalidArgumentException(option,argv[i]); @@ -1279,7 +1279,7 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info, ThrowMontageException(OptionError,"MissingArgument",option); if (IsGeometry(argv[i]) == MagickFalse) ThrowMontageInvalidArgumentException(option,argv[i]); - montage_info->pointsize=StringToDouble(argv[i]); + montage_info->pointsize=StringToDouble(argv[i],(char **) NULL); break; } if (LocaleCompare("polaroid",option+1) == 0) diff --git a/wand/stream.c b/wand/stream.c index 1f4c490be..4f48ce9e5 100644 --- a/wand/stream.c +++ b/wand/stream.c @@ -545,7 +545,7 @@ WandExport MagickBooleanType StreamImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowStreamException(OptionError,"MissingArgument",option); - value=strtod(argv[i],&p); + value=StringToDouble(argv[i],&p); (void) value; if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) ThrowStreamInvalidArgumentException(option,argv[i]); -- 2.40.0