From 790598fa609accde463bbda9c990dd55f881940c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 18 May 2022 21:31:10 +0200 Subject: [PATCH] Cleanup: BLI_math_base.h: Document `power_of_2_max|min()` --- source/blender/blenlib/BLI_math_base.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index f9c05fb116e..f072a17f384 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -204,14 +204,18 @@ MINLINE int integer_digits_i(int i); /* These don't really fit anywhere but were being copied about a lot. */ MINLINE int is_power_of_2_i(int n); -MINLINE int power_of_2_max_i(int n); -MINLINE int power_of_2_min_i(int n); -MINLINE unsigned int power_of_2_max_u(unsigned int x); -MINLINE unsigned int power_of_2_min_u(unsigned int x); MINLINE unsigned int log2_floor_u(unsigned int x); MINLINE unsigned int log2_ceil_u(unsigned int x); +/** + * Returns next (or previous) power of 2 or the input number if it is already a power of 2. + */ +MINLINE int power_of_2_max_i(int n); +MINLINE int power_of_2_min_i(int n); +MINLINE unsigned int power_of_2_max_u(unsigned int x); +MINLINE unsigned int power_of_2_min_u(unsigned int x); + /** * Integer division that rounds 0.5 up, particularly useful for color blending * with integers, to avoid gradual darkening when rounding down.