Codacy fixes

This commit is contained in:
Linus_Probert 2018-01-23 14:37:58 +01:00
parent dc7927c6b0
commit d6e6e9449a
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

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