summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2013-03-26 21:36:30 +0100
committerBardur Arantsson <bardur@scientician.net>2013-09-27 14:46:42 +0200
commit27dfc9125b6fff1ec4dc869f6f644c45ec31d74f (patch)
tree10326d817fda0263243a9ecec7a963bd3cf34efc
parent2555c9c470fc19b77c24d3e534670c8e3904f186 (diff)
Fix format strings to avoid casts
This gets rid of old-style casts for C++ conversion
-rw-r--r--src/cmd4.c4
-rw-r--r--src/cmd7.c4
-rw-r--r--src/powers.c2
-rw-r--r--src/store.c6
4 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd4.c b/src/cmd4.c
index b74bfff9..0353f014 100644
--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -3820,7 +3820,7 @@ static void do_cmd_knowledge_kill_count(void)
}
else
{
- fprintf(fff, "You have defeated %ld enemies.\n\n", (long int) Total);
+ fprintf(fff, "You have defeated " FMTs32b " enemies.\n\n", Total);
}
}
@@ -3874,7 +3874,7 @@ static void do_cmd_knowledge_kill_count(void)
}
fprintf(fff, "----------------------------------------------\n");
- fprintf(fff, " Total: %ld creature%s killed.\n", (long int) Total, (Total == 1 ? "" : "s"));
+ fprintf(fff, " Total: " FMTs32b " creature%s killed.\n", Total, (Total == 1 ? "" : "s"));
/* Close the file */
my_fclose(fff);
diff --git a/src/cmd7.c b/src/cmd7.c
index eaed8996..c9be0c66 100644
--- a/src/cmd7.c
+++ b/src/cmd7.c
@@ -1229,10 +1229,10 @@ int show_flags(byte group, int pval)
(items < 26) ? I2A(items) : ('0' + items - 26),
al_name + a_select_flags[i].desc);
if ( wizard || alchemist_has_stone())
- sprintf(ttt, "%c) %s (exp %ld)",
+ sprintf(ttt, "%c) %s (exp " FMTu32b ")",
(items < 26) ? I2A(items) : ('0' + items - 26),
al_name + a_select_flags[i].desc,
- (long int) a_select_flags[i].xp);
+ a_select_flags[i].xp);
/* Note: Somebody is VERY clever, and it wasn't me. Text printed as
* TERM_DARK is actually printed as TERM_BLUE *SPACES* to prevent the
diff --git a/src/powers.c b/src/powers.c
index 7001a859..d6ecdecf 100644
--- a/src/powers.c
+++ b/src/powers.c
@@ -226,7 +226,7 @@ static void power_activate(int power)
else o_ptr = &o_list[0 - idx];
/* Appraise it */
- sprintf(value, "%i au", (int)object_value(o_ptr));
+ sprintf(value, FMTs32b " au", object_value(o_ptr));
/* Inscribe the value */
/* Get the original inscription */
diff --git a/src/store.c b/src/store.c
index fb413eb8..99d8dfa6 100644
--- a/src/store.c
+++ b/src/store.c
@@ -1619,7 +1619,7 @@ void display_store(void)
put_str(buf, 3, 10);
/* Show the max price in the store (above prices) */
- strnfmt(buf, 80, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
+ strnfmt(buf, 80, "%s (" FMTs16b ")", store_name, ot_ptr->max_cost);
prt(buf, 3, 50);
/* Label the item descriptions */
@@ -2273,7 +2273,7 @@ void store_purchase(void)
object_desc(o_name, j_ptr, TRUE, 3);
/* Message */
- msg_format("You bought %s for %ld gold.", o_name, (long)price);
+ msg_format("You bought %s for " FMTs32b " gold.", o_name, price);
/* Erase the inscription */
j_ptr->note = 0;
@@ -2605,7 +2605,7 @@ void store_sell(void)
object_desc(o_name, q_ptr, TRUE, 3);
/* Describe the result (in message buffer) */
- msg_format("You sold %s for %ld gold.", o_name, (long)price);
+ msg_format("You sold %s for " FMTs32b " gold.", o_name, price);
/* Analyze the prices (and comment verbally) */
purchase_analyze(price, value, dummy);