1
0

template.c: cosmetic output improvements

This commit is contained in:
Intel A80486DX2-66 2024-01-12 20:58:10 +03:00
parent 76384284fe
commit bd02f2b6a6
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -277,10 +277,18 @@ main(void)
if (w % FREQUENCY_OF_STATUS_REPORTING == 0 || if (w % FREQUENCY_OF_STATUS_REPORTING == 0 ||
w >= product_minus_1 /* or if writing last sample */) { w >= product_minus_1 /* or if writing last sample */) {
printf( printf(
"%sremaining samples = %18" PRIuMAX " (%.2Lf%% done)", "%sremaining samples = %18" PRIuMAX " (%3.2Lf%% done)"
#if SEQUENTIAL_MODE
" (part %" PRIuMAX "/%" PRIuMAX ")"
#endif
,
ANSI_CLEAR, ANSI_CLEAR,
product_minus_1 - w, product_minus_1 - w,
((long double) w * 100) / (long double) PRODUCT); ((long double) w * 100) / (long double) PRODUCT
#if SEQUENTIAL_MODE
, (uintmax_t) seq + 1, (uintmax_t) MAX
#endif
);
fflush(stdout); fflush(stdout);
} }
#endif #endif
@ -290,13 +298,15 @@ main(void)
printf("%s", ANSI_CLEAR); printf("%s", ANSI_CLEAR);
// 5. log // 5. log
#if !(SEQUENTIAL_MODE && VERBOSE_MODE)
#if SEQUENTIAL_MODE #if SEQUENTIAL_MODE
printf("Writing out file " OUTPUT_FILE " (part %" PRIuMAX "/%" if (seq == 0)
PRIuMAX ", %.2Lf%%)...\n", (uintmax_t) seq + 1, #endif
(uintmax_t) MAX, printf(
((long double) seq * 100.L) / ((long double) MAX)); #if !SEQUENTIAL_MODE
#else "\n"
printf("\nWriting out file " OUTPUT_FILE "...\n"); #endif
"Writing out file " OUTPUT_FILE "...\n");
#endif #endif
fflush(stdout); fflush(stdout);
#endif #endif
@ -325,7 +335,11 @@ main(void)
// * end of program // * end of program
#if !SILENT_MODE #if !SILENT_MODE
printf("Done!\n"); printf(
#if SEQUENTIAL_MODE && VERBOSE_MODE
"\n"
#endif
"Done!\n");
#endif #endif
return 0; return 0;