#include <Magick++/Image.h>
#include <Magick++/STL.h>
-static std::string getInitializer(const std::string module)
+static std::string getInitializer(const std::string magick_module)
{
- if ((module == "BGR") || (module == "CMYK") || (module =="RGB") || (module =="YUV"))
+ if ((magick_module == "BGR") || (magick_module == "CMYK") || (magick_module =="RGB") || (magick_module =="YUV"))
return "interlace";
- if (module == "PNG")
+ if (magick_module == "PNG")
return "png";
return "";
}
for (std::list<Magick::CoderInfo>::iterator it = coderList.begin(); it != coderList.end(); it++)
{
- std::string module=(*it).module();
- if (std::find(excludeList.begin(), excludeList.end(), module) != excludeList.end())
+ std::string magick_module=(*it).magick_module();
+ if (std::find(excludeList.begin(), excludeList.end(), magick_module) != excludeList.end())
continue;
- if ((*it).name() == module)
- std::cout << ((*it).isWritable() ? "+" : "-") << module << ":" << getInitializer(module) << std::endl;
- else if (std::find(allowedNames.begin(), allowedNames.end(), module) != allowedNames.end())
- std::cout << ((*it).isWritable() ? "+" : "-") << (*it).name() << ":" << getInitializer(module) << std::endl;
+ if ((*it).name() == magick_module)
+ std::cout << ((*it).isWritable() ? "+" : "-") << magick_module << ":" << getInitializer(magick_module) << std::endl;
+ else if (std::find(allowedNames.begin(), allowedNames.end(), magick_module) != allowedNames.end())
+ std::cout << ((*it).isWritable() ? "+" : "-") << (*it).name() << ":" << getInitializer(magick_module) << std::endl;
}
}
NULL) ? false : true);
_mimeType=std::string(magickInfo->mime_type != (char *) NULL ?
magickInfo->mime_type : "");
- _module=std::string(magickInfo->module);
+ _module=std::string(magickInfo->magick_module);
_name=std::string(magickInfo->name);
}
}
bool Magick::CoderInfo::unregister(void) const
{
return(UnregisterMagickInfo(_name.c_str()) != MagickFalse);
-}
\ No newline at end of file
+}
for (p=text; *p != '\0'; p++)
if (*p == '\n')
number_lines++;
- textlist=AcquireQuantumMemory(number_lines+1,sizeof(*textlist));
+ textlist=(char **) AcquireQuantumMemory(number_lines+1,sizeof(*textlist));
if (textlist == (char **) NULL)
{
annotate_info=DestroyDrawInfo(annotate_info);
return(MagickFalse);
}
p=text;
- for (i=0; i < number_lines; i++)
+ for (i=0; i < (ssize_t) number_lines; i++)
{
char
*q;
*/
if ((magick_info != (const MagickInfo *) NULL) &&
(GetMagickUseExtension(magick_info) != MagickFalse) &&
- (LocaleCompare(magick_info->module,GetMagicName(
+ (LocaleCompare(magick_info->magick_module,GetMagicName(
magic_info)) == 0))
(void) CopyMagickString(image_info->magick,magick_info->name,
MagickPathExtent);
%
% The format of the AcquireMagickInfo method is:
%
-% MagickInfo *AcquireMagickInfo(const char *module, const char *name,)
+% MagickInfo *AcquireMagickInfo(const char *magick_module,
+% const char *name,const char *description)
%
% A description of each parameter follows:
%
-% o module: a character string that represents the module associated
+% o magick_module: a character string that represents the module associated
% with the MagickInfo structure.
%
% o name: a character string that represents the image format associated
% associated with the MagickInfo structure.
%
*/
-MagickExport MagickInfo *AcquireMagickInfo(const char *module,const char *name,
- const char *description)
+MagickExport MagickInfo *AcquireMagickInfo(const char *magick_module,
+ const char *name,const char *description)
{
MagickInfo
*magick_info;
- assert(module != (const char *) NULL);
+ assert(magick_module != (const char *) NULL);
assert(name != (const char *) NULL);
assert(description != (const char *) NULL);
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",name);
magick_info=(MagickInfo *) AcquireCriticalMemory(sizeof(*magick_info));
(void) memset(magick_info,0,sizeof(*magick_info));
- magick_info->module=ConstantString(module);
+ magick_info->magick_module=ConstantString(magick_module);
magick_info->name=ConstantString(name);
magick_info->description=ConstantString(description);
magick_info->flags=CoderAdjoinFlag | CoderBlobSupportFlag |
*p;
p=(MagickInfo *) magick_info;
- if (p->module != (char *) NULL)
- p->module=DestroyString(p->module);
+ if (p->magick_module != (char *) NULL)
+ p->magick_module=DestroyString(p->magick_module);
if (p->note != (char *) NULL)
p->note=DestroyString(p->note);
if (p->mime_type != (char *) NULL)
#if defined(MAGICKCORE_MODULES_SUPPORT)
{
char
- module[MagickPathExtent];
+ magick_module[MagickPathExtent];
- *module='\0';
- if (magick_info[i]->module != (char *) NULL)
- (void) CopyMagickString(module,magick_info[i]->module,MagickPathExtent);
- (void) ConcatenateMagickString(module," ",MagickPathExtent);
- module[9]='\0';
- (void) FormatLocaleFile(file,"%9s ",module);
+ *magick_module='\0';
+ if (magick_info[i]->magick_module != (char *) NULL)
+ (void) CopyMagickString(magick_module,magick_info[i]->magick_module,
+ MagickPathExtent);
+ (void) ConcatenateMagickString(magick_module," ",
+ MagickPathExtent);
+ magick_module[9]='\0';
+ (void) FormatLocaleFile(file,"%9s ",magick_module);
}
#endif
(void) FormatLocaleFile(file,"%c%c%c ",magick_info[i]->decoder ? 'r' : '-',
*version,
*mime_type,
*note,
- *module;
+ *magick_module;
DecodeImageHandler
*decoder;
# define STDC
#endif
+#if defined(__cplusplus) || defined(c_plusplus)
+# define magick_module _module /* reserved word in C++(20) */
+#else
+# define magick_module module
+#endif
+
#include <stdarg.h>
#include <stdio.h>
#if defined(MAGICKCORE_HAVE_SYS_STAT_H)
/*
Check for table-based substitution match.
*/
- for (i=0; i < (sizeof(fontmap)/sizeof(fontmap[0])); i++)
+ for (i=0; i < (ssize_t) (sizeof(fontmap)/sizeof(fontmap[0])); i++)
{
if (family == (const char *) NULL)
{
# define STDC
#endif
-#if defined(__cplusplus) || defined(c_plusplus)
-# define storage_class c_class
-#else
-# define storage_class class
-#endif
-
#include <stdarg.h>
#include <stdio.h>
#if defined(MAGICKCORE_HAVE_SYS_STAT_H)
%
*/
WandExport MagickBooleanType CLILogEvent(MagickCLI *cli_wand,
- const LogEventType type,const char *module,const char *function,
+ const LogEventType type,const char *magick_module,const char *function,
const size_t line,const char *format,...)
{
char
(void) ConcatenateMagickString(new_format,format,MagickPathExtent);
va_start(operands,format);
- status=LogMagickEventList(type,module,function,line,new_format,operands);
+ status=LogMagickEventList(type,magick_module,function,line,new_format,
+ operands);
va_end(operands);
return(status);
% it the location of the option that caused the exception to occur.
*/
WandExport MagickBooleanType CLIThrowException(MagickCLI *cli_wand,
- const char *module,const char *function,const size_t line,
+ const char *magick_module,const char *function,const size_t line,
const ExceptionType severity,const char *tag,const char *format,...)
{
char
cli_wand->location,cli_wand->filename,cli_wand->line,cli_wand->column);
va_start(operands,format);
- status=ThrowMagickExceptionList(cli_wand->wand.exception,module,function,
- line,severity,tag,new_format,operands);
+ status=ThrowMagickExceptionList(cli_wand->wand.exception,magick_module,
+ function,line,severity,tag,new_format,operands);
va_end(operands);
return(status);
}
PUSHs(&sv_undef);
else
PUSHs(sv_2mortal(newSVpv(magick_info->description,0)));
- if (magick_info->module == (char *) NULL)
+ if (magick_info->magick_module == (char *) NULL)
PUSHs(&sv_undef);
else
- PUSHs(sv_2mortal(newSVpv(magick_info->module,0)));
+ PUSHs(sv_2mortal(newSVpv(magick_info->magick_module,0)));
}
PerlException:
PUSHs(&sv_undef);
else
PUSHs(sv_2mortal(newSVpv(magick_info->description,0)));
- if (magick_info->module == (char *) NULL)
+ if (magick_info->magick_module == (char *) NULL)
PUSHs(&sv_undef);
else
- PUSHs(sv_2mortal(newSVpv(magick_info->module,0)));
+ PUSHs(sv_2mortal(newSVpv(magick_info->magick_module,0)));
}
PerlException:
const size_t length)
{
CheckMagickByteBuffer(buffer,length);
- if ((buffer->offset+length) < buffer->count)
+ if ((ssize_t) (buffer->offset+length) < buffer->count)
buffer->offset+=length;
}
/*
* Swap the 2nd and 3rd block in each page
*/
- for (page=0; page < pages; page++)
+ for (page=0; page < (ssize_t) pages; page++)
{
memcpy(&(image->colormap[i+1*colors]),&(oldColormap[i+2*colors]),colors*
sizeof(PixelInfo));
image->colormap[i].red=GetChannelValue(word,0,RGBA16);
image->colormap[i].green=GetChannelValue(word,1,RGBA16);
image->colormap[i].blue=GetChannelValue(word,2,RGBA16);
- image->colormap[i].alpha=GetAlpha(word,16);
+ image->colormap[i].alpha=GetAlpha(word,RGBA16);
p+=2;
}
break;