patch [#30227] Various MSVC (32-bit) Warning and Typo Fixes
[blender-staging.git] / source / blender / blenlib / intern / math_color_inline.c
index 386452ed5925331c30501459580f6918caee8095..f8b986e799b169395a20d3c4da8c393468ac6166 100644 (file)
@@ -163,7 +163,7 @@ MINLINE void linearrgb_to_srgb_ushort4_predivide(unsigned short srgb[4], const f
 
        for(i=0; i<3; ++i) {
                t = linear[i] * inv_alpha;
-               srgb[i] = (t < 1.0f)? to_srgb_table_lookup(t) * alpha : FTOUSHORT(linearrgb_to_srgb(t) * alpha);
+               srgb[i] = (t < 1.0f)? (unsigned short)(to_srgb_table_lookup(t) * alpha) : FTOUSHORT(linearrgb_to_srgb(t) * alpha);
        }
 
        srgb[3] = FTOUSHORT(linear[3]);