diff options
author | rubidium <rubidium@openttd.org> | 2011-12-09 22:07:00 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-12-09 22:07:00 +0000 |
commit | 6153dc57f5ec5f24868703133a0a1295e2e1971f (patch) | |
tree | 08b7d43ad6e8023cd8680d0b19bf6416ada236b0 /src/core | |
parent | dcba6c25ea0cad50dc779f8df359bdd45b6def26 (diff) | |
download | openttd-6153dc57f5ec5f24868703133a0a1295e2e1971f.tar.xz |
(svn r23466) -Fix [FS#4871, FS#4874]: assertion triggered when resizing a window during ReInit by an amount that's not a multiple of the resize interval
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/math_func.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index 92893ed31..42c41abad 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -330,6 +330,17 @@ static FORCEINLINE uint CeilDiv(uint a, uint b) } /** + * Computes ceil(a / b) * b for non-negative a and b. + * @param a Numerator + * @param b Denominator + * @return a rounded up to the nearest multiple of b. + */ +static FORCEINLINE uint Ceil(uint a, uint b) +{ + return CeilDiv(a, b) * b; +} + +/** * Computes round(a / b) for signed a and unsigned b. * @param a Numerator * @param b Denominator |