X-Git-Url: https://git.piment-noir.org/?p=Project_algorithmic_C.git;a=blobdiff_plain;f=lib%2Fdebug.c;fp=lib%2Fdebug.c;h=e6631c6462592998255b3f784d5959f20eb4ff1f;hp=a9ccc608c818d767592ee363c5e96178afc20723;hb=c8c562de07c5dcd2fd557ed100cf62a15140bbe4;hpb=acd1c2e821764097e70281ac5d0f13a7fd10f9c2 diff --git a/lib/debug.c b/lib/debug.c index a9ccc60..e6631c6 100644 --- a/lib/debug.c +++ b/lib/debug.c @@ -21,27 +21,17 @@ #include "othello.h" #include "debug.h" -#if BUILD_TYPE == debug -void dbg_mvprintw(int y, int x, const char* debug_text, ...) { - va_list func_args; - char debug_msg[256]; - - snprintf(debug_msg, sizeof(debug_msg), "%s%s", "DEBUG: ", debug_text); - va_start(func_args, debug_text); - mvprintw(y, x, debug_msg, func_args); - va_end(func_args); -} -#else -void dbg_mvprintw(int y, int x, const char* debug_text, ...); -#endif - +#if DEBUG void display_array(int base_y, int base_x, unsigned int pawn_array[board_size][board_size]) { for (int i = 1; i <= board_size; i++) { - dbg_mvprintw(base_y + i, base_x, "%d", i); + mvprintw(base_y + i, base_x, "%d", i); for (int j = 1; j <= board_size; j++) { - dbg_mvprintw(base_y, base_x + j, "%d", j); - dbg_mvprintw(base_y + i, base_x + j, "%d", get_box_value(i, j, pawn_array)); + mvprintw(base_y, base_x + j, "%d", j); + mvprintw(base_y + i, base_x + j, "%d", get_box_value(i, j, pawn_array)); } } } +#else +void display_array(int base_y, int base_x, unsigned int pawn_array[board_size][board_size]) { } +#endif /* DEBUG */