diff --git a/src/template.c b/src/template.c index c00ecce..acf5632 100644 --- a/src/template.c +++ b/src/template.c @@ -122,6 +122,8 @@ main(void) } // * bytebeat generating loop + const uintmax_t product_minus_1 = PRODUCT - 1; + for (size_t w = 0; w < PRODUCT; w++) { // 1. generate audio data long double bytebeat_res = bytebeat((long double)w); @@ -146,11 +148,11 @@ main(void) // 6. log #if VERBOSE_MODE if (w % FREQUENCY_OF_STATUS_REPORTING == 0 || - w >= (PRODUCT - 1) /* or if writing last sample */) { + w >= product_minus_1 /* or if writing last sample */) { printf( "%sremaining samples = %18" PRIuMAX " (%.2Lf%% done)", ANSI_CLEAR, - PRODUCT - w - 1, + product_minus_1 - w, ((long double) w * 100) / (long double) PRODUCT); fflush(stdout); }