From d6e6e9449aafb31ef3c2e55a4fa052fc319267a8 Mon Sep 17 00:00:00 2001 From: Linus_Probert Date: Tue, 23 Jan 2018 14:37:58 +0100 Subject: [PATCH] Codacy fixes --- src/gui.c | 2 +- src/monster.c | 2 +- src/player.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui.c b/src/gui.c index 0ca039d..cb3391d 100644 --- a/src/gui.c +++ b/src/gui.c @@ -213,7 +213,6 @@ gui_render_log(Gui *gui, unsigned int width, unsigned int height, Camera *cam) { static SDL_Color color = { 255, 255, 255, 255 }; - Texture *t; unsigned int i; unsigned int render_count; Position p; @@ -224,6 +223,7 @@ gui_render_log(Gui *gui, unsigned int width, unsigned int height, Camera *cam) gui_render_frame(gui, width/16, height/16, cam); for (i = 0; i < render_count; ++i) { + Texture *t; p.y = 16 + ((LOG_FONT_SIZE+1) * i); t = gui->log_lines[i]; texture_load_from_text(t, log_data.log[i], color, cam->renderer); diff --git a/src/monster.c b/src/monster.c index 607b4f4..88bfdea 100644 --- a/src/monster.c +++ b/src/monster.c @@ -69,7 +69,7 @@ has_collided(Monster *monster, RoomMatrix *matrix) player_hit(space->player, dmg); if (dmg > 0) - sprintf(msg, "Monster '%s' hit you for %d damage", + sprintf(msg, "Monster '%s' hit you for %u damage", monster->label, dmg); else sprintf(msg, "Monster '%s' missed you", monster->label); diff --git a/src/player.c b/src/player.c index 3a1956e..238336d 100644 --- a/src/player.c +++ b/src/player.c @@ -39,7 +39,7 @@ has_collided(Player *player, RoomMatrix *matrix) if (hit > 0) { char *msg = ec_malloc(200 * sizeof(char)); - sprintf(msg, "You hit '%s' for %d damage", + sprintf(msg, "You hit '%s' for %u damage", space->monster->label, hit); gui_log(msg); free(msg);