From 24317101c0e81ea216958ce4c54f7393efb304f4 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Sun, 19 May 2024 20:47:38 +0300 Subject: [PATCH] template.c: precalculate before loop where applicable --- src/template.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/template.c b/src/template.c index a437855..6af8835 100644 --- a/src/template.c +++ b/src/template.c @@ -241,6 +241,17 @@ main(void) #endif #if SEQUENTIAL_MODE + const uintmax_t gen_length_minus_1 = GEN_LENGTH - 1, + bit_depth_limiter = BIT_DEPTH_LIMITER +#if FP_RETURN_TYPE + + 1 +#endif +#if BIT_DEPTH < 8 + , + bit_depth_stretch = ((long double) BIT_DEPTH) / 8.L +#endif + ; + size_t time = 0; for (size_t seq = 0; seq < MAX; seq++) { if ((time + BLOCK_SIZE) >= GEN_LENGTH) @@ -248,17 +259,6 @@ main(void) #endif // * bytebeat generating loop - const uintmax_t gen_length_minus_1 = GEN_LENGTH - 1, - bit_depth_limiter = BIT_DEPTH_LIMITER -#if FP_RETURN_TYPE - + 1 -#endif -#if BIT_DEPTH < 8 - , - bit_depth_stretch = ((long double) BIT_DEPTH) / 8.L -#endif - ; - #if SEQUENTIAL_MODE for (size_t idx = 0; idx < BLOCK_SIZE && time < GEN_LENGTH; idx++, time++) {