Skip to content

Commit

Permalink
Eliminate compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jan 21, 2018
1 parent 232bef5 commit 7603949
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 7 deletions.
9 changes: 5 additions & 4 deletions MagickCore/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,9 +925,9 @@ MagickExport MagickBooleanType LZWEncodeImage(Image *image,const size_t length,
number_bits+=code_width; \
while (number_bits >= 8) \
{ \
(void) WriteBlobByte(image,(unsigned char) (accumulator >> 24)); \
accumulator=accumulator << 8; \
number_bits-=8; \
(void) WriteBlobByte(image,(unsigned char) (accumulator >> 24)); \
accumulator=accumulator << 8; \
number_bits-=8; \
} \
}

Expand Down Expand Up @@ -967,7 +967,8 @@ MagickExport MagickBooleanType LZWEncodeImage(Image *image,const size_t length,
assert(exception->signature == MagickCoreSignature);
table=(TableType *) AcquireQuantumMemory(1UL << 12,sizeof(*table));
if (table == (TableType *) NULL)
return(MagickFalse);
ThrowBinaryException(ResourceLimitWarning,"MemoryAllocationFailed",
image->filename);
/*
Initialize variables.
*/
Expand Down
3 changes: 3 additions & 0 deletions MagickCore/configure.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,9 @@ MagickExport LinkedListInfo *GetConfigurePaths(const char *filename,
}
}
#endif
if (GetNumberOfElementsInLinkedList(paths) == 0)
(void) ThrowMagickException(exception,GetMagickModule(),ConfigureWarning,
"no configuration paths found","`%s'",filename);
return(paths);
}

Expand Down
2 changes: 1 addition & 1 deletion MagickCore/distribute-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ MagickExport void DistributePixelCacheServer(const int port,
*/
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
magick_unreferenced(exception);
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
NTInitializeWinsock(MagickFalse);
#endif
Expand Down Expand Up @@ -998,7 +999,6 @@ MagickExport void DistributePixelCacheServer(const int port,
}
#else
magick_unreferenced(port);
magick_unreferenced(exception);
ThrowFatalException(MissingDelegateError,"DelegateLibrarySupportNotBuiltIn");
#endif
}
Expand Down
3 changes: 2 additions & 1 deletion MagickCore/nt-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2230,9 +2230,10 @@ MagickPrivate unsigned char *NTResourceToBlob(const char *id)
*/
MagickPrivate void NTSeekDirectory(DIR *entry,ssize_t position)
{
(void) position;
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(entry != (DIR *) NULL);
(void) entry;
(void) position;
}

/*
Expand Down
1 change: 1 addition & 0 deletions MagickCore/quantum-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ static void ExportAlphaQuantum(const Image *image,QuantumInfo *quantum_info,

assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
(void) exception;
switch (quantum_info->depth)
{
case 8:
Expand Down
3 changes: 2 additions & 1 deletion MagickCore/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ MagickPrivate ResizeFilter *AcquireResizeFilter(const Image *image,
assert(UndefinedFilter < filter && filter < SentinelFilter);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
(void) exception;
resize_filter=(ResizeFilter *) AcquireCriticalMemory(sizeof(*resize_filter));
(void) ResetMagickMemory(resize_filter,0,sizeof(*resize_filter));
/*
Expand All @@ -941,7 +942,7 @@ MagickPrivate ResizeFilter *AcquireResizeFilter(const Image *image,
window_type=mapping[filter].window;
resize_filter->blur=1.0;
/* Promote 1D Windowed Sinc Filters to a 2D Windowed Jinc filters */
if ( cylindrical != MagickFalse && (filter_type == SincFastFilter) &&
if ((cylindrical != MagickFalse) && (filter_type == SincFastFilter) &&
(filter != SincFastFilter))
filter_type=JincFilter; /* 1D Windowed Sinc => 2D Windowed Jinc filters */

Expand Down
1 change: 1 addition & 0 deletions MagickCore/threshold.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ static double TriangleThreshold(const Image *image,const double *histogram,
/*
Compute optimal threshold with triangle algorithm.
*/
(void) exception;
start=0; /* find start bin, first bin not zero count */
for (i=0; i <= (ssize_t) MaxIntensity; i++)
if (histogram[i] > 0.0)
Expand Down
1 change: 1 addition & 0 deletions MagickCore/xwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -9930,6 +9930,7 @@ MagickExport Image *XImportImage(const ImageInfo *image_info,
assert(ximage_info != (XImportInfo *) NULL);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
(void) exception;
return((Image *) NULL);
}

Expand Down
1 change: 1 addition & 0 deletions MagickWand/composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ static MagickBooleanType CompositeImageList(ImageInfo *image_info,Image **image,
if ((*image)->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",(*image)->filename);
assert(exception != (ExceptionInfo *) NULL);
(void) image_info;
status=MagickTrue;
if (composite_image != (Image *) NULL)
{
Expand Down
1 change: 1 addition & 0 deletions coders/null.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ static MagickBooleanType WriteNULLImage(const ImageInfo *image_info,
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
assert(exception != (ExceptionInfo *) NULL);
(void) exception;
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
return(MagickTrue);
Expand Down

0 comments on commit 7603949

Please sign in to comment.