From 4e28c79ce1dd8e2560b8efd133517538003fb8be Mon Sep 17 00:00:00 2001 From: augustin64 Date: Wed, 12 Jul 2023 14:55:59 +0200 Subject: [PATCH] Remove redundant definitions --- src/cnn/utils.c | 4 ++-- src/common/colors.c | 6 +++--- src/common/include/colors.h | 23 ++++++++--------------- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/cnn/utils.c b/src/cnn/utils.c index 025ca8d..b4a7c63 100644 --- a/src/cnn/utils.c +++ b/src/cnn/utils.c @@ -15,7 +15,7 @@ if (network1->var != network2->var) { \ printf_error((char*)"network1->" name " et network2->" name " ne sont pas égaux\n"); \ if (indice != -1) { \ - printf(BOLDBLUE "[ INFO_ ]" RESET " indice: %d\n", indice); \ + printf(BOLD BLUE "[ INFO_ ]" RESET " indice: %d\n", indice); \ } \ return false; \ } @@ -48,7 +48,7 @@ bool equals_networks(Network* network1, Network* network2) { checkEquals(kernel[i]->stride, "kernel[i]->stride", i); checkEquals(kernel[i]->padding, "kernel[i]->padding", i); if ((!network1->kernel[i]->cnn ^ !network2->kernel[i]->cnn) || (!network1->kernel[i]->nn ^ !network2->kernel[i]->nn)) { - printf(BOLDRED "[ ERROR ]" RESET "network1->kernel[%d] et network1->kernel[%d] diffèrent de type\n", i, i); + printf(BOLD RED "[ ERROR ]" RESET "network1->kernel[%d] et network1->kernel[%d] diffèrent de type\n", i, i); return false; } checkEquals(kernel[i]->linearisation, "kernel[i]->linearisation", i); diff --git a/src/common/colors.c b/src/common/colors.c index 0b368a5..509f5bb 100644 --- a/src/common/colors.c +++ b/src/common/colors.c @@ -5,15 +5,15 @@ #include "include/colors.h" void printf_error(char* string) { - printf(BOLDRED "[ ERROR ]" RESET " %s", string); + printf(BOLD RED "[ ERROR ]" RESET " %s", string); } void printf_warning(char* string) { - printf(BOLDYELLOW "[WARNING]" RESET " %s", string); + printf(BOLD YELLOW "[WARNING]" RESET " %s", string); } void printf_info(char* string) { - printf(BOLDBLUE "[ INFO ]" RESET " %s", string); + printf(BOLD BLUE "[ INFO ]" RESET " %s", string); } void printf_time(clock_t time) { diff --git a/src/common/include/colors.h b/src/common/include/colors.h index 9ff593a..e1aed4f 100644 --- a/src/common/include/colors.h +++ b/src/common/include/colors.h @@ -5,22 +5,15 @@ #define DEF_COLORS_H #define RESET "\033[0m" -#define BLACK "\033[30m" /* Black */ -#define RED "\033[31m" /* Red */ -#define GREEN "\033[32m" /* Green */ -#define YELLOW "\033[33m" /* Yellow */ -#define BLUE "\033[34m" /* Blue */ +#define BLACK "\033[30m" /* Black */ +#define RED "\033[31m" /* Red */ +#define GREEN "\033[32m" /* Green */ +#define YELLOW "\033[33m" /* Yellow */ +#define BLUE "\033[34m" /* Blue */ #define MAGENTA "\033[35m" /* Magenta */ -#define CYAN "\033[36m" /* Cyan */ -#define WHITE "\033[37m" /* White */ -#define BOLDBLACK "\033[1m\033[30m" /* Bold Black */ -#define BOLDRED "\033[1m\033[31m" /* Bold Red */ -#define BOLDGREEN "\033[1m\033[32m" /* Bold Green */ -#define BOLDYELLOW "\033[1m\033[33m" /* Bold Yellow */ -#define BOLDBLUE "\033[1m\033[34m" /* Bold Blue */ -#define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */ -#define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */ -#define BOLDWHITE "\033[1m\033[37m" /* Bold White */ +#define CYAN "\033[36m" /* Cyan */ +#define WHITE "\033[37m" /* White */ +#define BOLD "\033[1m" /* BOLD */ #ifdef __CUDACC__ extern "C"