From a55fcffc6673dd5b7a79f87233961be0f4533b83 Mon Sep 17 00:00:00 2001 From: Deskull Date: Sat, 2 Dec 2017 18:41:58 +0900 Subject: [PATCH] =?utf8?q?#37287=20#37353=20(2.2.0.89)=20=E5=9E=8B?= =?utf8?q?=E3=81=AE=E7=BD=AE=E6=8F=9B=E3=82=92=E7=B6=99=E7=B6=9A=E4=B8=AD?= =?utf8?q?=E3=80=82=20/=20Ongoing=20type=20replacement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd2.c | 2 +- src/externs.h | 2 +- src/init1.c | 14 +++++++------- src/init2.c | 4 ++-- src/load.c | 9 ++++++--- src/object1.c | 4 ++-- src/types.h | 2 +- src/wizard2.c | 9 +++++---- src/xtra2.c | 4 ++-- 9 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/cmd2.c b/src/cmd2.c index 16d2773b9..7d71998e6 100644 --- a/src/cmd2.c +++ b/src/cmd2.c @@ -2512,7 +2512,7 @@ void do_cmd_walk(bool pickup) } /* Get a "repeated" direction */ - if (get_rep_dir(&dir,FALSE)) + if (get_rep_dir(&dir, FALSE)) { /* Take a turn */ p_ptr->energy_use = 100; diff --git a/src/externs.h b/src/externs.h index 0b53eca82..3f926f8f6 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1505,7 +1505,7 @@ extern bool target_set(int mode); extern void target_set_prepare_look(void); extern bool get_aim_dir(DIRECTION *dp); extern bool get_hack_dir(int *dp); -extern bool get_rep_dir(int *dp, bool under); +extern bool get_rep_dir(DIRECTION *dp, bool under); extern bool get_rep_dir2(int *dp); extern void gain_level_reward(int chosen_reward); extern bool tgt_pt(POSITION *x, POSITION *y); diff --git a/src/init1.c b/src/init1.c index 1882d273d..71678305e 100644 --- a/src/init1.c +++ b/src/init1.c @@ -3071,10 +3071,10 @@ errr parse_r_info(char *buf, header *head) if (*t == 'd') *t++ = '\0'; /* Save the method */ - r_ptr->blow[i].method = n1; + r_ptr->blow[i].method = (BLOW_METHOD)n1; /* Save the effect */ - r_ptr->blow[i].effect = n2; + r_ptr->blow[i].effect = (BLOW_EFFECT)n2; /* Extract the damage dice and sides */ r_ptr->blow[i].d_dice = atoi(s); @@ -4230,13 +4230,13 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in if (num < 9) return (PARSE_ERROR_TOO_FEW_ARGUMENTS); q_ptr->type = atoi(zz[2]); - q_ptr->num_mon = atoi(zz[3]); - q_ptr->cur_num = atoi(zz[4]); - q_ptr->max_num = atoi(zz[5]); - q_ptr->level = atoi(zz[6]); + q_ptr->num_mon = (MONSTER_NUMBER)atoi(zz[3]); + q_ptr->cur_num = (MONSTER_NUMBER)atoi(zz[4]); + q_ptr->max_num = (MONSTER_NUMBER)atoi(zz[5]); + q_ptr->level = (DEPTH)atoi(zz[6]); q_ptr->r_idx = (IDX)atoi(zz[7]); q_ptr->k_idx = (IDX)atoi(zz[8]); - q_ptr->dungeon = atoi(zz[9]); + q_ptr->dungeon = (DUNGEON_IDX)atoi(zz[9]); if (num > 10) q_ptr->flags = atoi(zz[10]); diff --git a/src/init2.c b/src/init2.c index ff4d1ce19..1a182ee52 100644 --- a/src/init2.c +++ b/src/init2.c @@ -1978,7 +1978,7 @@ static errr init_object_alloc(void) z = y + aux[x]; /* Load the entry */ - table[z].index = i; + table[z].index = (KIND_OBJECT_IDX)i; table[z].level = (DEPTH)x; table[z].prob1 = (PROB)p; table[z].prob2 = (PROB)p; @@ -2047,7 +2047,7 @@ static errr init_alloc(void) p = (100 / r_ptr->rarity); /* Load the entry */ - alloc_race_table[i].index = elements[i].index; + alloc_race_table[i].index = (KIND_OBJECT_IDX)elements[i].index; alloc_race_table[i].level = (DEPTH)x; alloc_race_table[i].prob1 = (PROB)p; alloc_race_table[i].prob2 = (PROB)p; diff --git a/src/load.c b/src/load.c index dfb4fe852..f2396f621 100644 --- a/src/load.c +++ b/src/load.c @@ -3579,7 +3579,8 @@ static errr rd_savefile_new_aux(void) } else { - rd_byte(&q_ptr->complev); + rd_byte(&tmp8u); + q_ptr->complev = tmp8u; } if(h_older_than(2, 1, 2, 2)) { @@ -3615,7 +3616,8 @@ static errr rd_savefile_new_aux(void) if (q_ptr->k_idx) a_info[q_ptr->k_idx].gen_flags |= TRG_QUESTITEM; - rd_byte(&q_ptr->flags); + rd_byte(&tmp8u); + q_ptr->flags = tmp8u; if (z_older_than(10, 3, 11)) { @@ -3634,7 +3636,8 @@ static errr rd_savefile_new_aux(void) } else { - rd_byte(&q_ptr->dungeon); + rd_byte(&tmp8u); + q_ptr->dungeon = tmp8u; } /* Mark uniques */ if (q_ptr->status == QUEST_STATUS_TAKEN || q_ptr->status == QUEST_STATUS_UNTAKEN) diff --git a/src/object1.c b/src/object1.c index eecf2a460..eff1db847 100644 --- a/src/object1.c +++ b/src/object1.c @@ -3631,8 +3631,8 @@ int scan_floor(int *items, POSITION y, POSITION x, int mode) */ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_POSITION *min_width) { - COMMAND_CODE i; - int j, k, l, m; + COMMAND_CODE i, m; + int j, k, l; int col, len; object_type *o_ptr; diff --git a/src/types.h b/src/types.h index 937be5763..2aa9ad16b 100644 --- a/src/types.h +++ b/src/types.h @@ -635,7 +635,7 @@ typedef struct alloc_entry alloc_entry; struct alloc_entry { - IDX index; /* The actual index */ + KIND_OBJECT_IDX index; /* The actual index */ DEPTH level; /* Base dungeon level */ PROB prob1; /* Probability, pass 1 */ diff --git a/src/wizard2.c b/src/wizard2.c index f94fd984a..a2afe6930 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -745,16 +745,17 @@ void strip_name(char *buf, KIND_OBJECT_IDX k_idx) * This function returns the k_idx of an object type, or zero if failed * List up to 50 choices in three columns */ -static IDX wiz_create_itemtype(void) +static KIND_OBJECT_IDX wiz_create_itemtype(void) { - int i, num, max_num; - int col, row; + KIND_OBJECT_IDX i; + int num, max_num; + TERM_POSITION col, row; OBJECT_TYPE_VALUE tval; cptr tval_desc; char ch; - int choice[80]; + KIND_OBJECT_IDX choice[80]; char buf[160]; diff --git a/src/xtra2.c b/src/xtra2.c index 0b4b85e63..9c046e0b6 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -4235,9 +4235,9 @@ bool get_aim_dir(DIRECTION *dp) * This function tracks and uses the "global direction", and uses * that as the "desired direction", to which "confusion" is applied. */ -bool get_rep_dir(int *dp, bool under) +bool get_rep_dir(DIRECTION *dp, bool under) { - int dir; + DIRECTION dir; cptr prompt; /* Initialize */ -- 2.11.0