OSDN Git Service

#37287 spell2.cとspell3.c内のC4457警告に対応。ソースコード整形。 / Deal C4457 warning in spell2.c and...
authorDeskull <desull@users.sourceforge.jp>
Mon, 19 Jun 2017 14:07:28 +0000 (23:07 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 19 Jun 2017 14:07:28 +0000 (23:07 +0900)
src/spells2.c
src/spells3.c
src/xtra1.c

index 639da2e..9af8b83 100644 (file)
@@ -109,52 +109,52 @@ void self_knowledge(void)
        info[i++] = buf[1];
        for (v_nr = 0; v_nr < 8; v_nr++)
        {
-               char v_name [20];
+               char vir_name [20];
                char vir_desc[80];
                int tester = p_ptr->virtues[v_nr];
        
-               strcpy(v_name, virtue[(p_ptr->vir_types[v_nr])-1]);
+               strcpy(vir_name, virtue[(p_ptr->vir_types[v_nr])-1]);
  
-               sprintf(vir_desc, _("おっと。%sの情報なし。", "Oops. No info about %s."), v_name);
+               sprintf(vir_desc, _("おっと。%sの情報なし。", "Oops. No info about %s."), vir_name);
                if (tester < -100)
                        sprintf(vir_desc, _("[%s]の対極 (%d)", "You are the polar opposite of %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < -80)
                        sprintf(vir_desc, _("[%s]の大敵 (%d)", "You are an arch-enemy of %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < -60)
                        sprintf(vir_desc, _("[%s]の強敵 (%d)", "You are a bitter enemy of %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < -40)
                        sprintf(vir_desc, _("[%s]の敵 (%d)", "You are an enemy of %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < -20)
                        sprintf(vir_desc, _("[%s]の罪者 (%d)", "You have sinned against %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < 0)
                        sprintf(vir_desc, _("[%s]の迷道者 (%d)", "You have strayed from the path of %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester == 0)
                        sprintf(vir_desc, _("[%s]の中立者 (%d)", "You are neutral to %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < 20)
                        sprintf(vir_desc, _("[%s]の小徳者 (%d)", "You are somewhat virtuous in %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < 40)
                        sprintf(vir_desc, _("[%s]の中徳者 (%d)", "You are virtuous in %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < 60)
                        sprintf(vir_desc, _("[%s]の高徳者 (%d)", "You are very virtuous in %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < 80)
                        sprintf(vir_desc, _("[%s]の覇者 (%d)", "You are a champion of %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else if (tester < 100)
                        sprintf(vir_desc, _("[%s]の偉大な覇者 (%d)", "You are a great champion of %s (%d)."),
-                               v_name, tester);
+                               vir_name, tester);
                else
                        sprintf(vir_desc, _("[%s]の具現者 (%d)", "You are the living embodiment of %s (%d)."),
-               v_name, tester);
+                               vir_name, tester);
        
                strcpy(v_string[v_nr], vir_desc);
        
@@ -3276,8 +3276,6 @@ sprintf(buf, "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:", m_name, align, m_
                        /* Learn everything about this monster */
                        if (lore_do_probe(m_ptr->r_idx))
                        {
-                               char buf[80];
-
                                /* Get base name of monster */
                                strcpy(buf, (r_name + r_ptr->name));
 
@@ -3930,13 +3928,13 @@ bool earthquake_aux(int cy, int cx, int r, int m_idx)
                                        /* Hack -- Escape from the rock */
                                        if (sn)
                                        {
-                                               int m_idx = cave[yy][xx].m_idx;
+                                               int m_idx_aux = cave[yy][xx].m_idx;
 
                                                /* Update the old location */
                                                cave[yy][xx].m_idx = 0;
 
                                                /* Update the new location */
-                                               cave[sy][sx].m_idx = m_idx;
+                                               cave[sy][sx].m_idx = m_idx_aux;
 
                                                /* Move the monster */
                                                m_ptr->fy = sy;
index 840f9f5..1ac238a 100644 (file)
@@ -3646,9 +3646,6 @@ void display_spell_list(void)
            (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
            (p_ptr->pclass == CLASS_FORCETRAINER))
        {
-               int             i;
-               int             y = 1;
-               int             x = 1;
                int             minfail = 0;
                int             plev = p_ptr->lev;
                int             chance = 0;
@@ -3658,6 +3655,9 @@ void display_spell_list(void)
                int             use_mind;
                bool use_hp = FALSE;
 
+               y = 1;
+               x = 1;
+
                /* Display a list of spells */
                prt("", y, x);
                put_str(_("名前", "Name"), y, x + 5);
index ec6c7b3..7792a0e 100644 (file)
@@ -5005,8 +5005,7 @@ void calc_bonuses(void)
                }
        }
 
-       if (p_ptr->ryoute)
-               hold *= 2;
+       if (p_ptr->ryoute) hold *= 2;
 
        for(i = 0 ; i < 2 ; i++)
        {
@@ -5763,6 +5762,7 @@ void calc_bonuses(void)
                if ((inventory[i].tval == TV_NATURE_BOOK) && (inventory[i].sval == 2)) have_sw = TRUE;
                if ((inventory[i].tval == TV_CRAFT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE;
        }
+
        for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
        {
                /* Acquire object */