diff --git a/src/template.c b/src/template.c index c368ba7..e6c528d 100644 --- a/src/template.c +++ b/src/template.c @@ -187,7 +187,7 @@ main(void) // 4. write sample data #if SEQUENTIAL_MODE - const size_t BLOCK_SIZE = BLOCK_SIZE_BYTES / (sizeof(SAMPLE_TYPE) / + size_t BLOCK_SIZE = BLOCK_SIZE_BYTES / (sizeof(SAMPLE_TYPE) / sizeof(uint8_t)); if (BLOCK_SIZE < 1) { printf("The block size %" PRIuMAX " is too small, should be at least " @@ -195,13 +195,8 @@ main(void) (uintmax_t) (sizeof(SAMPLE_TYPE) / sizeof(uint8_t))); exit(EXIT_FAILURE); } - const size_t MAX = -#if BLOCK_SIZE > 0 - (PRODUCT + (BLOCK_SIZE - 1)) / BLOCK_SIZE -#else - 0 -#endif - ; + + const size_t MAX = (PRODUCT + (BLOCK_SIZE - 1)) / BLOCK_SIZE; size_t w = 0; for (size_t seq = 0; seq < MAX; seq++) {