OSDN Git Service

add type casting for fprintf
[hengband/hengband.git] / src / bldg.c
index 36819ed..7317586 100644 (file)
@@ -129,9 +129,9 @@ static void show_building(building_type* bldg)
                                {
                                        action_color = TERM_YELLOW;
 #ifdef JP
-sprintf(buff, "($%ld)", bldg->member_costs[i]);
+sprintf(buff, "($%ld)", (long int)bldg->member_costs[i]);
 #else
-                                       sprintf(buff, "(%ldgp)", bldg->member_costs[i]);
+                                       sprintf(buff, "(%ldgp)", (long int)bldg->member_costs[i]);
 #endif
 
                                }
@@ -139,9 +139,9 @@ sprintf(buff, "($%ld)", bldg->member_costs[i]);
                                {
                                        action_color = TERM_YELLOW;
 #ifdef JP
-sprintf(buff, "($%ld)", bldg->other_costs[i]);
+sprintf(buff, "($%ld)", (long int)bldg->other_costs[i]);
 #else
-                                       sprintf(buff, "(%ldgp)", bldg->other_costs[i]);
+                                       sprintf(buff, "(%ldgp)", (long int)bldg->other_costs[i]);
 #endif
 
                                }
@@ -168,9 +168,9 @@ strcpy(buff, "(
                                {
                                        action_color = TERM_YELLOW;
 #ifdef JP
-sprintf(buff, "($%ld)", bldg->member_costs[i]);
+sprintf(buff, "($%ld)", (long int)bldg->member_costs[i]);
 #else
-                                       sprintf(buff, "(%ldgp)", bldg->member_costs[i]);
+                                       sprintf(buff, "(%ldgp)", (long int)bldg->member_costs[i]);
 #endif
 
                                }
@@ -178,9 +178,9 @@ sprintf(buff, "($%ld)", bldg->member_costs[i]);
                                {
                                        action_color = TERM_YELLOW;
 #ifdef JP
-sprintf(buff, "($%ld)", bldg->other_costs[i]);
+sprintf(buff, "($%ld)", (long int)bldg->other_costs[i]);
 #else
-                                       sprintf(buff, "(%ldgp)", bldg->other_costs[i]);
+                                       sprintf(buff, "(%ldgp)", (long int)bldg->other_costs[i]);
 #endif
 
                                }
@@ -201,9 +201,9 @@ strcpy(buff, "(
                                {
                                        action_color = TERM_YELLOW;
 #ifdef JP
-sprintf(buff, "($%ld)", bldg->member_costs[i]);
+sprintf(buff, "($%ld)", (long int)bldg->member_costs[i]);
 #else
-                                       sprintf(buff, "(%ldgp)", bldg->member_costs[i]);
+                                       sprintf(buff, "(%ldgp)", (long int)bldg->member_costs[i]);
 #endif
 
                                }
@@ -1270,9 +1270,9 @@ static bool gamble_comm(int cmd)
                /* Get the wager */
                strcpy(out_val, "");
 #ifdef JP
-sprintf(tmp_str,"ÅÒ¤±¶â (1-%ld)¡©", maxbet);
+sprintf(tmp_str,"ÅÒ¤±¶â (1-%ld)¡©", (long int)maxbet);
 #else
-               sprintf(tmp_str,"Your wager (1-%ld) ? ", maxbet);
+               sprintf(tmp_str,"Your wager (1-%ld) ? ", (long int)maxbet);
 #endif
 
 
@@ -1303,9 +1303,9 @@ msg_print("
                        else if (wager > maxbet)
                        {
 #ifdef JP
-msg_format("%ld¥´¡¼¥ë¥É¤À¤±¼õ¤±¤è¤¦¡£»Ä¤ê¤Ï¼è¤Ã¤È¤­¤Ê¡£", maxbet);
+msg_format("%ld¥´¡¼¥ë¥É¤À¤±¼õ¤±¤è¤¦¡£»Ä¤ê¤Ï¼è¤Ã¤È¤­¤Ê¡£", (long int)maxbet);
 #else
-                               msg_format("I'll take %ld gold of that. Keep the rest.", maxbet);
+                               msg_format("I'll take %ld gold of that. Keep the rest.", (long int)maxbet);
 #endif
 
                                wager = maxbet;
@@ -1327,17 +1327,17 @@ msg_print("
                        oldgold = p_ptr->au;
 
 #ifdef JP
-sprintf(tmp_str, "¥²¡¼¥àÁ°¤Î½ê»ý¶â: %9ld", oldgold);
+sprintf(tmp_str, "¥²¡¼¥àÁ°¤Î½ê»ý¶â: %9ld", (long int)oldgold);
 #else
-                       sprintf(tmp_str, "Gold before game: %9ld", oldgold);
+                       sprintf(tmp_str, "Gold before game: %9ld", (long int)oldgold);
 #endif
 
                        prt(tmp_str, 20, 2);
 
 #ifdef JP
-sprintf(tmp_str, "¸½ºß¤Î³Ý¤±¶â:     %9ld", wager);
+sprintf(tmp_str, "¸½ºß¤Î³Ý¤±¶â:     %9ld", (long int)wager);
 #else
-                       sprintf(tmp_str, "Current Wager:    %9ld", wager);
+                       sprintf(tmp_str, "Current Wager:    %9ld", (long int)wager);
 #endif
 
                        prt(tmp_str, 21, 2);
@@ -1606,9 +1606,9 @@ prt("
                                        prt("", 17, 37);
                                }
 #ifdef JP
-sprintf(tmp_str, "¸½ºß¤Î½ê»ý¶â:     %9ld", p_ptr->au);
+sprintf(tmp_str, "¸½ºß¤Î½ê»ý¶â:     %9ld", (long int)p_ptr->au);
 #else
-                               sprintf(tmp_str, "Current Gold:     %9ld", p_ptr->au);
+                               sprintf(tmp_str, "Current Gold:     %9ld", (long int)p_ptr->au);
 #endif
 
                                prt(tmp_str, 22, 2);
@@ -1960,9 +1960,9 @@ static bool kakutoujou(void)
                        monster_race *r_ptr = &r_info[battle_mon[i]];
 
 #ifdef JP
-                       sprintf(buf,"%d) %-58s  %4ld.%02ldÇÜ", i+1, format("%s%s",r_name + r_ptr->name, (r_ptr->flags1 & RF1_UNIQUE) ? "¤â¤É¤­" : "      "), mon_odds[i]/100, mon_odds[i]%100);
+                       sprintf(buf,"%d) %-58s  %4ld.%02ldÇÜ", i+1, format("%s%s",r_name + r_ptr->name, (r_ptr->flags1 & RF1_UNIQUE) ? "¤â¤É¤­" : "      "), (long int)mon_odds[i]/100, (long int)mon_odds[i]%100);
 #else
-                       sprintf(buf,"%d) %-58s  %4ld.%02ld", i+1, format("%s%s", (r_ptr->flags1 & RF1_UNIQUE) ? "Fake " : "", r_name + r_ptr->name), mon_odds[i]/100, mon_odds[i]%100);
+                       sprintf(buf,"%d) %-58s  %4ld.%02ld", i+1, format("%s%s", (r_ptr->flags1 & RF1_UNIQUE) ? "Fake " : "", r_name + r_ptr->name), (long int)mon_odds[i]/100, (long int)mon_odds[i]%100);
 #endif
                        prt(buf, 5+i, 1);
                }
@@ -2002,9 +2002,9 @@ static bool kakutoujou(void)
                /* Get the wager */
                strcpy(out_val, "");
 #ifdef JP
-sprintf(tmp_str,"ÅÒ¤±¶â (1-%ld)¡©", maxbet);
+sprintf(tmp_str,"ÅÒ¤±¶â (1-%ld)¡©", (long int)maxbet);
 #else
-               sprintf(tmp_str,"Your wager (1-%ld) ? ", maxbet);
+               sprintf(tmp_str,"Your wager (1-%ld) ? ", (long int)maxbet);
 #endif
 
 
@@ -2035,9 +2035,9 @@ msg_print("
                        else if (wager > maxbet)
                        {
 #ifdef JP
-msg_format("%ld¥´¡¼¥ë¥É¤À¤±¼õ¤±¤è¤¦¡£»Ä¤ê¤Ï¼è¤Ã¤È¤­¤Ê¡£", maxbet);
+msg_format("%ld¥´¡¼¥ë¥É¤À¤±¼õ¤±¤è¤¦¡£»Ä¤ê¤Ï¼è¤Ã¤È¤­¤Ê¡£", (long int)maxbet);
 #else
-                               msg_format("I'll take %ld gold of that. Keep the rest.", maxbet);
+                               msg_format("I'll take %ld gold of that. Keep the rest.",(long int) maxbet);
 #endif
 
                                wager = maxbet;
@@ -2238,9 +2238,9 @@ static bool kankin(void)
                        if (get_check(buf))
                        {
 #ifdef JP
-                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", 1000000L * o_ptr->number);
+                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", (long int)(1000000L * o_ptr->number));
 #else
-                               msg_format("You get %ldgp.", 1000000L * o_ptr->number);
+                               msg_format("You get %ldgp.", (long int)(1000000L * o_ptr->number));
 #endif
                                p_ptr->au += 1000000L * o_ptr->number;
                                p_ptr->redraw |= (PR_GOLD);
@@ -2269,9 +2269,9 @@ static bool kankin(void)
                        if (get_check(buf))
                        {
 #ifdef JP
-                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", 200000L * o_ptr->number);
+                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", (long int)(200000L * o_ptr->number));
 #else
-                               msg_format("You get %ldgp.", 200000L * o_ptr->number);
+                               msg_format("You get %ldgp.", (long int)(200000L * o_ptr->number));
 #endif
                                p_ptr->au += 200000L * o_ptr->number;
                                p_ptr->redraw |= (PR_GOLD);
@@ -2300,9 +2300,9 @@ static bool kankin(void)
                        if (get_check(buf))
                        {
 #ifdef JP
-                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", 100000L * o_ptr->number);
+                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", (long int)(100000L * o_ptr->number));
 #else
-                               msg_format("You get %ldgp.", 100000L * o_ptr->number);
+                               msg_format("You get %ldgp.", (long int)(100000L * o_ptr->number));
 #endif
                                p_ptr->au += 100000L * o_ptr->number;
                                p_ptr->redraw |= (PR_GOLD);
@@ -2329,9 +2329,9 @@ static bool kankin(void)
                        if (get_check(buf))
                        {
 #ifdef JP
-                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", (r_info[today_mon].level * 50 + 100) * o_ptr->number);
+                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", (long int)((r_info[today_mon].level * 50 + 100) * o_ptr->number));
 #else
-                               msg_format("You get %ldgp.", (r_info[today_mon].level * 50 + 100) * o_ptr->number);
+                               msg_format("You get %ldgp.", (long int)((r_info[today_mon].level * 50 + 100) * o_ptr->number));
 #endif
                                p_ptr->au += (r_info[today_mon].level * 50 + 100) * o_ptr->number;
                                p_ptr->redraw |= (PR_GOLD);
@@ -2359,9 +2359,9 @@ static bool kankin(void)
                        if (get_check(buf))
                        {
 #ifdef JP
-                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", (r_info[today_mon].level * 30 + 60) * o_ptr->number);
+                               msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", (long int)((r_info[today_mon].level * 30 + 60) * o_ptr->number));
 #else
-                               msg_format("You get %ldgp.", (r_info[today_mon].level * 30 + 60) * o_ptr->number);
+                               msg_format("You get %ldgp.", (long int)((r_info[today_mon].level * 30 + 60) * o_ptr->number));
 #endif
                                p_ptr->au += (r_info[today_mon].level * 30 + 60) * o_ptr->number;
                                p_ptr->redraw |= (PR_GOLD);