Mercurial > hg > early-roguelike
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 299:74351bf23e5e | 300:0250220d8cdd |
|---|---|
| 255 case TYP_FOOD: | 255 case TYP_FOOD: |
| 256 | 256 |
| 257 for(i=0,m_item=magic_array; i < array_size; i++, m_item++) | 257 for(i=0,m_item=magic_array; i < array_size; i++, m_item++) |
| 258 if (!is_spell && m_item->mi_worth > 0) | 258 if (!is_spell && m_item->mi_worth > 0) |
| 259 { | 259 { |
| 260 sprintf(buf, "%3d) %8d %s", i, m_item->mi_worth, | 260 sprintf(buf, "%3d) %8ld %s", i, m_item->mi_worth, |
| 261 m_item->mi_name); | 261 m_item->mi_name); |
| 262 add_line(buf); | 262 add_line(buf); |
| 263 } | 263 } |
| 264 break; | 264 break; |
| 265 | 265 |
| 266 case TYP_ARMOR: | 266 case TYP_ARMOR: |
| 267 for (i = 0; i < array_size; i++) | 267 for (i = 0; i < array_size; i++) |
| 268 if (!is_spell && armors[i].a_worth > 0) | 268 if (!is_spell && armors[i].a_worth > 0) |
| 269 { | 269 { |
| 270 sprintf(buf, "%3d) %8d %s", i, armors[i].a_worth, | 270 sprintf(buf, "%3d) %8ld %s", i, armors[i].a_worth, |
| 271 armors[i].a_name); | 271 armors[i].a_name); |
| 272 | 272 |
| 273 add_line(buf); | 273 add_line(buf); |
| 274 } | 274 } |
| 275 break; | 275 break; |
| 276 | 276 |
| 277 case TYP_WEAPON: | 277 case TYP_WEAPON: |
| 278 for (i = 0; i < array_size; i++) | 278 for (i = 0; i < array_size; i++) |
| 279 if (!is_spell && weaps[i].w_worth > 0) | 279 if (!is_spell && weaps[i].w_worth > 0) |
| 280 { | 280 { |
| 281 sprintf(buf, "%3d) %8d %s", i, weaps[i].w_worth, | 281 sprintf(buf, "%3d) %8ld %s", i, weaps[i].w_worth, |
| 282 weaps[i].w_name); | 282 weaps[i].w_name); |
| 283 add_line(buf); | 283 add_line(buf); |
| 284 } | 284 } |
| 285 break; | 285 break; |
| 286 | 286 |
| 644 else if (obj->o_flags & ISCURSED) | 644 else if (obj->o_flags & ISCURSED) |
| 645 charp = cursed_d[rnd(sizeof(cursed_d) / sizeof(char *))]; | 645 charp = cursed_d[rnd(sizeof(cursed_d) / sizeof(char *))]; |
| 646 else | 646 else |
| 647 charp = normal_d[rnd(sizeof(normal_d) / sizeof(char *))]; | 647 charp = normal_d[rnd(sizeof(normal_d) / sizeof(char *))]; |
| 648 | 648 |
| 649 sprintf(buf, "It's a%s %s worth %d pieces of gold.", | 649 sprintf(buf, "It's a%s %s worth %ld pieces of gold.", |
| 650 vowelstr(charp), charp, obj->o_worth); | 650 vowelstr(charp), charp, obj->o_worth); |
| 651 | 651 |
| 652 mvwaddstr(hw, 10, 0, inv_name(obj, TRUE)); | 652 mvwaddstr(hw, 10, 0, inv_name(obj, TRUE)); |
| 653 mvwaddstr(hw, 11, 0, buf); | 653 mvwaddstr(hw, 11, 0, buf); |
| 654 wclrtoeol(hw); | 654 wclrtoeol(hw); |
| 792 { | 792 { |
| 793 char buf[2 * LINELEN]; | 793 char buf[2 * LINELEN]; |
| 794 int adorned = is_wearing(R_ADORNMENT); | 794 int adorned = is_wearing(R_ADORNMENT); |
| 795 | 795 |
| 796 if (level == 0 && purse > 0) | 796 if (level == 0 && purse > 0) |
| 797 sprintf(buf, "You still have %d pieces of gold left.", purse); | 797 sprintf(buf, "You still have %ld pieces of gold left.", purse); |
| 798 else if (purse == 0) | 798 else if (purse == 0) |
| 799 sprintf(buf, "You have no money left."); | 799 sprintf(buf, "You have no money left."); |
| 800 else if (!wizard) | 800 else if (!wizard) |
| 801 sprintf(buf, "You have %d transactions and %d gold pieces remaining.", | 801 sprintf(buf, "You have %d transactions and %ld gold pieces remaining.", |
| 802 max(0, (adorned ? MAXPURCH + 4 : MAXPURCH) - player.t_trans), | 802 max(0, (adorned ? MAXPURCH + 4 : MAXPURCH) - player.t_trans), |
| 803 EFFECTIVE_PURSE); | 803 EFFECTIVE_PURSE); |
| 804 else | 804 else |
| 805 sprintf(buf, "You have infinite transactions remaining."); | 805 sprintf(buf, "You have infinite transactions remaining."); |
| 806 | 806 |
