Clean up indentation

This commit is contained in:
Martin Lund 2022-09-18 19:20:12 +02:00
parent e54a13827b
commit ce3101a380
4 changed files with 118 additions and 112 deletions

View file

@ -35,72 +35,78 @@ extern char ansi_format[];
#define ansi_printf(format, args...) \
{ \
if (!option.mute) { \
if (option.color < 0) \
fprintf (stdout, "\r" format "\r\n", ## args); \
else \
fprintf (stdout, "\r%s" format ANSI_RESET "\r\n", ansi_format, ## args); \
} \
if (!option.mute) \
{ \
if (option.color < 0) \
fprintf (stdout, "\r" format "\r\n", ## args); \
else \
fprintf (stdout, "\r%s" format ANSI_RESET "\r\n", ansi_format, ## args); \
} \
}
#define ansi_error_printf(format, args...) \
{ \
if (!option.mute) { \
if (option.color < 0) \
fprintf (stderr, "\r" format "\r\n", ## args); \
else \
fprintf (stderr, "\r%s" format ANSI_RESET "\r\n", ansi_format, ## args); \
fflush(stderr); \
} \
if (!option.mute) \
{ \
if (option.color < 0) \
fprintf (stderr, "\r" format "\r\n", ## args); \
else \
fprintf (stderr, "\r%s" format ANSI_RESET "\r\n", ansi_format, ## args); \
fflush(stderr); \
} \
}
#define ansi_printf_raw(format, args...) \
{ \
if (!option.mute) { \
if (option.color < 0) \
fprintf (stdout, format, ## args); \
else \
fprintf (stdout, "%s" format ANSI_RESET, ansi_format, ## args); \
} \
if (!option.mute) \
{ \
if (option.color < 0) \
fprintf (stdout, format, ## args); \
else \
fprintf (stdout, "%s" format ANSI_RESET, ansi_format, ## args); \
} \
}
#define tio_warning_printf(format, args...) \
{ \
if (!option.mute) { \
if (print_tainted) \
putchar('\n'); \
if (option.color < 0) \
fprintf (stdout, "\r[%s] Warning: " format "\r\n", timestamp_current_time(), ## args); \
else \
ansi_printf("[%s] Warning: " format, timestamp_current_time(), ## args); \
} \
if (!option.mute) \
{ \
if (print_tainted) \
putchar('\n'); \
if (option.color < 0) \
fprintf (stdout, "\r[%s] Warning: " format "\r\n", timestamp_current_time(), ## args); \
else \
ansi_printf("[%s] Warning: " format, timestamp_current_time(), ## args); \
} \
}
#define tio_printf(format, args...) \
{ \
if (!option.mute) { \
if (print_tainted) \
putchar('\n'); \
ansi_printf("[%s] " format, timestamp_current_time(), ## args); \
print_tainted = false; \
} \
if (!option.mute) \
{ \
if (print_tainted) \
putchar('\n'); \
ansi_printf("[%s] " format, timestamp_current_time(), ## args); \
print_tainted = false; \
} \
}
#define tio_printf_raw(format, args...) \
{ \
if (!option.mute) { \
if (print_tainted) \
putchar('\n'); \
ansi_printf_raw("[%s] " format, timestamp_current_time(), ## args); \
print_tainted = false; \
} \
if (!option.mute) \
{ \
if (print_tainted) \
putchar('\n'); \
ansi_printf_raw("[%s] " format, timestamp_current_time(), ## args); \
print_tainted = false; \
} \
}
#ifdef DEBUG
#define tio_debug_printf(format, args...) \
fprintf (stdout, "[debug] " format, ## args)
fprintf(stdout, "[debug] " format, ## args)
#define tio_debug_printf_raw(format, args...) \
fprintf (stdout, "" format, ## args)
fprintf(stdout, "" format, ## args)
#else
#define tio_debug_printf(format, args...)
#define tio_debug_printf_raw(format, args...)