From ce135fa63c3eb78d8c8bac6a6bc61e1e8f2d0f0b Mon Sep 17 00:00:00 2001 From: Deskull Date: Tue, 17 Oct 2017 23:23:45 +0900 Subject: [PATCH] =?utf8?q?#37287=20#37353=20(2.2.0.89)=20FEAT=5FPOWER=20?= =?utf8?q?=E5=9E=8B=E3=82=92=E5=AE=9A=E7=BE=A9=E3=81=97=E3=80=81=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/=20Define=20FEAT=5FPOWER,=20ongoing=20type=20replac?= =?utf8?q?ement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/externs.h | 2 +- src/h-type.h | 1 + src/hex.c | 2 +- src/hissatsu.c | 2 +- src/init1.c | 10 +++++----- src/mspells3.c | 2 +- src/object1.c | 2 +- src/types.h | 20 ++++++++++---------- src/util.c | 4 ++-- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/externs.h b/src/externs.h index 785cdfb71..2beea341c 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1018,7 +1018,7 @@ extern int show_inven(int target_item); extern int show_equip(int target_item); extern void toggle_inven_equip(void); extern bool can_get_item(void); -extern bool get_item(int *cp, cptr pmt, cptr str, int mode); +extern bool get_item(COMMAND_CODE *cp, cptr pmt, cptr str, int mode); /* object2.c */ extern void excise_object_idx(int o_idx); diff --git a/src/h-type.h b/src/h-type.h index 64aa4a14a..9fbc5ec5f 100644 --- a/src/h-type.h +++ b/src/h-type.h @@ -172,6 +172,7 @@ typedef byte MAGIC_NUM2; /*!< プレイヤーの汎用魔法情報配列2の typedef s32b SPELL_IDX; /*!< 各魔法領域/職業能力ごとの呪文ID型定義 */ typedef s16b PROB; /*!< 確率の重みの型定義 */ +typedef byte FEAT_POWER; /*!< 地形強度の型定義 */ /*** Pointers to all the basic types defined above ***/ diff --git a/src/hex.c b/src/hex.c index 8d27a26ef..27e9102a7 100644 --- a/src/hex.c +++ b/src/hex.c @@ -103,7 +103,7 @@ bool stop_hex_spell(void) } if (!get_com(out_val, &choice, TRUE)) break; - if (isupper(choice)) choice = tolower(choice); + if (isupper(choice)) choice = (char)tolower(choice); if (choice == 'l') /* All */ { diff --git a/src/hissatsu.c b/src/hissatsu.c index b6ffab87a..ec0316e42 100644 --- a/src/hissatsu.c +++ b/src/hissatsu.c @@ -254,7 +254,7 @@ static int get_hissatsu_power(SPELL_IDX *sn) ask = (isupper(choice)); /* Lowercase */ - if (ask) choice = tolower(choice); + if (ask) choice = (char)tolower(choice); /* Extract request */ i = (islower(choice) ? A2I(choice) : -1); diff --git a/src/init1.c b/src/init1.c index add6673d1..345252a1c 100644 --- a/src/init1.c +++ b/src/init1.c @@ -1309,8 +1309,8 @@ errr parse_v_info(char *buf, header *head) /* Save the values */ v_ptr->typ = typ; v_ptr->rat = rat; - v_ptr->hgt = hgt; - v_ptr->wid = wid; + v_ptr->hgt = (POSITION)hgt; + v_ptr->wid = (POSITION)wid; } /* Oops */ @@ -2728,9 +2728,9 @@ errr parse_e_info(char *buf, header *head) if (4 != sscanf(buf+2, "%d:%d:%d:%d", &th, &td, &ta, &pval)) return (1); - e_ptr->max_to_h = th; - e_ptr->max_to_d = td; - e_ptr->max_to_a = ta; + e_ptr->max_to_h = (HIT_PROB)th; + e_ptr->max_to_d = (HIT_POINT)td; + e_ptr->max_to_a = (ARMOUR_CLASS)ta; e_ptr->max_pval = (PARAMETER_VALUE)pval; } diff --git a/src/mspells3.c b/src/mspells3.c index a2748cd62..6eebf3bff 100644 --- a/src/mspells3.c +++ b/src/mspells3.c @@ -538,7 +538,7 @@ static int get_learned_power(SPELL_IDX *sn) ask = isupper(choice); /* Lowercase */ - if (ask) choice = tolower(choice); + if (ask) choice = (char)tolower(choice); /* Extract request */ i = (islower(choice) ? A2I(choice) : -1); diff --git a/src/object1.c b/src/object1.c index 0ed65483c..3b3d09ab9 100644 --- a/src/object1.c +++ b/src/object1.c @@ -4868,7 +4868,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, int mode) /* Extract "query" setting */ ver = isupper(which); - which = tolower(which); + which = (char)tolower(which); /* Convert letter to inventory index */ if (command_wrk == (USE_INVEN)) diff --git a/src/types.h b/src/types.h index 24eeab234..e6414f693 100644 --- a/src/types.h +++ b/src/types.h @@ -80,7 +80,7 @@ struct feature_type feature_state state[MAX_FEAT_STATES]; /*!< feature_state テーブル */ byte subtype; /*!< 副特性値 */ - byte power; /*!< 地形強度 */ + FEAT_POWER power; /*!< 地形強度 */ SYMBOL_COLOR d_attr[F_LIT_MAX]; /*!< デフォルトの地形シンボルカラー / Default feature attribute */ SYMBOL_CODE d_char[F_LIT_MAX]; /*!< デフォルトの地形シンボルアルファベット / Default feature character */ @@ -251,8 +251,8 @@ struct monster_blow { byte method; byte effect; - byte d_dice; - byte d_side; + DICE_NUMBER d_dice; + DICE_SID d_side; }; @@ -1492,7 +1492,7 @@ struct wilderness_type int town; int road; u32b seed; - s16b level; + DEPTH level; byte entrance; }; @@ -1602,13 +1602,13 @@ struct dungeon_info_type { feat_prob floor[DUNGEON_FEAT_PROB_NUM]; /* Floor probability */ feat_prob fill[DUNGEON_FEAT_PROB_NUM]; /* Cave wall probability */ - s16b outer_wall; /* Outer wall tile */ - s16b inner_wall; /* Inner wall tile */ - s16b stream1; /* stream tile */ - s16b stream2; /* stream tile */ + FEAT_IDX outer_wall; /* Outer wall tile */ + FEAT_IDX inner_wall; /* Inner wall tile */ + FEAT_IDX stream1; /* stream tile */ + FEAT_IDX stream2; /* stream tile */ - s16b mindepth; /* Minimal depth */ - s16b maxdepth; /* Maximal depth */ + DEPTH mindepth; /* Minimal depth */ + DEPTH maxdepth; /* Maximal depth */ byte min_plev; /* Minimal plev needed to enter -- it's an anti-cheating mesure */ s16b pit; s16b nest; diff --git a/src/util.c b/src/util.c index 2f75790af..0a230c0e8 100644 --- a/src/util.c +++ b/src/util.c @@ -3878,7 +3878,7 @@ s16b get_quantity(cptr prompt, COMMAND_CODE max) if (!res) return 0; /* Extract a number */ - amt = atoi(buf); + amt = (COMMAND_CODE)atoi(buf); /* A letter means "all" */ if (isalpha(buf[0])) amt = max; @@ -4862,7 +4862,7 @@ static int repeat__cnt = 0; static int repeat__idx = 0; /* Saved "stuff" */ -static int repeat__key[REPEAT_MAX]; +static COMMAND_CODE repeat__key[REPEAT_MAX]; void repeat_push(COMMAND_CODE what) -- 2.11.0