From 7b66b7726ba082cf1d9c2db7ba1dd74f2d8aa19a Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Sat, 27 Jan 2018 23:14:39 +0100 Subject: [PATCH] Fixed some MSVC compiler warnings. --- src/gui.c | 2 +- src/item_builder.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui.c b/src/gui.c index 9b9188f..64ff093 100644 --- a/src/gui.c +++ b/src/gui.c @@ -190,7 +190,7 @@ gui_render_panel(Gui *gui, unsigned int width, unsigned int height, Camera *cam) void gui_log(const char *fmt, ...) { - char buffer[log_data.strlen]; + char buffer[200]; char *new_message; unsigned int i; char tstamp[10]; diff --git a/src/item_builder.c b/src/item_builder.c index cc3379a..827c6d6 100644 --- a/src/item_builder.c +++ b/src/item_builder.c @@ -39,7 +39,7 @@ static void eat_flesh(Item *item, Player *player) { int original_hp = player->stats.hp; - player->stats.hp += item->value; + player->stats.hp += (int) item->value; if (player->stats.hp > player->stats.maxhp) player->stats.hp = player->stats.maxhp; @@ -50,7 +50,7 @@ static void drink_health(Item *item, Player *player) { int original_hp = player->stats.hp; - player->stats.hp += item->value; + player->stats.hp += (int) item->value; if (player->stats.hp > player->stats.maxhp) player->stats.hp = player->stats.maxhp; @@ -91,20 +91,20 @@ create_treasure(void) SDL_Rect clip = { 0, 0, 16, 16 }; switch (value) { case COPPER: - m_sprintf(&label[0], 50, "%d copper", amt); + m_sprintf(&label[0], 50, "%.0f copper", amt); amt /= 100; break; case SILVER: - m_sprintf(&label[0], 50, "%d silver", amt); + m_sprintf(&label[0], 50, "%.0f silver", amt); clip.x = 48; amt /= 10; break; case GOLD: - m_sprintf(&label[0], 50, "%d gold", amt); + m_sprintf(&label[0], 50, "%.0f gold", amt); clip.y = 16; break; case PLATINUM: - m_sprintf(&label[0], 50, "%d platinum", amt); + m_sprintf(&label[0], 50, "%.0f platinum", amt); clip.x = 48; clip.y = 16; amt *= 10;