Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-09-04 17:23:00 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-09-04 17:23:08 +0300
commitfb5e2f56109e825ce3c446f80e075ee3dde81c3d (patch)
tree20b5808415568f503b4ed4b56d3d4f50b5fe8cee /source/blender/imbuf/intern/filter.c
parentee49ce482a797a5937829de497abd69bcd1edb48 (diff)
Cleanup: Clang-Tidy bugprone-incorrect-roundings fixes
Should cause no noticeable difference.
Diffstat (limited to 'source/blender/imbuf/intern/filter.c')
-rw-r--r--source/blender/imbuf/intern/filter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c
index 12f90f27309..cce264624ce 100644
--- a/source/blender/imbuf/intern/filter.c
+++ b/source/blender/imbuf/intern/filter.c
@@ -22,6 +22,8 @@
* \ingroup imbuf
*/
+#include <math.h>
+
#include "MEM_guardedalloc.h"
#include "BLI_math_base.h"
@@ -527,7 +529,7 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
else {
for (c = 0; c < depth; c++) {
((unsigned char *)dstbuf)[depth * index + c] =
- acc[c] > 255 ? 255 : (acc[c] < 0 ? 0 : ((unsigned char)(acc[c] + 0.5f)));
+ acc[c] > 255 ? 255 : (acc[c] < 0 ? 0 : (unsigned char)roundf(acc[c]));
}
}