From 60dfb616282023dbc1f567355357e27018693077 Mon Sep 17 00:00:00 2001 From: tslil Date: Sun, 3 Jan 2021 17:20:39 -0500 Subject: Incorrect usage of globals in header --- include/tak.c | 11 +++++++++++ include/tak.h | 12 ++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/include/tak.c b/include/tak.c index 3a8dff4..b1a20f2 100644 --- a/include/tak.c +++ b/include/tak.c @@ -1,5 +1,16 @@ #include "tak.h" +// =================================================================== +// Globals +// =================================================================== + +enum WIN_TYPE won; +uint8_t board_size; +data_t celldat[36]; +colour_stack_t colours[36]; +enum COLOUR current_colour; +uint8_t white_count, black_count, ply; + // =================================================================== // Helpers // =================================================================== diff --git a/include/tak.h b/include/tak.h index f6cde6a..a398b51 100644 --- a/include/tak.h +++ b/include/tak.h @@ -22,12 +22,12 @@ typedef uint16_t colour_stack_t; #define COUNT_AT(l) (celldat[(l)] >> NUM_SHIFT) #define THE_COORDS(col,row) ((col)+(row)*board_size) -enum WIN_TYPE won; -uint8_t board_size; -data_t celldat[36]; -colour_stack_t colours[36]; -enum COLOUR current_colour; -uint8_t white_count, black_count, ply; +extern enum WIN_TYPE won; +extern uint8_t board_size; +extern data_t celldat[36]; +extern colour_stack_t colours[36]; +extern enum COLOUR current_colour; +extern uint8_t white_count, black_count, ply; void reset_state(const uint8_t new_board_size); void next_ply(void); -- cgit v1.3.1