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