template.c: fix conditional compilation
This commit is contained in:
parent
d326f32193
commit
8244326d22
@ -199,13 +199,12 @@ main(void)
|
||||
|
||||
size_t w = 0;
|
||||
for (size_t seq = 0; seq < MAX; seq++) {
|
||||
#else
|
||||
do {
|
||||
#endif
|
||||
size_t calc_block_size = BLOCK_SIZE;
|
||||
if ((w + BLOCK_SIZE) >= PRODUCT)
|
||||
calc_block_size = PRODUCT - w;
|
||||
|
||||
#else
|
||||
do {
|
||||
#endif
|
||||
// * allocate heap for sample data
|
||||
SAMPLE_TYPE* buffer = calloc(
|
||||
#if SEQUENTIAL_MODE
|
||||
@ -314,10 +313,8 @@ main(void)
|
||||
fflush(output_file);
|
||||
#endif
|
||||
|
||||
#if SEQUENTIAL_MODE
|
||||
// * free allocated heap
|
||||
free(buffer);
|
||||
#endif
|
||||
}
|
||||
#if !SEQUENTIAL_MODE
|
||||
while (0);
|
||||
@ -326,11 +323,6 @@ main(void)
|
||||
// 6. close file
|
||||
fclose(output_file);
|
||||
|
||||
#if !SEQUENTIAL_MODE
|
||||
// * free allocated heap
|
||||
free(buffer);
|
||||
#endif
|
||||
|
||||
// * end of program
|
||||
#if !SILENT_MODE
|
||||
printf("Done!\n");
|
||||
|
Loading…
Reference in New Issue
Block a user