diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-07 18:14:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-07 18:50:25 +0300 |
commit | 905eeb0bc7f46efb95cb5450cc6c2ec27f02730c (patch) | |
tree | 79e17a6e7581f1cf6307d576f6c5dc50b4cb155c /source/blender/imbuf/intern | |
parent | 66ec3c7e7f9c8485ee30b5d359965c631d08b38d (diff) |
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.
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/filter.c | 1 | ||||
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 6 |
2 files changed, 4 insertions, 3 deletions
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]); } } |