Skip to content

Commit

Permalink
eliminate lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jun 11, 2022
1 parent e1b538a commit 92e7887
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions MagickCore/color-private.h
Expand Up @@ -43,6 +43,8 @@ static inline MagickBooleanType GetColorRange(const char *color,
MagickBooleanType
status;

if (color == (const char *) NULL)
return(MagickFalse);
if (*color != '\0')
{
char
Expand Down
6 changes: 6 additions & 0 deletions MagickCore/string-private.h
Expand Up @@ -102,11 +102,15 @@ static inline double StringToDoubleInterval(const char *string,

static inline int StringToInteger(const char *magick_restrict value)
{
if (value == (const char *) NULL)
return(0);
return((int) strtol(value,(char **) NULL,10));
}

static inline long StringToLong(const char *magick_restrict value)
{
if (value == (const char *) NULL)
return(0);
return(strtol(value,(char **) NULL,10));
}

Expand Down Expand Up @@ -136,6 +140,8 @@ static inline size_t StringToSizeType(const char *string,const double interval)
static inline unsigned long StringToUnsignedLong(
const char *magick_restrict value)
{
if (value == (const char *) NULL)
return(0);
return(strtoul(value,(char **) NULL,10));
}

Expand Down
2 changes: 2 additions & 0 deletions MagickCore/utility-private.h
Expand Up @@ -133,6 +133,8 @@ static inline wchar_t *create_wchar_mode(const char *mode)

static inline int access_utf8(const char *path,int mode)
{
if (path == (const char *) NULL)
return(-1);
#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__)
return(access(path,mode));
#else
Expand Down
2 changes: 2 additions & 0 deletions MagickWand/mogrify.c
Expand Up @@ -4066,6 +4066,8 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
AppendImageFormat(format,images->filename);
AppendImageStack(images);
FinalizeImageSettings(image_info,image,MagickFalse);
if (image == (Image *) NULL)
continue;
if (global_colormap != MagickFalse)
{
QuantizeInfo
Expand Down
6 changes: 6 additions & 0 deletions MagickWand/operation.c
Expand Up @@ -1085,6 +1085,8 @@ WandPrivate void CLISettingOptionInfo(MagickCLI *cli_wand,
if (LocaleCompare("log",option+1) == 0)
{
if (IfSetOption) {
if (arg1 == (char *) NULL)
break;
if ((strchr(arg1,'%') == (char *) NULL))
CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
(void) SetLogFormat(arg1);
Expand Down Expand Up @@ -3124,6 +3126,8 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
max_threshold=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
max_threshold=min_threshold;
if (arg1 == (char *) NULL)
break;
if (strchr(arg1,'%') != (char *) NULL)
{
max_threshold*=(double) (0.01*QuantumRange);
Expand Down Expand Up @@ -4204,6 +4208,8 @@ WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,
arg1);
number_duplicates=(size_t) StringToLong(arg1);
if (arg1 == (char *) NULL)
break;
p=strchr(arg1,',');
if (p == (const char *) NULL)
new_images=DuplicateImages(_images,number_duplicates,"-1",
Expand Down
7 changes: 6 additions & 1 deletion MagickWand/script-token.c
Expand Up @@ -337,6 +337,8 @@ WandExport ScriptTokenInfo * DestroyScriptTokenInfo(ScriptTokenInfo *token_info)
#define SaveChar(c) \
{ \
if ((size_t) offset >= (token_info->length-1)) { \
if (token_info == (ScriptTokenInfo *) NULL) \
break; \
if ( token_info->length >= MagickPathExtent ) \
token_info->length += MagickPathExtent; \
else \
Expand All @@ -348,7 +350,10 @@ WandExport ScriptTokenInfo * DestroyScriptTokenInfo(ScriptTokenInfo *token_info)
break; \
} \
} \
token_info->token[offset++]=(char) (c); \
if ( token_info->token == (char *) NULL ) \
token_info->status=TokenStatusMemoryFailed; \
else \
token_info->token[offset++]=(char) (c); \
}

WandExport MagickBooleanType GetScriptToken(ScriptTokenInfo *token_info)
Expand Down

0 comments on commit 92e7887

Please sign in to comment.