imbuf, mathutils & readfile: floats were being implicitly promoted to doubles, adjust...
[blender.git] / source / blender / imbuf / intern / divers.c
index ff98ac6016627e6824e14ba8c86b101213ce3de9..6b35d7df397fa31caa696bf0007976fc6ce1d82c 100644 (file)
@@ -109,7 +109,7 @@ void IMB_rect_from_float(struct ImBuf *ibuf)
        /* quick method to convert floatbuf to byte */
        float *tof = (float *)ibuf->rect_float;
 //     int do_dither = ibuf->dither != 0.f;
-       float dither= ibuf->dither / 255.0;
+       float dither= ibuf->dither / 255.0f;
        float srgb[4];
        int i, channels= ibuf->channels;
        short profile= ibuf->profile;
@@ -141,7 +141,7 @@ void IMB_rect_from_float(struct ImBuf *ibuf)
                else if (channels == 4) {
                        if (dither != 0.f) {
                                for (i = ibuf->x * ibuf->y; i > 0; i--, to+=4, tof+=4) {
-                                       const float d = (BLI_frand()-0.5)*dither;
+                                       const float d = (BLI_frand()-0.5f)*dither;
                                        
                                        srgb[0]= d + linearrgb_to_srgb(tof[0]);
                                        srgb[1]= d + linearrgb_to_srgb(tof[1]);
@@ -170,7 +170,7 @@ void IMB_rect_from_float(struct ImBuf *ibuf)
                else {
                        if (dither != 0.f) {
                                for (i = ibuf->x * ibuf->y; i > 0; i--, to+=4, tof+=4) {
-                                       const float d = (BLI_frand()-0.5)*dither;
+                                       const float d = (BLI_frand()-0.5f)*dither;
                                        float col[4];
 
                                        col[0]= d + tof[0];