summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-03-08 15:10:48 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-03-09 16:24:32 +0100
commit39d429e49705fe153a20dfb27421f1246237a683 (patch)
treece97a5171b951dc2e31ff12b84ce3a0637862ddc /core/io
parent922348f4c00e694961a7c9717abdcd0310c11973 (diff)
Change some math macros to constexpr
Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
Diffstat (limited to 'core/io')
-rw-r--r--core/io/image.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/image.cpp b/core/io/image.cpp
index 577fc59807..766c84bdbe 100644
--- a/core/io/image.cpp
+++ b/core/io/image.cpp
@@ -1465,8 +1465,8 @@ template <class Component, int CC, bool renormalize,
void (*renormalize_func)(Component *)>
static void _generate_po2_mipmap(const Component *p_src, Component *p_dst, uint32_t p_width, uint32_t p_height) {
//fast power of 2 mipmap generation
- uint32_t dst_w = MAX(p_width >> 1, 1);
- uint32_t dst_h = MAX(p_height >> 1, 1);
+ uint32_t dst_w = MAX(p_width >> 1, 1u);
+ uint32_t dst_h = MAX(p_height >> 1, 1u);
int right_step = (p_width == 1) ? 0 : CC;
int down_step = (p_height == 1) ? 0 : (p_width * CC);