OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
authorDeskull <desull@users.sourceforge.jp>
Sun, 24 Sep 2017 16:10:30 +0000 (01:10 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sun, 24 Sep 2017 16:10:30 +0000 (01:10 +0900)
15 files changed:
src/bldg.c
src/cave.c
src/cmd1.c
src/cmd4.c
src/externs.h
src/files.c
src/load.c
src/mspells2.c
src/mspells4.c
src/object2.c
src/rooms.c
src/spells1.c
src/types.h
src/xtra1.c
src/xtra2.c

index 91dcb3d..a134ffc 100644 (file)
@@ -2161,10 +2161,10 @@ static bool inn_comm(int cmd)
  * @param do_init クエストの開始処理(TRUE)、結果処理か(FALSE)
  * @return なし
  */
  * @param do_init クエストの開始処理(TRUE)、結果処理か(FALSE)
  * @return なし
  */
-static void get_questinfo(int questnum, bool do_init)
+static void get_questinfo(IDX questnum, bool do_init)
 {
        int     i;
 {
        int     i;
-       int     old_quest;
+       IDX     old_quest;
        char    tmp_str[80];
 
        /* Clear the text */
        char    tmp_str[80];
 
        /* Clear the text */
@@ -2800,14 +2800,14 @@ static void list_weapon(object_type *o_ptr, int row, int col)
 
        /* Damage for one blow (if it hits) */
        sprintf(tmp_str, _("攻撃一回につき %d-%d", "One Strike: %d-%d damage"),
 
        /* Damage for one blow (if it hits) */
        sprintf(tmp_str, _("攻撃一回につき %d-%d", "One Strike: %d-%d damage"),
-           eff_dd + o_ptr->to_d + p_ptr->to_d[0],
-           eff_ds * eff_dd + o_ptr->to_d + p_ptr->to_d[0]);
+           (int)(eff_dd + o_ptr->to_d + p_ptr->to_d[0]),
+               (int)(eff_ds * eff_dd + o_ptr->to_d + p_ptr->to_d[0]));
        put_str(tmp_str, row+6, col+1);
 
        /* Damage for the complete attack (if all blows hit) */
        sprintf(tmp_str, _("1ターンにつき %d-%d", "One Attack: %d-%d damage"),
        put_str(tmp_str, row+6, col+1);
 
        /* Damage for the complete attack (if all blows hit) */
        sprintf(tmp_str, _("1ターンにつき %d-%d", "One Attack: %d-%d damage"),
-           p_ptr->num_blow[0] * (eff_dd + o_ptr->to_d + p_ptr->to_d[0]),
-           p_ptr->num_blow[0] * (eff_ds * eff_dd + o_ptr->to_d + p_ptr->to_d[0]));
+               (int)(p_ptr->num_blow[0] * (eff_dd + o_ptr->to_d + p_ptr->to_d[0])),
+                       (int)(p_ptr->num_blow[0] * (eff_ds * eff_dd + o_ptr->to_d + p_ptr->to_d[0])));
        put_str(tmp_str, row+7, col+1);
 }
 
        put_str(tmp_str, row+7, col+1);
 }
 
@@ -3186,7 +3186,8 @@ static int repair_broken_weapon_aux(int bcost)
        int item, mater;
        object_type *o_ptr, *mo_ptr; /* broken weapon and material weapon */
        object_kind *k_ptr;
        int item, mater;
        object_type *o_ptr, *mo_ptr; /* broken weapon and material weapon */
        object_kind *k_ptr;
-       int i, k_idx, dd_bonus, ds_bonus;
+       int i, dd_bonus, ds_bonus;
+       IDX k_idx;
        char basenm[MAX_NLEN];
        cptr q, s; /* For get_item prompt */
        int row = 7;
        char basenm[MAX_NLEN];
        cptr q, s; /* For get_item prompt */
        int row = 7;
index 552c029..d22c077 100644 (file)
@@ -2815,10 +2815,11 @@ static POSITION mon_fy, mon_fx;
 /*
  * Add a square to the changes array
  */
 /*
  * Add a square to the changes array
  */
-static void mon_lite_hack(int y, int x)
+static void mon_lite_hack(POSITION y, POSITION x)
 {
        cave_type *c_ptr;
 {
        cave_type *c_ptr;
-       int       midpoint, dpf, d;
+       int dpf, d;
+       POSITION midpoint;
 
        /* We trust this grid is in bounds */
        /* if (!in_bounds2(y, x)) return; */
 
        /* We trust this grid is in bounds */
        /* if (!in_bounds2(y, x)) return; */
@@ -3222,8 +3223,8 @@ void update_mon_lite(void)
                }
 
                /* Add to end of temp array */
                }
 
                /* Add to end of temp array */
-               temp_x[temp_n] = (byte)fx;
-               temp_y[temp_n] = (byte)fy;
+               temp_x[temp_n] = fx;
+               temp_y[temp_n] = fy;
                temp_n++;
        }
 
                temp_n++;
        }
 
@@ -3580,14 +3581,15 @@ static bool update_view_aux(int y, int x, int y1, int x1, int y2, int x2)
  */
 void update_view(void)
 {
  */
 void update_view(void)
 {
-       int n, m, d, k, y, x, z;
+       int n, m, d, k, z;
+       POSITION y, x;
 
        int se, sw, ne, nw, es, en, ws, wn;
 
        int full, over;
 
 
        int se, sw, ne, nw, es, en, ws, wn;
 
        int full, over;
 
-       int y_max = cur_hgt - 1;
-       int x_max = cur_wid - 1;
+       POSITION y_max = cur_hgt - 1;
+       POSITION x_max = cur_wid - 1;
 
        cave_type *c_ptr;
 
 
        cave_type *c_ptr;
 
@@ -4120,7 +4122,7 @@ static POSITION flow_y = 0;
  */
 void update_flow(void)
 {
  */
 void update_flow(void)
 {
-       int x, y, d;
+       POSITION x, y, d;
        int flow_head = 1;
        int flow_tail = 0;
 
        int flow_head = 1;
        int flow_tail = 0;
 
index f87f653..8bacc4f 100644 (file)
@@ -1065,7 +1065,7 @@ static void hit_trap_slow(void)
  * @param turn 状態異常の追加ターン量
  * @return なし
  */
  * @param turn 状態異常の追加ターン量
  * @return なし
  */
-static void hit_trap_set_abnormal_status(cptr trap_message, bool resist, bool (*set_status)(int), int turn_aux)
+static void hit_trap_set_abnormal_status(cptr trap_message, bool resist, bool (*set_status)(IDX), IDX turn_aux)
 {
        msg_print(trap_message);
 
 {
        msg_print(trap_message);
 
index 40c9ab4..6ee7832 100644 (file)
@@ -8163,7 +8163,7 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
 }
 
 
 }
 
 
-static bool do_cmd_knowledge_quests_aux(FILE *fff, int q_idx)
+static bool do_cmd_knowledge_quests_aux(FILE *fff, IDX q_idx)
 {
        char tmp_str[120];
        char playtime_str[16];
 {
        char tmp_str[120];
        char playtime_str[16];
index 1be7a00..24c991b 100644 (file)
@@ -1091,7 +1091,7 @@ extern bool save_floor(saved_floor_type *sf_ptr, u32b mode);
 
 /* spells1.c */
 extern bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 
 /* spells1.c */
 extern bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
-extern void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ);
+extern void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ);
 extern int take_hit(int damage_type, HIT_POINT damage, cptr kb_str, int monspell);
 extern u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, int typ);
 extern sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int flg);
 extern int take_hit(int damage_type, HIT_POINT damage, cptr kb_str, int monspell);
 extern u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, int typ);
 extern sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int flg);
index 7b3b23a..1a2a25a 100644 (file)
@@ -3937,7 +3937,7 @@ void display_player(int mode)
                                else
                                {
 #ifdef JP
                                else
                                {
 #ifdef JP
-                                       sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(), dun_level, p_ptr->died_from);
+                                       sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(), (int)dun_level, p_ptr->died_from);
 #else
                                        sprintf(statmsg, "...You were killed by %s on level %d of %s.", p_ptr->died_from, dun_level, map_name());
 #endif
 #else
                                        sprintf(statmsg, "...You were killed by %s on level %d of %s.", p_ptr->died_from, dun_level, map_name());
 #endif
@@ -3969,7 +3969,7 @@ void display_player(int mode)
                                else
                                {
 #ifdef JP
                                else
                                {
 #ifdef JP
-                                       sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(), dun_level);
+                                       sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(), (int)dun_level);
 #else
                                        sprintf(statmsg, "...Now, you are exploring level %d of %s.", dun_level, map_name());
 #endif
 #else
                                        sprintf(statmsg, "...Now, you are exploring level %d of %s.", dun_level, map_name());
 #endif
@@ -4710,7 +4710,7 @@ static void dump_aux_monsters(FILE *fff)
                for (k = uniq_total - 1; k >= 0 && k >= uniq_total - 10; k--)
                {
                        monster_race *r_ptr = &r_info[who[k]];
                for (k = uniq_total - 1; k >= 0 && k >= uniq_total - 10; k--)
                {
                        monster_race *r_ptr = &r_info[who[k]];
-                       fprintf(fff, _("  %-40s (レベル%3d)\n", "  %-40s (level %3d)\n"), (r_name + r_ptr->name), r_ptr->level); 
+                       fprintf(fff, _("  %-40s (レベル%3d)\n", "  %-40s (level %3d)\n"), (r_name + r_ptr->name), (int)r_ptr->level);
                }
 
        }
                }
 
        }
@@ -6488,11 +6488,11 @@ static void print_tomb(void)
                        {
                                if (streq(p_ptr->died_from, "途中終了"))
                                {
                        {
                                if (streq(p_ptr->died_from, "途中終了"))
                                {
-                                       sprintf(tmp, "地下 %d 階で死んだ", dun_level);
+                                       sprintf(tmp, "地下 %d 階で死んだ", (int)dun_level);
                                }
                                else
                                {
                                }
                                else
                                {
-                                       sprintf(tmp, "に地下 %d 階で殺された", dun_level);
+                                       sprintf(tmp, "に地下 %d 階で殺された", (int)dun_level);
                                }
                        }
                        center_string(buf, tmp);
                                }
                        }
                        center_string(buf, tmp);
index 33a9ec0..1a74691 100644 (file)
@@ -2844,7 +2844,7 @@ static errr rd_dungeon_old(void)
        /* Read the monsters */
        for (i = 1; i < limit; i++)
        {
        /* Read the monsters */
        for (i = 1; i < limit; i++)
        {
-               int m_idx;
+               IDX m_idx;
                monster_type *m_ptr;
 
                /* Get a new record */
                monster_type *m_ptr;
 
                /* Get a new record */
index 719c280..93d3b23 100644 (file)
@@ -87,7 +87,7 @@ static bool breath_direct(int y1, int x1, int y2, int x2, int rad, int typ, bool
        u16b grid_g[512];
 
        int grids = 0;
        u16b grid_g[512];
 
        int grids = 0;
-       byte gx[1024], gy[1024];
+       POSITION gx[1024], gy[1024];
        byte gm[32];
        int gm_rad = rad;
 
        byte gm[32];
        int gm_rad = rad;
 
index 5a07bcd..8779941 100644 (file)
@@ -3175,12 +3175,12 @@ void spell_RF6_S_DRAGON(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
 * @param m_idx 呪文を唱えるモンスターID
 * @return 召喚したモンスターの数を返す。
 */
 * @param m_idx 呪文を唱えるモンスターID
 * @return 召喚したモンスターの数を返す。
 */
-int summon_NAZGUL(int y, int x, int m_idx)
+int summon_NAZGUL(POSITION y, POSITION x, IDX m_idx)
 {
        u32b mode = 0L;
        int count = 0, k;
 {
        u32b mode = 0L;
        int count = 0, k;
-       int cy = y;
-       int cx = x;
+       POSITION cy = y;
+       POSITION cx = x;
        char m_name[80];
        monster_name(m_idx, m_name);
 
        char m_name[80];
        monster_name(m_idx, m_name);
 
index 1692213..d1653d9 100644 (file)
@@ -2101,7 +2101,7 @@ static void object_mention(object_type *o_ptr)
 static bool make_artifact_special(object_type *o_ptr)
 {
        int i;
 static bool make_artifact_special(object_type *o_ptr)
 {
        int i;
-       int k_idx = 0;
+       IDX k_idx = 0;
 
        /*! @note 地上ではキャンセルする / No artifacts in the town */
        if (!dun_level) return (FALSE);
 
        /*! @note 地上ではキャンセルする / No artifacts in the town */
        if (!dun_level) return (FALSE);
index 836f514..655bf7d 100644 (file)
@@ -3542,7 +3542,7 @@ static bool hack_isnt_wall(int y, int x, int c1, int c2, int c3, int feat1, int
  * Quick and nasty fill routine used to find the connected region
  * of floor in the middle of the cave
  */
  * Quick and nasty fill routine used to find the connected region
  * of floor in the middle of the cave
  */
-static void cave_fill(byte y, byte x)
+static void cave_fill(POSITION y, POSITION x)
 {
        int i, j, d;
        int ty, tx;
 {
        int i, j, d;
        int ty, tx;
index 27c6deb..c58c5b0 100644 (file)
@@ -6544,7 +6544,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
 /*
  * breath shape
  */
 /*
  * breath shape
  */
-void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ)
+void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ)
 {
        int by = y1;
        int bx = x1;
 {
        int by = y1;
        int bx = x1;
index 4c7a0ef..4ce6c7d 100644 (file)
@@ -530,8 +530,8 @@ struct object_type
 
        WEIGHT weight;          /* Item weight */
 
 
        WEIGHT weight;          /* Item weight */
 
-       byte name1;                     /* Artifact type, if any */
-       byte name2;                     /* Ego-Item type, if any */
+       IDX name1;                      /* Artifact type, if any */
+       IDX name2;                      /* Ego-Item type, if any */
 
        byte xtra1;                     /* Extra info type (now unused) */
        byte xtra2;                     /* Extra info activation index */
 
        byte xtra1;                     /* Extra info type (now unused) */
        byte xtra2;                     /* Extra info activation index */
index 57ba91e..2714864 100644 (file)
@@ -1030,8 +1030,8 @@ static void prt_depth(void)
        }
        else
        {
        }
        else
        {
-               if (depth_in_feet) (void)sprintf(depths, _("%d ft", "%d ft"), dun_level * 50);
-               else (void)sprintf(depths, _("%d 階", "Lev %d"), dun_level);
+               if (depth_in_feet) (void)sprintf(depths, _("%d ft", "%d ft"), (int)dun_level * 50);
+               else (void)sprintf(depths, _("%d 階", "Lev %d"), (int)dun_level);
 
                /* Get color of level based on feeling  -JSV- */
                switch (p_ptr->feeling)
 
                /* Get color of level based on feeling  -JSV- */
                switch (p_ptr->feeling)
@@ -1762,7 +1762,7 @@ static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){
        Term_add_bigch(r_ptr->x_attr, r_ptr->x_char);
        //LV
        if (r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE)){
        Term_add_bigch(r_ptr->x_attr, r_ptr->x_char);
        //LV
        if (r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE)){
-               sprintf(buf, " %2d", r_ptr->level);
+               sprintf(buf, " %2d", (int)r_ptr->level);
        }else{
                strcpy(buf, " ??");
        }
        }else{
                strcpy(buf, " ??");
        }
index d6f4c8c..63ef804 100644 (file)
@@ -624,7 +624,7 @@ void check_quest_completion(monster_type *m_ptr)
        /* Create a magical staircase */
        if (create_stairs)
        {
        /* Create a magical staircase */
        if (create_stairs)
        {
-               int ny, nx;
+               POSITION ny, nx;
 
                /* Stagger around */
                while (cave_perma_bold(y, x) || cave[y][x].o_idx || (cave[y][x].info & CAVE_OBJECT) )
 
                /* Stagger around */
                while (cave_perma_bold(y, x) || cave[y][x].o_idx || (cave[y][x].info & CAVE_OBJECT) )
@@ -2904,7 +2904,7 @@ static void target_set_prepare(int mode)
 
        if (p_ptr->riding && target_pet && (temp_n > 1) && (mode & (TARGET_KILL)))
        {
 
        if (p_ptr->riding && target_pet && (temp_n > 1) && (mode & (TARGET_KILL)))
        {
-               byte tmp;
+               POSITION tmp;
 
                tmp = temp_y[0];
                temp_y[0] = temp_y[1];
 
                tmp = temp_y[0];
                temp_y[0] = temp_y[1];
@@ -3286,7 +3286,8 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                        /* Continue scrolling list if requested */
                        while (1)
                        {
                        /* Continue scrolling list if requested */
                        while (1)
                        {
-                               int i, o_idx;
+                               int i;
+                               IDX o_idx;
 
                                /* Save screen */
                                screen_save();
 
                                /* Save screen */
                                screen_save();
@@ -3582,8 +3583,8 @@ static int target_set_aux(int y, int x, int mode, cptr info)
 bool target_set(int mode)
 {
        int             i, d, m, t, bd;
 bool target_set(int mode)
 {
        int             i, d, m, t, bd;
-       int             y = p_ptr->y;
-       int             x = p_ptr->x;
+       POSITION y = p_ptr->y;
+       POSITION x = p_ptr->x;
 
        bool    done = FALSE;
 
 
        bool    done = FALSE;
 
@@ -5762,7 +5763,7 @@ void display_rumor(bool ex)
                {
                        if (strcmp(zz[0], "ARTIFACT") == 0)
                        {
                {
                        if (strcmp(zz[0], "ARTIFACT") == 0)
                        {
-                               int a_idx, k_idx;
+                               IDX a_idx, k_idx;
                                object_type forge;
                                object_type *q_ptr = &forge;
                                artifact_type *a_ptr;
                                object_type forge;
                                object_type *q_ptr = &forge;
                                artifact_type *a_ptr;