Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-05-05 03:38:19 +0300
committerCampbell Barton <campbell@blender.org>2022-05-05 03:44:25 +0300
commitd3c895fc41d7a2d4ec677c4cd70f656a28f8edb1 (patch)
tree1a1da5c90e3ab8994f9058752a21ed64a5495c6d /source/blender/imbuf
parent777b72b5cbbc582fb7b028f66c406285e0eb5370 (diff)
Cleanup: shadow and format warnings
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/jpeg.c4
-rw-r--r--source/blender/imbuf/intern/readimage.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index 0ec4e5a3ba8..d76bd00df57 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -290,7 +290,7 @@ static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo,
* while libjpeg-turbo can also do 3/8, 5/8, etc. But max is 1/8. */
float scale = (float)max_size / MAX2(cinfo->image_width, cinfo->image_height);
cinfo->scale_denom = 8;
- cinfo->scale_num = MAX2(1, MIN2(8, ceill(scale * (float)cinfo->scale_denom)));
+ cinfo->scale_num = max_uu(1, min_uu(8, ceill(scale * (float)cinfo->scale_denom)));
cinfo->dct_method = JDCT_FASTEST;
cinfo->dither_mode = JDITHER_ORDERED;
}
@@ -529,7 +529,7 @@ struct ImBuf *imb_thumbnail_jpeg(const char *filepath,
if (i > 0 && !feof(infile)) {
/* We found a JPEG thumbnail inside this image. */
ImBuf *ibuf = NULL;
- unsigned char *buffer = (char *)MEM_callocN(JPEG_APP1_MAX, "thumbbuffer");
+ uchar *buffer = MEM_callocN(JPEG_APP1_MAX, "thumbbuffer");
/* Just put SOI directly in buffer rather than seeking back 2 bytes. */
buffer[0] = JPEG_MARKER_MSB;
buffer[1] = JPEG_MARKER_SOI;
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c
index 424ab8e085a..81347bce588 100644
--- a/source/blender/imbuf/intern/readimage.c
+++ b/source/blender/imbuf/intern/readimage.c
@@ -278,10 +278,10 @@ struct ImBuf *IMB_thumb_load_image(const char *filepath,
if (width > 0 && height > 0) {
/* Save dimensions of original image into the thumbnail metadata. */
- char cwidth[40] = "0";
- char cheight[40] = "0";
- BLI_snprintf(cwidth, sizeof(cwidth), "%d", width);
- BLI_snprintf(cheight, sizeof(cheight), "%d", height);
+ char cwidth[40];
+ char cheight[40];
+ SNPRINTF(cwidth, "%zu", width);
+ SNPRINTF(cheight, "%zu", height);
IMB_metadata_ensure(&ibuf->metadata);
IMB_metadata_set_field(ibuf->metadata, "Thumb::Image::Width", cwidth);
IMB_metadata_set_field(ibuf->metadata, "Thumb::Image::Height", cheight);