Compare commits

...

3 Commits

Author SHA1 Message Date
Xavier Del Campo Romero 9ea32db5eb
player.c: Add missing header
As required by rand(3).
2024-01-30 01:13:56 +01:00
Xavier Del Campo Romero 2d8a171ad5
human_player_gui.c: Rename on_exit to on_btn_exit
Surprisingly, glibc declares on_exit(3) as a non-portable function on
stdlib.h.
2024-01-30 01:13:07 +01:00
Xavier Del Campo Romero da42dfab9f
init.c: Add missing #include
As required by PRIx8.
2024-01-30 01:12:57 +01:00
3 changed files with 4 additions and 2 deletions

View File

@ -56,7 +56,7 @@ static void on_add_walker(void *const arg)
it->show = false;
}
static void on_exit(void *const arg)
static void on_btn_exit(void *const arg)
{
struct human_player *const h = arg;
@ -117,7 +117,7 @@ static void update_items(struct human_player *const h)
b->u.type1.w = 80;
b->common.hcentered = true;
b->u.type1.label.text = "Exit";
b->on_pressed = on_exit;
b->on_pressed = on_btn_exit;
b->arg = h;
gui_add_child(&it->topcnt.common, &b->common);
}

View File

@ -3,6 +3,7 @@
#include <unit.h>
#include <terrain.h>
#include <stddef.h>
#include <stdlib.h>
void player_update(struct player *const p)
{

View File

@ -1,6 +1,7 @@
#include <terrain.h>
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stddef.h>
#include <stdint.h>