From b8baad859d7a278a2864bfe3e495bd0d4c89a65d Mon Sep 17 00:00:00 2001 From: Deskull Date: Sat, 29 Sep 2018 20:00:47 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37287=20#37353=20=E5=9E=8B?= =?utf8?q?=E3=81=AE=E7=BD=AE=E6=8F=9B=E3=80=82=20/=20Type=20replacement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/artifact.c | 2 +- src/cmd-quaff.c | 6 ++---- src/externs.h | 4 ++-- src/mspells4.c | 8 ++++---- src/variable.c | 2 +- src/wizard2.c | 8 ++++---- src/xtra2.c | 4 ++-- 7 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/artifact.c b/src/artifact.c index 37f82a2ba..e0dcb160b 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -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; diff --git a/src/cmd-quaff.c b/src/cmd-quaff.c index c56e1fef0..57f6c1cb5 100644 --- a/src/cmd-quaff.c +++ b/src/cmd-quaff.c @@ -18,14 +18,12 @@ */ void do_cmd_quaff_potion_aux(int item) { - int ident, lev; + int ident, lev; object_type *o_ptr; object_type forge; object_type *q_ptr; - - /* Take a turn */ - p_ptr->energy_use = 100; + p_ptr->energy_use = 100; /* Take a turn */ if (world_player) { diff --git a/src/externs.h b/src/externs.h index 6a8c3bb29..626f3fbdc 100644 --- a/src/externs.h +++ b/src/externs.h @@ -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); diff --git a/src/mspells4.c b/src/mspells4.c index 62f92be58..bf703f8dc 100644 --- a/src/mspells4.c +++ b/src/mspells4.c @@ -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."), diff --git a/src/variable.c b/src/variable.c index 4917c661c..e43eba5e4 100644 --- a/src/variable.c +++ b/src/variable.c @@ -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 diff --git a/src/wizard2.c b/src/wizard2.c index e9838fd26..ff95fb673 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -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++) diff --git a/src/xtra2.c b/src/xtra2.c index 68e45842b..eb333eb48 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -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++) -- 2.11.0