summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-03-25 21:59:23 +0100
committerkdx <kikoodx@paranoici.org>2023-03-25 21:59:23 +0100
commit4184f46b44370874e759fdb7a0b6ff145d5f9306 (patch)
treec5e6dbc5de8d8419060f8c469cf33307ef2520e5
parent5f234d1ab3d6dbb824e12d4e07abf659fc3de2a7 (diff)
downloadhyperultra-4184f46b44370874e759fdb7a0b6ff145d5f9306.tar.gz
maybe_unused
-rw-r--r--src/entity.c3
-rw-r--r--src/entityimpl.h7
-rw-r--r--src/game.c3
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 <string.h>
-#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