Mercurial > hg > early-roguelike
diff urogue/trader.c @ 300:0250220d8cdd
Fix an assortment of compiler warnings.
A few potential bugs were removed in the process. Much code cleanup
remains to be done.
author | John "Elwin" Edwards |
---|---|
date | Fri, 22 Nov 2019 21:18:27 -0500 |
parents | c495a4f288c6 |
children |
line wrap: on
line diff
--- a/urogue/trader.c Sun Feb 11 15:37:33 2018 -0500 +++ b/urogue/trader.c Fri Nov 22 21:18:27 2019 -0500 @@ -257,7 +257,7 @@ for(i=0,m_item=magic_array; i < array_size; i++, m_item++) if (!is_spell && m_item->mi_worth > 0) { - sprintf(buf, "%3d) %8d %s", i, m_item->mi_worth, + sprintf(buf, "%3d) %8ld %s", i, m_item->mi_worth, m_item->mi_name); add_line(buf); } @@ -267,7 +267,7 @@ for (i = 0; i < array_size; i++) if (!is_spell && armors[i].a_worth > 0) { - sprintf(buf, "%3d) %8d %s", i, armors[i].a_worth, + sprintf(buf, "%3d) %8ld %s", i, armors[i].a_worth, armors[i].a_name); add_line(buf); @@ -278,7 +278,7 @@ for (i = 0; i < array_size; i++) if (!is_spell && weaps[i].w_worth > 0) { - sprintf(buf, "%3d) %8d %s", i, weaps[i].w_worth, + sprintf(buf, "%3d) %8ld %s", i, weaps[i].w_worth, weaps[i].w_name); add_line(buf); } @@ -646,7 +646,7 @@ else charp = normal_d[rnd(sizeof(normal_d) / sizeof(char *))]; - sprintf(buf, "It's a%s %s worth %d pieces of gold.", + sprintf(buf, "It's a%s %s worth %ld pieces of gold.", vowelstr(charp), charp, obj->o_worth); mvwaddstr(hw, 10, 0, inv_name(obj, TRUE)); @@ -794,11 +794,11 @@ int adorned = is_wearing(R_ADORNMENT); if (level == 0 && purse > 0) - sprintf(buf, "You still have %d pieces of gold left.", purse); + sprintf(buf, "You still have %ld pieces of gold left.", purse); else if (purse == 0) sprintf(buf, "You have no money left."); else if (!wizard) - sprintf(buf, "You have %d transactions and %d gold pieces remaining.", + sprintf(buf, "You have %d transactions and %ld gold pieces remaining.", max(0, (adorned ? MAXPURCH + 4 : MAXPURCH) - player.t_trans), EFFECTIVE_PURSE); else