From 4184f46b44370874e759fdb7a0b6ff145d5f9306 Mon Sep 17 00:00:00 2001 From: kdx Date: Sat, 25 Mar 2023 21:59:23 +0100 Subject: maybe_unused --- src/entity.c | 3 +-- src/entityimpl.h | 7 ++++--- src/game.c | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/entity.c b/src/entity.c index 5f3a0dd..65af918 100644 --- a/src/entity.c +++ b/src/entity.c @@ -27,9 +27,8 @@ entity_type(const char *type) } bool -entity_collide(Entity *this, Game *g, int ox, int oy) +entity_collide(Entity *this, [[maybe_unused]] Game *g, int ox, int oy) { - (void)g; int x0, y0, x1, y1; _points(this, ox, oy, &x0, &x1, &y0, &y1); return (map_get_px(x0, y0) == 1 || map_get_px(x0, y1) == 1 || diff --git a/src/entityimpl.h b/src/entityimpl.h index 859b44c..adc4c09 100644 --- a/src/entityimpl.h +++ b/src/entityimpl.h @@ -5,8 +5,10 @@ #include "entitytag.h" #include -#define IMPL_UPDATE() static Entity*update(Entity*this,Game*g){(void)this,(void)g; -#define IMPL_DRAW() static Entity*draw(Entity*this,Game*g){(void)this,(void)g; +#define IMPL_UPDATE() static Entity * \ + update([[maybe_unused]] Entity *this, [[maybe_unused]] Game *g) { +#define IMPL_DRAW() static Entity * \ + draw([[maybe_unused]] Entity *this, [[maybe_unused]] Game *g) { #define IMPL_INIT(X) __attribute__((constructor)) static void init_tag() { \ entitytags[num_entitytags++] = #X; \ } \ @@ -18,5 +20,4 @@ Entity *X##_init(Entity *this, int x, int y) { do { \ this->pos[1] = y; \ this->type = entity_type(#X); \ } while(0); -#define IMPL_INIT_END #define IMPL_END return this; } diff --git a/src/game.c b/src/game.c index 95522b8..d35d7a9 100644 --- a/src/game.c +++ b/src/game.c @@ -16,9 +16,8 @@ game_init(Game *this) } void -game_deinit(Game *this) +game_deinit([[maybe_unused]] Game *this) { - (void)this; } void -- cgit v1.2.3