maybe_unused

This commit is contained in:
kdx 2023-03-25 21:59:23 +01:00
parent 5f234d1ab3
commit 4184f46b44
3 changed files with 6 additions and 7 deletions

View File

@ -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 ||

View File

@ -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; }

View File

@ -16,9 +16,8 @@ game_init(Game *this)
}
void
game_deinit(Game *this)
game_deinit([[maybe_unused]] Game *this)
{
(void)this;
}
void