From: dirk Date: Sat, 25 Jul 2015 16:51:01 +0000 (+0000) Subject: Renamed IsStringNotFalse to IsStringFalse and changed the implementation. X-Git-Tag: 7.0.1-0~757 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a846de2088aabf3d58a275d2157b40c53d8597d;p=imagemagick Renamed IsStringNotFalse to IsStringFalse and changed the implementation. --- diff --git a/MagickCore/magick-type.h b/MagickCore/magick-type.h index 0def0727c..da553bd3d 100644 --- a/MagickCore/magick-type.h +++ b/MagickCore/magick-type.h @@ -180,7 +180,6 @@ typedef enum # define IsMagickNot(v) (IfMagickTrue(v)?MagickFalse:MagickTrue) #endif #define IfStringTrue(v) IfMagickTrue(IsStringTrue(v)) -#define IfStringNotFalse(v) IfMagickTrue(IsStringNotFalse(v)) #define IsMagickNULL(v) (((void *)(v) == NULL)?MagickTrue:MagickFalse) #define IsMagickNotNULL(v) (((void *)(v) != NULL)?MagickTrue:MagickFalse) diff --git a/MagickCore/string.c b/MagickCore/string.c index 0160c0413..b82fa8418 100644 --- a/MagickCore/string.c +++ b/MagickCore/string.c @@ -1469,41 +1469,40 @@ MagickExport MagickBooleanType IsStringTrue(const char *value) % % % % % % -% I s S t r i n g N o t F a l s e % +% I s S t r i n g F a l s e % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% IsStringNotFalse() returns MagickTrue, unless the string specifically -% has a value that makes this false. that is if it has a value of -% "false", "off", "no" or "0". +% IsStringFalse() returns MagickTrue if the value is "false", "off", "no" or +% "0". Any other string or undefined returns MagickFalse. % % Typically this is used to look at strings (options or artifacts) which % has a default value of "true", when it has not been defined. % -% The format of the IsStringNotFalse method is: +% The format of the IsStringFalse method is: % -% MagickBooleanType IsStringNotFalse(const char *value) +% MagickBooleanType IsStringFalse(const char *value) % % A description of each parameter follows: % % o value: Specifies a pointer to a character array. % */ -MagickExport MagickBooleanType IsStringNotFalse(const char *value) +MagickExport MagickBooleanType IsStringFalse(const char *value) { if (value == (const char *) NULL) - return(MagickTrue); - if (LocaleCompare(value,"false") == 0) return(MagickFalse); + if (LocaleCompare(value,"false") == 0) + return(MagickTrue); if (LocaleCompare(value,"off") == 0) - return(MagickFalse); + return(MagickTrue); if (LocaleCompare(value,"no") == 0) - return(MagickFalse); + return(MagickTrue); if (LocaleCompare(value,"0") == 0) - return(MagickFalse); - return(MagickTrue); + return(MagickTrue); + return(MagickFalse); } /* diff --git a/MagickCore/string_.h b/MagickCore/string_.h index 921718797..18bc6e599 100644 --- a/MagickCore/string_.h +++ b/MagickCore/string_.h @@ -67,7 +67,7 @@ extern MagickExport int extern MagickExport MagickBooleanType ConcatenateString(char **,const char *), IsStringTrue(const char *), - IsStringNotFalse(const char *), + IsStringFalse(const char *), SubstituteString(char **,const char *,const char *); extern MagickExport size_t diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 8003e154d..7a4498933 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -7797,10 +7797,9 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, else clip_to_self=IsStringTrue(GetImageOption(mogrify_info, "compose:clip-to-self")); /* if this is true */ - if (IsMagickFalse(clip_to_self)) /* or */ - clip_to_self=IfMagickFalse(IsStringNotFalse(GetImageOption( - mogrify_info,"compose:outside-overlay"))) ? MagickTrue : - MagickFalse; /* this false */ + if (clip_to_self == MagickFalse) /* or */ + clip_to_self=IsStringFalse(GetImageOption(mogrify_info, + "compose:outside-overlay")); image=RemoveFirstImageFromList(images); composite_image=RemoveFirstImageFromList(images); if (composite_image == (Image *) NULL) diff --git a/MagickWand/operation.c b/MagickWand/operation.c index 76b3da60f..fc8dd30cc 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -3823,7 +3823,7 @@ WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand, value=GetImageOption(_image_info,"compose:outside-overlay"); if (value != (const char *) NULL) { /* or this false */ /* FUTURE: depreciate warning for "compose:outside-overlay"*/ - clip_to_self= IsMagickFalse(IsStringNotFalse(value)); + clip_to_self=IsStringFalse(value); } new_images=RemoveFirstImageFromList(&_images); diff --git a/coders/tiff.c b/coders/tiff.c index 468b9ee01..b39db42ee 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -1281,7 +1281,7 @@ RestoreMSCWarning TIFFGetProfiles(tiff,image,image_info->ping,exception); TIFFGetProperties(tiff,image,exception); option=GetImageOption(image_info,"tiff:exif-properties"); - if (IfMagickTrue(IsStringNotFalse(option))) /* enabled by default */ + if (IsStringFalse(option) == MagickFalse) /* enabled by default */ TIFFGetEXIFProperties(tiff,image,exception); (void) TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel);