From 68872c332294a5d3fd8c89b8c1814023059380c2 Mon Sep 17 00:00:00 2001 From: Deskull Date: Sun, 15 Oct 2017 22:00:09 +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/externs.h | 2 +- src/init1.c | 18 +++++++++--------- src/init2.c | 2 +- src/mspells3.c | 2 +- src/object1.c | 2 +- src/types.h | 21 ++++++++++----------- src/util.c | 2 +- 7 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/externs.h b/src/externs.h index 38fcd8871..785cdfb71 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1362,7 +1362,7 @@ extern bool get_string(cptr prompt, char *buf, int len); extern bool get_check(cptr prompt); extern bool get_check_strict(cptr prompt, int mode); extern bool get_com(cptr prompt, char *command, bool z_escape); -extern s16b get_quantity(cptr prompt, int max); +extern s16b get_quantity(cptr prompt, COMMAND_CODE max); extern void pause_line(int row); extern void request_command(int shopping); extern bool is_a_vowel(int ch); diff --git a/src/init1.c b/src/init1.c index 4d6669320..add6673d1 100644 --- a/src/init1.c +++ b/src/init1.c @@ -2474,9 +2474,9 @@ errr parse_a_info(char *buf, header *head) &tval, &sval, &pval)) return (1); /* Save the values */ - a_ptr->tval = tval; - a_ptr->sval = sval; - a_ptr->pval = pval; + a_ptr->tval = (OBJECT_TYPE_VALUE)tval; + a_ptr->sval = (OBJECT_SUBTYPE_VALUE)sval; + a_ptr->pval = (PARAMETER_VALUE)pval; } /* Process 'W' for "More Info" (one line only) */ @@ -2490,10 +2490,10 @@ errr parse_a_info(char *buf, header *head) &level, &rarity, &wgt, &cost)) return (1); /* Save the values */ - a_ptr->level = level; - a_ptr->rarity = rarity; - a_ptr->weight = wgt; - a_ptr->cost = cost; + a_ptr->level = (DEPTH)level; + a_ptr->rarity = (RARITY)rarity; + a_ptr->weight = (WEIGHT)wgt; + a_ptr->cost = (PRICE)cost; } /* Hack -- Process 'P' for "power" and such */ @@ -3394,7 +3394,7 @@ errr parse_d_info(char *buf, header *head) d_ptr->floor[i].feat = f_tag_to_index(zz[i * 2]); if (d_ptr->floor[i].feat < 0) return PARSE_ERROR_UNDEFINED_TERRAIN_TAG; - d_ptr->floor[i].percent = atoi(zz[i * 2 + 1]); + d_ptr->floor[i].percent = (PERCENTAGE)atoi(zz[i * 2 + 1]); } d_ptr->tunnel_percent = atoi(zz[DUNGEON_FEAT_PROB_NUM * 2]); } @@ -3413,7 +3413,7 @@ errr parse_d_info(char *buf, header *head) d_ptr->fill[i].feat = f_tag_to_index(zz[i * 2]); if (d_ptr->fill[i].feat < 0) return PARSE_ERROR_UNDEFINED_TERRAIN_TAG; - d_ptr->fill[i].percent = atoi(zz[i * 2 + 1]); + d_ptr->fill[i].percent = (PERCENTAGE)atoi(zz[i * 2 + 1]); } d_ptr->outer_wall = f_tag_to_index(zz[DUNGEON_FEAT_PROB_NUM * 2]); diff --git a/src/init2.c b/src/init2.c index 734d34ea6..5e01a2389 100644 --- a/src/init2.c +++ b/src/init2.c @@ -1615,7 +1615,7 @@ s16b f_tag_to_index_in_init(cptr str) */ static errr init_feat_variables(void) { - int i; + FEAT_IDX i; /* Nothing */ feat_none = f_tag_to_index_in_init("NONE"); diff --git a/src/mspells3.c b/src/mspells3.c index be74dd6c9..a2748cd62 100644 --- a/src/mspells3.c +++ b/src/mspells3.c @@ -1463,7 +1463,7 @@ static bool cast_learned_spell(int spell, bool success) */ bool do_cmd_cast_learned(void) { - int n = 0; + SPELL_IDX n = 0; int chance; int minfail = 0; int plev = p_ptr->lev; diff --git a/src/object1.c b/src/object1.c index a05a4e7a4..0ed65483c 100644 --- a/src/object1.c +++ b/src/object1.c @@ -2988,7 +2988,7 @@ bool get_item(COMMAND_CODE *cp, cptr pmt, cptr str, int mode) /* Repeat until done */ while (!done) { - int get_item_label = 0; + COMMAND_CODE get_item_label = 0; /* Show choices */ int ni = 0; diff --git a/src/types.h b/src/types.h index a23fe70b0..24eeab234 100644 --- a/src/types.h +++ b/src/types.h @@ -219,17 +219,16 @@ struct ego_item_type DEPTH level; /* Minimum level */ RARITY rarity; /* Object rarity */ - byte max_to_h; /* Maximum to-hit bonus */ - byte max_to_d; /* Maximum to-dam bonus */ - byte max_to_a; /* Maximum to-ac bonus */ + HIT_PROB max_to_h; /* Maximum to-hit bonus */ + HIT_POINT max_to_d; /* Maximum to-dam bonus */ + ARMOUR_CLASS max_to_a; /* Maximum to-ac bonus */ PARAMETER_VALUE max_pval; /* Maximum pval */ - s32b cost; /* Ego-item "cost" */ + PRICE cost; /* Ego-item "cost" */ - u32b flags[TR_FLAG_SIZE]; /* Ego-Item Flags */ - - u32b gen_flags; /* flags for generate */ + BIT_FLAGS flags[TR_FLAG_SIZE]; /* Ego-Item Flags */ + BIT_FLAGS gen_flags; /* flags for generate */ IDX act_idx; /* Activative ability index */ }; @@ -1586,8 +1585,8 @@ struct high_score typedef struct { - s16b feat; /* Feature tile */ - byte percent; /* Chance of type */ + FEAT_IDX feat; /* Feature tile */ + PERCENTAGE percent; /* Chance of type */ } feat_prob; @@ -1598,8 +1597,8 @@ struct dungeon_info_type { STR_OFFSET name; /* Name */ STR_OFFSET text; /* Description */ - byte dy; - byte dx; + POSITION dy; + POSITION dx; feat_prob floor[DUNGEON_FEAT_PROB_NUM]; /* Floor probability */ feat_prob fill[DUNGEON_FEAT_PROB_NUM]; /* Cave wall probability */ diff --git a/src/util.c b/src/util.c index f3f85d438..2f75790af 100644 --- a/src/util.c +++ b/src/util.c @@ -3802,7 +3802,7 @@ bool get_com(cptr prompt, char *command, bool z_escape) * * Hack -- allow "command_arg" to specify a quantity */ -s16b get_quantity(cptr prompt, int max) +s16b get_quantity(cptr prompt, COMMAND_CODE max) { bool res; COMMAND_CODE amt; -- 2.11.0