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/bmp.c
parentee49ce482a797a5937829de497abd69bcd1edb48 (diff)
Cleanup: Clang-Tidy bugprone-incorrect-roundings fixes
Should cause no noticeable difference.
Diffstat (limited to 'source/blender/imbuf/intern/bmp.c')
-rw-r--r--source/blender/imbuf/intern/bmp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index 31f8b651eff..f517a3c15e8 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -21,6 +21,8 @@
* \ingroup imbuf
*/
+#include <math.h>
+
#include "BLI_fileops.h"
#include "BLI_utildefines.h"
@@ -327,8 +329,8 @@ int imb_savebmp(ImBuf *ibuf, const char *name, int UNUSED(flags))
putShortLSB(is_grayscale ? 8 : 24, ofile);
putIntLSB(0, ofile);
putIntLSB(bytesize, ofile);
- putIntLSB((int)(ibuf->ppm[0] + 0.5), ofile);
- putIntLSB((int)(ibuf->ppm[1] + 0.5), ofile);
+ putIntLSB(round(ibuf->ppm[0] + 0.5), ofile);
+ putIntLSB(round(ibuf->ppm[1] + 0.5), ofile);
putIntLSB(0, ofile);
putIntLSB(0, ofile);