From 171e77c3c25a1224fc5f7db40ec6f8879f8dbbb0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Aug 2020 13:29:21 +1000 Subject: Cleanup: use array syntax for sizeof with fixed values Also order sizeof(..) first to promote other values to size_t. --- source/blender/imbuf/intern/divers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/imbuf/intern/divers.c') diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index bcc8488089d..798849f2dd4 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -666,7 +666,7 @@ void IMB_buffer_byte_from_byte(uchar *rect_to, if (profile_to == profile_from) { /* same profile, copy */ - memcpy(to, from, sizeof(uchar) * 4 * width); + memcpy(to, from, sizeof(uchar[4]) * width); } else if (profile_to == IB_PROFILE_LINEAR_RGB) { /* convert to sRGB to linear */ @@ -785,7 +785,7 @@ void IMB_float_from_rect(ImBuf *ibuf) size_t size; size = ((size_t)ibuf->x) * ibuf->y; - size = size * 4 * sizeof(float); + size = sizeof(float[4]) * size; ibuf->channels = 4; rect_float = MEM_callocN(size, "IMB_float_from_rect"); -- cgit v1.2.3