Skip to content

Commit

Permalink
eliminate compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Aug 5, 2023
1 parent bc9d115 commit 1c4fe73
Show file tree
Hide file tree
Showing 102 changed files with 2,235 additions and 1,968 deletions.
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3192,6 +3192,7 @@ MODULES_DIRNAME = @MODULES_DIRNAME@
MODULES_PATH = @MODULES_PATH@
MODULES_RELATIVE_PATH = @MODULES_RELATIVE_PATH@
MODULE_EXTRA_CPPFLAGS = @MODULE_EXTRA_CPPFLAGS@
MTMALLOC_LIBS = @MTMALLOC_LIBS@
MVDelegate = @MVDelegate@
MogrifyDelegate = @MogrifyDelegate@
MrSIDDecodeDelegate = @MrSIDDecodeDelegate@
Expand Down
6 changes: 3 additions & 3 deletions coders/bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2326,21 +2326,21 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image)
(void) WriteBlobLSBLong(image,(unsigned int)
((ssize_t) image->chromaticity.red_primary.y*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
((ssize_t) (1.000f-(image->chromaticity.red_primary.x+
((ssize_t) (1.000-(image->chromaticity.red_primary.x+
image->chromaticity.red_primary.y))*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
((ssize_t) image->chromaticity.green_primary.x*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
((ssize_t) image->chromaticity.green_primary.y*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
((ssize_t) (1.000f-(image->chromaticity.green_primary.x+
((ssize_t) (1.000-(image->chromaticity.green_primary.x+
image->chromaticity.green_primary.y))*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
((ssize_t) image->chromaticity.blue_primary.x*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
((ssize_t) image->chromaticity.blue_primary.y*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
((ssize_t) (1.000f-(image->chromaticity.blue_primary.x+
((ssize_t) (1.000-(image->chromaticity.blue_primary.x+
image->chromaticity.blue_primary.y))*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
((ssize_t) bmp_info.gamma_scale.x*0x10000));
Expand Down
2 changes: 1 addition & 1 deletion coders/braille.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static MagickBooleanType WriteBRAILLEImage(const ImageInfo *image_info,
if (image->storage_class == PseudoClass)
{
polarity=(IndexPacket) (GetPixelLuma(image,&image->colormap[0]) >=
(QuantumRange/2.0));
((MagickRealType) QuantumRange/2.0));
if (image->colors == 2)
polarity=(IndexPacket) (GetPixelLuma(image,&image->colormap[0]) >=
GetPixelLuma(image,&image->colormap[1]));
Expand Down
2 changes: 1 addition & 1 deletion coders/cin.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)
offset+=4;
if (IsFloatDefined(cin.film.frame_rate) != MagickFalse)
(void) FormatImageProperty(image,"dpx:film.frame_rate","%g",
cin.film.frame_rate);
(double) cin.film.frame_rate);
offset+=ReadBlob(image,sizeof(cin.film.frame_id),(unsigned char *)
cin.film.frame_id);
(void) CopyMagickString(property,cin.film.frame_id,
Expand Down
16 changes: 9 additions & 7 deletions coders/cut.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,21 +520,23 @@ static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception)
image->colormap[i].red=(Quantum) ReadBlobLSBShort(palette);
if (QuantumRange != (Quantum) PalHeader.MaxRed)
{
image->colormap[i].red=ClampToQuantum(((double)
image->colormap[i].red*QuantumRange+(PalHeader.MaxRed>>1))/
PalHeader.MaxRed);
image->colormap[i].red=ClampToQuantum(((MagickRealType)
image->colormap[i].red*(MagickRealType) QuantumRange+
(PalHeader.MaxRed>>1))/ PalHeader.MaxRed);
}
image->colormap[i].green=(Quantum) ReadBlobLSBShort(palette);
if (QuantumRange != (Quantum) PalHeader.MaxGreen)
{
image->colormap[i].green=ClampToQuantum
(((double) image->colormap[i].green*QuantumRange+(PalHeader.MaxGreen>>1))/PalHeader.MaxGreen);
image->colormap[i].green=ClampToQuantum(((MagickRealType)
image->colormap[i].green*(MagickRealType) QuantumRange+
(PalHeader.MaxGreen>>1))/PalHeader.MaxGreen);
}
image->colormap[i].blue=(Quantum) ReadBlobLSBShort(palette);
if (QuantumRange != (Quantum) PalHeader.MaxBlue)
{
image->colormap[i].blue=ClampToQuantum
(((double)image->colormap[i].blue*QuantumRange+(PalHeader.MaxBlue>>1))/PalHeader.MaxBlue);
image->colormap[i].blue=ClampToQuantum(((MagickRealType)
image->colormap[i].blue*(MagickRealType) QuantumRange+
(PalHeader.MaxBlue>>1))/PalHeader.MaxBlue);
}

}
Expand Down
2 changes: 1 addition & 1 deletion coders/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static MagickBooleanType WriteDEBUGImage(const ImageInfo *image_info,
alpha[MaxTextExtent];

(void) FormatLocaleString(alpha,MaxTextExtent,",%.20g ",
(double) (QuantumRange-pixel.opacity));
(double) QuantumRange-pixel.opacity);
(void) ConcatenateMagickString(tuple,alpha,MaxTextExtent);
}
(void) WriteBlobString(image,tuple);
Expand Down
45 changes: 23 additions & 22 deletions coders/dng.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,46 +165,47 @@ static void SetDNGProperties(Image *image,const libraw_data_t *raw_info)
(void) FormatMagickTime(raw_info->other.timestamp,MagickPathExtent,timestamp);
(void) SetImageProperty(image,"dng:create.date",timestamp);
(void) SetImageProperty(image,"dng:f.number",property);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1f",
raw_info->other.iso_speed);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1g",
(double) raw_info->other.iso_speed);
#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0,18)
(void) SetImageProperty(image,"dng:software",raw_info->idata.software);
if (*raw_info->shootinginfo.BodySerial != '\0')
(void) SetImageProperty(image,"dng:serial.number",
raw_info->shootinginfo.BodySerial);
(void) FormatLocaleString(property,MagickPathExtent,"1/%0.1f",
(void) FormatLocaleString(property,MagickPathExtent,"1/%0.1g",
PerceptibleReciprocal(raw_info->other.shutter));
(void) SetImageProperty(image,"dng:exposure.time",property);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1f",
raw_info->other.aperture);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1g",
(double) raw_info->other.aperture);
(void) SetImageProperty(image,"dng:iso.setting",property);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1f",
raw_info->lens.EXIF_MaxAp);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1g",
(double) raw_info->lens.EXIF_MaxAp);
(void) SetImageProperty(image,"dng:max.aperture.value",property);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1f",
raw_info->other.focal_len);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1g",
(double) raw_info->other.focal_len);
(void) SetImageProperty(image,"dng:focal.length",property);
(void) FormatLocaleString(property,MagickPathExtent,"%f %f %f %f",
raw_info->color.cam_mul[0],raw_info->color.cam_mul[2],
raw_info->color.cam_mul[1],raw_info->color.cam_mul[3]);
(void) FormatLocaleString(property,MagickPathExtent,"%g %g %g %g",
(double) raw_info->color.cam_mul[0],(double) raw_info->color.cam_mul[2],
(double) raw_info->color.cam_mul[1],(double) raw_info->color.cam_mul[3]);
(void) SetImageProperty(image,"dng:wb.rb.levels",property);
(void) FormatLocaleString(property,MagickPathExtent,
"%0.1f-%0.1fmm f/%0.1f-%0.1f",raw_info->lens.makernotes.MinFocal,
raw_info->lens.makernotes.MaxFocal,raw_info->lens.makernotes.MaxAp4MinFocal,
"%0.1g-%0.1gmm f/%0.1g-%0.1g",(double) raw_info->lens.makernotes.MinFocal,
(double) raw_info->lens.makernotes.MaxFocal,(double)
raw_info->lens.makernotes.MaxAp4MinFocal,(double)
raw_info->lens.makernotes.MaxAp4MaxFocal);
(void) SetImageProperty(image,"dng:lens",property);
(void) FormatLocaleString(property,MagickPathExtent,"%0.2f",
raw_info->lens.makernotes.LensFStops);
(void) FormatLocaleString(property,MagickPathExtent,"%0.2g",
(double) raw_info->lens.makernotes.LensFStops);
(void) SetImageProperty(image,"dng:lens.f.stops",property);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1f mm",
raw_info->lens.makernotes.MinFocal);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1g mm",
(double) raw_info->lens.makernotes.MinFocal);
(void) SetImageProperty(image,"dng:min.focal.length",property);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1f mm",
raw_info->lens.makernotes.MaxFocal);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1g mm",
(double) raw_info->lens.makernotes.MaxFocal);
(void) SetImageProperty(image,"dng:max.focal.length",property);
(void) SetImageProperty(image,"dng:max.aperture.at.min.focal",property);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1f",
raw_info->lens.makernotes.MaxAp4MaxFocal);
(void) FormatLocaleString(property,MagickPathExtent,"%0.1g",
(double) raw_info->lens.makernotes.MaxAp4MaxFocal);
(void) SetImageProperty(image,"dng:max.aperture.at.max.focal",property);
(void) FormatLocaleString(property,MagickPathExtent,"%d mm",
raw_info->lens.FocalLengthIn35mmFormat);
Expand Down
28 changes: 14 additions & 14 deletions coders/dpx.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,12 +889,12 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
offset+=4;
if (IsFloatDefined(dpx.orientation.x_center) != MagickFalse)
(void) FormatImageProperty(image,"dpx:orientation.x_center","%g",
dpx.orientation.x_center);
(double) dpx.orientation.x_center);
dpx.orientation.y_center=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.orientation.y_center) != MagickFalse)
(void) FormatImageProperty(image,"dpx:orientation.y_center","%g",
dpx.orientation.y_center);
(double) dpx.orientation.y_center);
dpx.orientation.x_size=ReadBlobLong(image);
offset+=4;
if (dpx.orientation.x_size != ~0U)
Expand Down Expand Up @@ -998,12 +998,12 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
offset+=4;
if (IsFloatDefined(dpx.film.frame_rate) != MagickFalse)
(void) FormatImageProperty(image,"dpx:film.frame_rate","%g",
dpx.film.frame_rate);
(double) dpx.film.frame_rate);
dpx.film.shutter_angle=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.film.shutter_angle) != MagickFalse)
(void) FormatImageProperty(image,"dpx:film.shutter_angle","%g",
dpx.film.shutter_angle);
(double) dpx.film.shutter_angle);
offset+=ReadBlob(image,sizeof(dpx.film.frame_id),(unsigned char *)
dpx.film.frame_id);
if (*dpx.film.frame_id != '\0')
Expand Down Expand Up @@ -1054,53 +1054,53 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
offset+=4;
if (IsFloatDefined(dpx.television.horizontal_sample_rate) != MagickFalse)
(void) FormatImageProperty(image,
"dpx:television.horizontal_sample_rate","%g",
"dpx:television.horizontal_sample_rate","%g",(double)
dpx.television.horizontal_sample_rate);
dpx.television.vertical_sample_rate=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.television.vertical_sample_rate) != MagickFalse)
(void) FormatImageProperty(image,"dpx:television.vertical_sample_rate",
"%g",dpx.television.vertical_sample_rate);
"%g",(double) dpx.television.vertical_sample_rate);
dpx.television.frame_rate=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.television.frame_rate) != MagickFalse)
(void) FormatImageProperty(image,"dpx:television.frame_rate","%g",
dpx.television.frame_rate);
(double) dpx.television.frame_rate);
dpx.television.time_offset=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.television.time_offset) != MagickFalse)
(void) FormatImageProperty(image,"dpx:television.time_offset","%g",
dpx.television.time_offset);
(double) dpx.television.time_offset);
dpx.television.gamma=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.television.gamma) != MagickFalse)
(void) FormatImageProperty(image,"dpx:television.gamma","%g",
dpx.television.gamma);
(double) dpx.television.gamma);
dpx.television.black_level=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.television.black_level) != MagickFalse)
(void) FormatImageProperty(image,"dpx:television.black_level","%g",
dpx.television.black_level);
(double) dpx.television.black_level);
dpx.television.black_gain=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.television.black_gain) != MagickFalse)
(void) FormatImageProperty(image,"dpx:television.black_gain","%g",
dpx.television.black_gain);
(double) dpx.television.black_gain);
dpx.television.break_point=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.television.break_point) != MagickFalse)
(void) FormatImageProperty(image,"dpx:television.break_point","%g",
dpx.television.break_point);
(double) dpx.television.break_point);
dpx.television.white_level=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.television.white_level) != MagickFalse)
(void) FormatImageProperty(image,"dpx:television.white_level","%g",
dpx.television.white_level);
(double) dpx.television.white_level);
dpx.television.integration_times=ReadBlobFloat(image);
offset+=4;
if (IsFloatDefined(dpx.television.integration_times) != MagickFalse)
(void) FormatImageProperty(image,"dpx:television.integration_times",
"%g",dpx.television.integration_times);
"%g",(double) dpx.television.integration_times);
offset+=ReadBlob(image,sizeof(dpx.television.reserve),(unsigned char *)
dpx.television.reserve);
}
Expand Down
20 changes: 12 additions & 8 deletions coders/exr.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,13 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception)
else
{
SetPixelRed(q,ClampToQuantum((MagickRealType) QuantumRange*
ImfHalfToFloat(scanline[xx].r)));
(MagickRealType) ImfHalfToFloat(scanline[xx].r)));
SetPixelGreen(q,ClampToQuantum((MagickRealType) QuantumRange*
ImfHalfToFloat(scanline[xx].g)));
(MagickRealType) ImfHalfToFloat(scanline[xx].g)));
SetPixelBlue(q,ClampToQuantum((MagickRealType) QuantumRange*
ImfHalfToFloat(scanline[xx].b)));
(MagickRealType) ImfHalfToFloat(scanline[xx].b)));
SetPixelAlpha(q,ClampToQuantum((MagickRealType) QuantumRange*
ImfHalfToFloat(scanline[xx].a)));
(MagickRealType) ImfHalfToFloat(scanline[xx].a)));
}
q++;
}
Expand Down Expand Up @@ -596,16 +596,20 @@ static MagickBooleanType WriteEXRImage(const ImageInfo *image_info,Image *image)
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
ImfFloatToHalf(QuantumScale*GetPixelRed(p),&half_quantum);
ImfFloatToHalf(QuantumScale*(MagickRealType) GetPixelRed(p),
&half_quantum);
scanline[x].r=half_quantum;
ImfFloatToHalf(QuantumScale*GetPixelGreen(p),&half_quantum);
ImfFloatToHalf(QuantumScale*(MagickRealType) GetPixelGreen(p),
&half_quantum);
scanline[x].g=half_quantum;
ImfFloatToHalf(QuantumScale*GetPixelBlue(p),&half_quantum);
ImfFloatToHalf(QuantumScale*(MagickRealType) GetPixelBlue(p),
&half_quantum);
scanline[x].b=half_quantum;
if (image->matte == MagickFalse)
ImfFloatToHalf(1.0,&half_quantum);
else
ImfFloatToHalf(1.0-QuantumScale*GetPixelOpacity(p),&half_quantum);
ImfFloatToHalf(1.0-QuantumScale*(MagickRealType) GetPixelOpacity(p),
&half_quantum);
scanline[x].a=half_quantum;
p++;
}
Expand Down
4 changes: 2 additions & 2 deletions coders/fits.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ static Image *ReadFITSImage(const ImageInfo *image_info,
/*
Convert FITS pixels to pixel packets.
*/
scale=QuantumRange*PerceptibleReciprocal(fits_info.max_data-
fits_info.min_data);
scale=(MagickRealType) QuantumRange*
PerceptibleReciprocal(fits_info.max_data-fits_info.min_data);
for (y=(ssize_t) image->rows-1; y >= 0; y--)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
Expand Down
10 changes: 5 additions & 5 deletions coders/gif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1651,9 +1651,9 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image)
continue;
}
alpha=fabs((double) image->colormap[i].opacity-
TransparentOpacity);
(double) TransparentOpacity);
beta=fabs((double) image->colormap[opacity].opacity-
TransparentOpacity);
(double) TransparentOpacity);
if (alpha < beta)
opacity=i;
}
Expand All @@ -1669,9 +1669,9 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image)
continue;
}
alpha=fabs((double) image->colormap[i].opacity-
TransparentOpacity);
(double) TransparentOpacity);
beta=fabs((double) image->colormap[opacity].opacity-
TransparentOpacity);
(double) TransparentOpacity);
if (alpha < beta)
opacity=i;
}
Expand Down Expand Up @@ -1762,7 +1762,7 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image)
(void) WriteBlobByte(image,(unsigned char) (opacity >= 0 ? opacity :
0));
(void) WriteBlobByte(image,(unsigned char) 0x00);
if (fabs(image->gamma - 1.0f/2.2f) > MagickEpsilon)
if (fabs(image->gamma-1.0/2.2) > MagickEpsilon)
{
char
attributes[MaxTextExtent];
Expand Down
2 changes: 1 addition & 1 deletion coders/gradient.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static Image *ReadGRADIENTImage(const ImageInfo *image_info,
}
(void) QueryMagickColor(colorname,&start_pixel,exception);
(void) CopyMagickString(colorname,"white",MaxTextExtent);
if (GetPixelLuma(image,&start_color) > (QuantumRange/2.0))
if (GetPixelLuma(image,&start_color) > ((double) QuantumRange/2.0))
(void) CopyMagickString(colorname,"black",MaxTextExtent);
if (icc_color == MagickFalse)
(void) sscanf(image_info->filename,"%*[^-]-%[^-]",colorname);
Expand Down
6 changes: 3 additions & 3 deletions coders/hald.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ static Image *ReadHALDImage(const ImageInfo *image_info,
for (red=0; red < (ssize_t) cube_size; red++)
{
SetPixelRed(q,ClampToQuantum((MagickRealType)
(QuantumRange*red/(cube_size-1.0))));
QuantumRange*red/(cube_size-1.0)));
SetPixelGreen(q,ClampToQuantum((MagickRealType)
(QuantumRange*green/(cube_size-1.0))));
QuantumRange*green/(cube_size-1.0)));
SetPixelBlue(q,ClampToQuantum((MagickRealType)
(QuantumRange*blue/(cube_size-1.0))));
QuantumRange*blue/(cube_size-1.0)));
SetPixelOpacity(q,OpaqueOpacity);
if (indexes != (IndexPacket *) NULL)
{
Expand Down
Loading

0 comments on commit 1c4fe73

Please sign in to comment.