Commit: 768cfd291c005a455bf0ed277a01495f10970b48
Author: Brecht Van Lommel
Date:   Wed Jan 17 21:11:59 2018 +0100
Branches: blender-v2.79-release
https://developer.blender.org/rB768cfd291c005a455bf0ed277a01495f10970b48

Fix Linux/GCC compiler warning in recent fixes.

===================================================================

M       source/blender/imbuf/intern/cineon/logImageCore.c
M       source/blender/imbuf/intern/iris.c
M       source/blender/imbuf/intern/radiance_hdr.c

===================================================================

diff --git a/source/blender/imbuf/intern/cineon/logImageCore.c 
b/source/blender/imbuf/intern/cineon/logImageCore.c
index 8a444f7c6ca..eb8d5b6c2b9 100644
--- a/source/blender/imbuf/intern/cineon/logImageCore.c
+++ b/source/blender/imbuf/intern/cineon/logImageCore.c
@@ -701,7 +701,7 @@ static int logImageElementGetData10Packed(LogImageFile 
*logImage, LogImageElemen
        for (size_t y = 0; y < logImage->height; y++) {
                /* seek to data */
                if (logimage_fseek(logImage, y * rowLength + 
logElement.dataOffset, SEEK_SET) != 0) {
-                       if (verbose) printf("DPX/Cineon: Couldn't seek at 
%u\n", (int)(y * rowLength + logElement.dataOffset));
+                       if (verbose) printf("DPX/Cineon: Couldn't seek at 
%u\n", (unsigned int)(y * rowLength + logElement.dataOffset));
                        return 1;
                }
 
@@ -779,7 +779,7 @@ static int logImageElementGetData12Packed(LogImageFile 
*logImage, LogImageElemen
        for (size_t y = 0; y < logImage->height; y++) {
                /* seek to data */
                if (logimage_fseek(logImage, y * rowLength + 
logElement.dataOffset, SEEK_SET) != 0) {
-                       if (verbose) printf("DPX/Cineon: Couldn't seek at 
%u\n", (int)(y * rowLength + logElement.dataOffset));
+                       if (verbose) printf("DPX/Cineon: Couldn't seek at 
%u\n", (unsigned int)(y * rowLength + logElement.dataOffset));
                        return 1;
                }
 
diff --git a/source/blender/imbuf/intern/iris.c 
b/source/blender/imbuf/intern/iris.c
index c62829cb8fa..55727ed6697 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -261,7 +261,7 @@ struct ImBuf *imb_loadiris(const uchar *mem, size_t size, 
int flags, char colors
        MFileOffset _inf_data = {mem, 0}, *inf = &_inf_data;
        IMAGE image;
        int bpp, rle, cur, badorder;
-       ImBuf *ibuf;
+       ImBuf *ibuf = NULL;
        uchar dirty_flag = 0;
 
        if (size < HEADER_SIZE) {
diff --git a/source/blender/imbuf/intern/radiance_hdr.c 
b/source/blender/imbuf/intern/radiance_hdr.c
index cecebf7bfa3..8d822a314f5 100644
--- a/source/blender/imbuf/intern/radiance_hdr.c
+++ b/source/blender/imbuf/intern/radiance_hdr.c
@@ -138,7 +138,7 @@ static const unsigned char *freadcolrs(RGBE *scan, const 
unsigned char *mem, int
                                if (UNLIKELY(code + j > xmax)) {
                                        return NULL;
                                }
-                               int val = *mem++;
+                               val = *mem++;
                                while (code--) {
                                        scan[j++][i] = (unsigned char)val;
                                }
@@ -263,7 +263,7 @@ struct ImBuf *imb_loadhdr(const unsigned char *mem, size_t 
size, int flags, char
                                        printf("WARNING! HDR decode error, 
image may be just truncated, or completely wrong...\n");
                                        break;
                                }
-                               for (size_t x = 0; x < width; x++) {
+                               for (x = 0; x < width; x++) {
                                        /* convert to ldr */
                                        RGBE2FLOAT(sline[x], fcol);
                                        *rect_float++ = fcol[RED];
@@ -302,8 +302,7 @@ static int fwritecolrs(FILE *file, int width, int channels, 
unsigned char *ibufs
        rgbe_scan = (RGBE *)MEM_mallocN(sizeof(RGBE) * width, 
"radhdr_write_tmpscan");
 
        /* convert scanline */
-       size_t j = 0;
-       for (size_t i = 0; i < width; i++) {
+       for (size_t i = 0, j = 0; i < width; i++) {
                if (fpscan) {
                        fcol[RED] = fpscan[j];
                        fcol[GRN] = (channels >= 2) ? fpscan[j + 1] : fpscan[j];
@@ -400,7 +399,7 @@ int imb_savehdr(struct ImBuf *ibuf, const char *name, int 
flags)
        if (ibuf->rect_float)
                fp = ibuf->rect_float + ibuf->channels * (height - 1) * width;
        
-       for (size_t y = height - 1; y >= 0; y--) {
+       for (size_t y = 0; y < height; y++) {
                if (fwritecolrs(file, width, ibuf->channels, cp, fp) < 0) {
                        fclose(file);
                        printf("HDR write error\n");

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to