diff options
| -rw-r--r-- | src/player/inc/human_player.h | 3 | ||||
| -rw-r--r-- | src/player/inc/player.h | 4 | ||||
| -rw-r--r-- | src/player/src/human_player.c | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/player/inc/human_player.h b/src/player/inc/human_player.h index 39a0d6d..fc6dd07 100644 --- a/src/player/inc/human_player.h +++ b/src/player/inc/human_player.h @@ -9,6 +9,7 @@ #include <peripheral.h> #include <player.h> #include <stdbool.h> +#include <stdint.h> #include <stddef.h> #ifdef __cplusplus @@ -60,7 +61,7 @@ struct human_player size_t n_sel; bool top_gui; - unsigned long gui_res[MAX_RESOURCE_TYPES]; + uint32_t gui_res[MAX_RESOURCE_TYPES]; }; int human_player_init(const struct human_player_cfg *cfg, struct human_player *h); diff --git a/src/player/inc/player.h b/src/player/inc/player.h index 25f4d81..153740c 100644 --- a/src/player/inc/player.h +++ b/src/player/inc/player.h @@ -36,8 +36,8 @@ struct player bool alive; struct unit units[PLAYER_MAX_UNITS]; struct building buildings[PLAYER_MAX_BUILDINGS]; - unsigned long resources[MAX_RESOURCE_TYPES]; - size_t pop, bpop; + uint32_t resources[MAX_RESOURCE_TYPES]; + unsigned char pop, bpop; struct { diff --git a/src/player/src/human_player.c b/src/player/src/human_player.c index a70eddf..aea587c 100644 --- a/src/player/src/human_player.c +++ b/src/player/src/human_player.c @@ -726,6 +726,8 @@ int human_player_init(const struct human_player_cfg *const cfg, cursor_init(&h->cam.cursor); h->cam.dim = cfg->dim; h->top_gui = true; + UTIL_STATIC_ASSERT(sizeof h->gui_res == sizeof h->pl.resources, + "unexpected sizeof for h->gui_res"); memmove(h->gui_res, h->pl.resources, sizeof h->gui_res); return 0; } |
