From 4a611b50960c1dc35f21a38353033f2564b39f6a Mon Sep 17 00:00:00 2001 From: Andre Leiradella Date: Sun, 14 May 2017 21:59:29 +0100 Subject: [PATCH] Use next_pow2 --- cheevos/cheevos.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index f0708ffb7a..f262a1f85a 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -2394,19 +2395,6 @@ static int cheevos_deactivate_unlocks(const char* json, unsigned mode) } #endif -static INLINE unsigned cheevos_next_power_of_2(unsigned n) -{ - n--; - - n |= n >> 1; - n |= n >> 2; - n |= n >> 4; - n |= n >> 8; - n |= n >> 16; - - return n + 1; -} - void cheevos_reset_game(void) { cheevo_t *cheevo = cheevos_locals.core.cheevos; @@ -3052,7 +3040,7 @@ static int cheevos_iterate(coro_t* coro) } if (HEADER.rom_size) - ROMSIZE = cheevos_next_power_of_2(HEADER.rom_size); + ROMSIZE = next_pow2(HEADER.rom_size); else ROMSIZE = 256;