From: Deskull Date: Mon, 11 Dec 2017 13:35:16 +0000 (+0900) Subject: #37287 #37353 (2.2.0.89) PET_COMMAND_IDX, FF_FLAGS_IDX型を定義し、型の置換を継続中。 / Define PET_CO... X-Git-Url: http://git.osdn.net/view?p=hengband%2Fhengband.git;a=commitdiff_plain;h=1c750bbc037ebf3dfd1f1ff6f3f511530070c241 #37287 #37353 (2.2.0.89) PET_COMMAND_IDX, FF_FLAGS_IDX型を定義し、型の置換を継続中。 / Define PET_COMMAND_IDX, FF_FLAGS_IDX ongoing type replacement. --- diff --git a/src/cmd5.c b/src/cmd5.c index 7b3773bfa..ec5604c09 100644 --- a/src/cmd5.c +++ b/src/cmd5.c @@ -2217,7 +2217,7 @@ void do_cmd_pet(void) int pet_ctr; monster_type *m_ptr; - BIT_FLAGS mode = 0; + PET_COMMAND_IDX mode = 0; char buf[160]; char target_buf[160]; @@ -2474,7 +2474,7 @@ void do_cmd_pet(void) if (!redraw || use_menu) { byte y = 1, x = 0; - int ctr = 0; + PET_COMMAND_IDX ctr = 0; /* Show list */ redraw = TRUE; diff --git a/src/h-type.h b/src/h-type.h index 56ad55541..11e3b2966 100644 --- a/src/h-type.h +++ b/src/h-type.h @@ -235,8 +235,10 @@ typedef int EFFECT_ID; /*!< 効果属性ID */ typedef s16b QUEST_TYPE; /*!< クエストの種別ID */ typedef s16b QUEST_STATUS; /*!< クエストの状態ID */ -typedef s16b ACTION_SKILL_POWER; /*!< 行動技能値 */ +typedef s16b ACTION_SKILL_POWER; /*!< 行動技能値 */ +typedef int PET_COMMAND_IDX; /*!< ペットへの指示ID */ +typedef byte FF_FLAGS_IDX; /*!< 地形特性ID */ /*** Pointers to all the basic types defined above ***/ diff --git a/src/init1.c b/src/init1.c index da537df91..9ddb02948 100644 --- a/src/init1.c +++ b/src/init1.c @@ -1603,7 +1603,7 @@ static errr grab_one_feat_flag(feature_type *f_ptr, cptr what) */ static errr grab_one_feat_action(feature_type *f_ptr, cptr what, int count) { - int i; + FF_FLAGS_IDX i; /* Check flags */ for (i = 0; i < FF_FLAG_MAX; i++) diff --git a/src/main-win.c b/src/main-win.c index f7336f25a..c7418172e 100644 --- a/src/main-win.c +++ b/src/main-win.c @@ -1314,7 +1314,7 @@ static void load_prefs_aux(int i) /* Window size */ if (i == 0) { - win_maximized = GetPrivateProfileInt(sec_name, "Maximized", win_maximized, ini_file); + win_maximized = (GetPrivateProfileInt(sec_name, "Maximized", win_maximized, ini_file) != 0); } /* Window position */ @@ -1326,7 +1326,7 @@ static void load_prefs_aux(int i) /* Window Z position */ if (i > 0) { - td->posfix = GetPrivateProfileInt(sec_name, "PositionFix", td->posfix, ini_file); + td->posfix = (GetPrivateProfileInt(sec_name, "PositionFix", td->posfix, ini_file) != 0); } } @@ -1339,10 +1339,10 @@ static void load_prefs(void) int i; /* Extract the "arg_graphics" flag */ - arg_graphics = GetPrivateProfileInt("Angband", "Graphics", GRAPHICS_NONE, ini_file); + arg_graphics = (byte_hack)GetPrivateProfileInt("Angband", "Graphics", GRAPHICS_NONE, ini_file); /* Extract the "arg_bigtile" flag */ - arg_bigtile = GetPrivateProfileInt("Angband", "Bigtile", FALSE, ini_file); + arg_bigtile = (GetPrivateProfileInt("Angband", "Bigtile", FALSE, ini_file) != 0); use_bigtile = arg_bigtile; /* Extract the "arg_sound" flag */ diff --git a/src/types.h b/src/types.h index e4152fa88..f8443b4df 100644 --- a/src/types.h +++ b/src/types.h @@ -52,7 +52,7 @@ typedef struct feature_state feature_state; struct feature_state { - byte action; /*!< 変化条件をFF_*のIDで指定 / Action (FF_*) */ + FF_FLAGS_IDX action; /*!< 変化条件をFF_*のIDで指定 / Action (FF_*) */ STR_OFFSET result_tag; /*!< 変化先ID / Result (f_info ID) */ FEAT_IDX result; /*!< 変化先ID / Result (f_info ID) */ }; diff --git a/src/xtra2.c b/src/xtra2.c index f74995f45..1f54bd4ef 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -2722,8 +2722,7 @@ static void ang_sort_swap_distance(vptr u, vptr v, int a, int b) */ static POSITION_IDX target_pick(POSITION y1, POSITION x1, POSITION dy, POSITION dx) { - POSITION_IDX i; - int v; + POSITION_IDX i, v; POSITION x2, y2, x3, y3, x4, y4; POSITION_IDX b_i = -1, b_v = 9999; @@ -2997,7 +2996,7 @@ bool show_gold_on_floor = FALSE; * * This function must handle blindness/hallucination. */ -static int target_set_aux(int y, int x, BIT_FLAGS mode, cptr info) +static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) { cave_type *c_ptr = &cave[y][x]; s16b this_o_idx, next_o_idx = 0; @@ -3005,7 +3004,7 @@ static int target_set_aux(int y, int x, BIT_FLAGS mode, cptr info) bool boring = TRUE; s16b feat; feature_type *f_ptr; - int query = '\001'; + char query = '\001'; char out_val[MAX_NLEN+80]; #ifdef ALLOW_EASY_FLOOR