OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
authorDeskull <deskull@users.sourceforge.jp>
Sat, 29 Sep 2018 11:00:47 +0000 (20:00 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sat, 29 Sep 2018 11:00:47 +0000 (20:00 +0900)
src/artifact.c
src/cmd-quaff.c
src/externs.h
src/mspells4.c
src/variable.c
src/wizard2.c
src/xtra2.c

index 37f82a2..e0dcb16 100644 (file)
@@ -2258,7 +2258,7 @@ void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr)
  * 仮に2個以上存在可能かつ装備品以外の固定アーティファクトが作成されれば
  * drop_near()関数の返り値は信用できなくなる.
  */
-bool create_named_art(int a_idx, int y, int x)
+bool create_named_art(ARTIFACT_IDX a_idx, POSITION y, POSITION x)
 {
        object_type forge;
        object_type *q_ptr;
index c56e1fe..57f6c1c 100644 (file)
  */\r
 void do_cmd_quaff_potion_aux(int item)\r
 {\r
-       int         ident, lev;\r
+       int ident, lev;\r
        object_type *o_ptr;\r
        object_type forge;\r
        object_type *q_ptr;\r
 \r
-\r
-       /* Take a turn */\r
-       p_ptr->energy_use = 100;\r
+       p_ptr->energy_use = 100; /* Take a turn */\r
 \r
        if (world_player)\r
        {\r
index 6a8c3bb..626f3fb 100644 (file)
@@ -530,7 +530,7 @@ extern MONRACE_IDX max_r_idx;
 extern IDX max_k_idx;
 extern IDX max_v_idx;
 extern IDX max_f_idx;
-extern IDX max_a_idx;
+extern ARTIFACT_IDX max_a_idx;
 extern IDX max_e_idx;
 extern DUNGEON_IDX max_d_idx;
 extern OBJECT_IDX max_o_idx;
@@ -1506,7 +1506,7 @@ extern bool create_artifact(object_type *o_ptr, bool a_scroll);
 extern int activation_index(object_type *o_ptr);
 extern const activation_type* find_activation_info(object_type *o_ptr);
 extern void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr);
-extern bool create_named_art(int a_idx, int y, int x);
+extern bool create_named_art(ARTIFACT_IDX a_idx, POSITION y, POSITION x);
 
 /* scores.c */
 extern void display_scores_aux(int from, int to, int note, high_score *score);
index 62f92be..bf703f8 100644 (file)
@@ -39,7 +39,7 @@ bool monster_near_player(MONSTER_IDX m_idx, IDX t_idx)
 */
 bool see_monster(MONSTER_IDX m_idx)
 {
-       monster_type    *m_ptr = &m_list[m_idx];
+       monster_type *m_ptr = &m_list[m_idx];
        return is_seen(m_ptr);
 }
 
@@ -50,7 +50,7 @@ bool see_monster(MONSTER_IDX m_idx)
 */
 bool spell_learnable(MONSTER_IDX m_idx)
 {
-       monster_type    *m_ptr = &m_list[m_idx];
+       monster_type *m_ptr = &m_list[m_idx];
        /* Extract the "see-able-ness" */
        bool seen = (!p_ptr->blind && m_ptr->ml);
 
@@ -907,7 +907,7 @@ HIT_POINT spell_RF5_MIND_BLAST(POSITION y, POSITION x, MONSTER_IDX m_idx, IDX t_
 */
 HIT_POINT spell_RF5_BRAIN_SMASH(POSITION y, POSITION x, MONSTER_IDX m_idx, IDX t_idx, int TARGET_TYPE)
 {
-       monster_type    *m_ptr = &m_list[m_idx];
+       monster_type *m_ptr = &m_list[m_idx];
        bool seen = (!p_ptr->blind && m_ptr->ml);
        HIT_POINT dam;
        char m_name[80], t_name[80];
@@ -2531,7 +2531,7 @@ void spell_RF6_FORGET(MONSTER_IDX m_idx)
 */
 void spell_RF6_RAISE_DEAD(MONSTER_IDX m_idx, IDX t_idx, int TARGET_TYPE)
 {
-       monster_type    *m_ptr = &m_list[m_idx];
+       monster_type *m_ptr = &m_list[m_idx];
 
        monspell_message(m_idx, t_idx,
                _("%^sが何かをつぶやいた。", "%^s mumbles."),
index 4917c66..e43eba5 100644 (file)
@@ -882,7 +882,7 @@ IDX max_f_idx;
 /*
  * Maximum number of artifacts in a_info.txt
  */
-IDX max_a_idx;
+ARTIFACT_IDX max_a_idx;
 
 /*
  * Maximum number of ego-items in e_info.txt
index e9838fd..ff95fb6 100644 (file)
@@ -145,13 +145,13 @@ static bool set_gametime(void)
 static void wiz_create_named_art(void)
 {
        char tmp_val[10] = "";
-       int a_idx;
+       ARTIFACT_IDX a_idx;
 
        /* Query */
        if (!get_string("Artifact ID:", tmp_val, 3)) return;
 
        /* Extract */
-       a_idx = atoi(tmp_val);
+       a_idx = (ARTIFACT_IDX)atoi(tmp_val);
        if(a_idx < 0) a_idx = 0;
        if(a_idx >= max_a_idx) a_idx = 0; 
 
@@ -1417,7 +1417,7 @@ static void wiz_create_item(void)
        object_type     forge;
        object_type *q_ptr;
 
-       IDX k_idx;
+       OBJECT_IDX k_idx;
 
        /* Save the screen */
        screen_save();
@@ -1433,7 +1433,7 @@ static void wiz_create_item(void)
 
        if (k_info[k_idx].gen_flags & TRG_INSTA_ART)
        {
-               int i;
+               ARTIFACT_IDX i;
 
                /* Artifactify */
                for (i = 1; i < max_a_idx; i++)
index 68e4584..eb333eb 100644 (file)
@@ -1024,7 +1024,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                /* Reward for "lazy" player */
                if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
                {
-                       int a_idx = 0;
+                       ARTIFACT_IDX a_idx = 0;
                        artifact_type *a_ptr = NULL;
 
                        if (!drop_chosen_item) break;
@@ -1244,7 +1244,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
        /* Mega-Hack -- drop fixed items */
        if (drop_chosen_item)
        {
-               int a_idx = 0;
+               ARTIFACT_IDX a_idx = 0;
                int chance = 0;
 
                for(i = 0; i < 4; i++)