OSDN Git Service

#37287 #37353 (2.2.0.89) PET_COMMAND_IDX, FF_FLAGS_IDX型を定義し、型の置換を継続中。 / Define PET_CO...
authorDeskull <desull@users.sourceforge.jp>
Mon, 11 Dec 2017 13:35:16 +0000 (22:35 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 11 Dec 2017 13:35:16 +0000 (22:35 +0900)
src/cmd5.c
src/h-type.h
src/init1.c
src/main-win.c
src/types.h
src/xtra2.c

index 7b3773b..ec5604c 100644 (file)
@@ -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;
index 56ad555..11e3b29 100644 (file)
@@ -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 ***/
 
index da537df..9ddb029 100644 (file)
@@ -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++)
index f7336f2..c741817 100644 (file)
@@ -1314,7 +1314,7 @@ static void load_prefs_aux(int i)
        /* Window size */\r
        if (i == 0)\r
        {\r
-               win_maximized = GetPrivateProfileInt(sec_name, "Maximized", win_maximized, ini_file);\r
+               win_maximized = (GetPrivateProfileInt(sec_name, "Maximized", win_maximized, ini_file) != 0);\r
        }\r
 \r
        /* Window position */\r
@@ -1326,7 +1326,7 @@ static void load_prefs_aux(int i)
        /* Window Z position */\r
        if (i > 0)\r
        {\r
-               td->posfix = GetPrivateProfileInt(sec_name, "PositionFix", td->posfix, ini_file);\r
+               td->posfix = (GetPrivateProfileInt(sec_name, "PositionFix", td->posfix, ini_file) != 0);\r
        }\r
 }\r
 \r
@@ -1339,10 +1339,10 @@ static void load_prefs(void)
        int i;\r
 \r
        /* Extract the "arg_graphics" flag */\r
-       arg_graphics = GetPrivateProfileInt("Angband", "Graphics", GRAPHICS_NONE, ini_file);\r
+       arg_graphics = (byte_hack)GetPrivateProfileInt("Angband", "Graphics", GRAPHICS_NONE, ini_file);\r
 \r
        /* Extract the "arg_bigtile" flag */\r
-       arg_bigtile = GetPrivateProfileInt("Angband", "Bigtile", FALSE, ini_file);\r
+       arg_bigtile = (GetPrivateProfileInt("Angband", "Bigtile", FALSE, ini_file) != 0);\r
        use_bigtile = arg_bigtile;\r
 \r
        /* Extract the "arg_sound" flag */\r
index e4152fa..f8443b4 100644 (file)
@@ -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) */
 };
index f74995f..1f54bd4 100644 (file)
@@ -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