From 905eeb0bc7f46efb95cb5450cc6c2ec27f02730c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 7 May 2018 17:14:28 +0200 Subject: Cleanup: move unit char/short/float to functions This caused GCC 8.1 to crash at build time, but was also not very nice use of macros. --- source/blender/imbuf/intern/filter.c | 1 + source/blender/imbuf/intern/scaling.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c index 38609d0a342..27711618cee 100644 --- a/source/blender/imbuf/intern/filter.c +++ b/source/blender/imbuf/intern/filter.c @@ -34,6 +34,7 @@ #include "MEM_guardedalloc.h" #include "BLI_utildefines.h" +#include "BLI_math_base.h" #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index ff92ce15811..1c0b47f7942 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -332,9 +332,9 @@ MINLINE void premul_ushort_to_straight_uchar(unsigned char *result, const unsign else { unsigned short alpha = color[3] / 256; - result[0] = USHORTTOUCHAR(color[0] / alpha * 256); - result[1] = USHORTTOUCHAR(color[1] / alpha * 256); - result[2] = USHORTTOUCHAR(color[2] / alpha * 256); + result[0] = USHORTTOUCHAR((ushort)(color[0] / alpha * 256)); + result[1] = USHORTTOUCHAR((ushort)(color[1] / alpha * 256)); + result[2] = USHORTTOUCHAR((ushort)(color[2] / alpha * 256)); result[3] = USHORTTOUCHAR(color[3]); } } -- cgit v1.2.3