1
0

template.c: precalculate before loop where applicable

This commit is contained in:
Intel A80486DX2-66 2024-05-19 20:47:38 +03:00
parent 3bab4c8373
commit 24317101c0
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -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++) {