OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
authorDeskull <desull@users.sourceforge.jp>
Fri, 29 Sep 2017 16:11:45 +0000 (01:11 +0900)
committerDeskull <desull@users.sourceforge.jp>
Fri, 29 Sep 2017 16:11:45 +0000 (01:11 +0900)
src/bldg.c
src/cmd4.c
src/h-type.h
src/mspells1.c
src/scores.c
src/spells1.c
src/spells3.c

index 4f48ae9..593155a 100644 (file)
@@ -3294,7 +3294,7 @@ static int repair_broken_weapon_aux(int bcost)
        else /* TV_BROKEN_SWORD */
        {
                /* Repair to a sword or sometimes material's type weapon */
        else /* TV_BROKEN_SWORD */
        {
                /* Repair to a sword or sometimes material's type weapon */
-               int tval = (one_in_(5) ? mo_ptr->tval : TV_SWORD);
+               IDX tval = (one_in_(5) ? mo_ptr->tval : TV_SWORD);
 
                while(1)
                {
 
                while(1)
                {
index 243e39c..88d658b 100644 (file)
@@ -3142,9 +3142,9 @@ static void print_visuals_menu(cptr choice_msg)
        prt(format("コマンド: %s", choice_msg ? choice_msg : _("", "")), 15, 0);
 }
 
        prt(format("コマンド: %s", choice_msg ? choice_msg : _("", "")), 15, 0);
 }
 
-static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx);
-static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx);
-static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level);
+static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX direct_r_idx);
+static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx);
+static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, int *lighting_level);
 
 /*
  * Interact with "visuals"
 
 /*
  * Interact with "visuals"
@@ -4314,7 +4314,7 @@ static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
  * mode & 0x01 : check for non-empty group
  * mode & 0x02 : visual operation only
  */
  * mode & 0x01 : check for non-empty group
  * mode & 0x02 : visual operation only
  */
-static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
+static int collect_monsters(int grp_cur, s16b mon_idx[], BIT_FLAGS8 mode)
 {
        int i, mon_cnt = 0;
        int dummy_why;
 {
        int i, mon_cnt = 0;
        int dummy_why;
@@ -4560,9 +4560,10 @@ static byte object_group_tval[] =
  * mode & 0x01 : check for non-empty group
  * mode & 0x02 : visual operation only
  */
  * mode & 0x01 : check for non-empty group
  * mode & 0x02 : visual operation only
  */
-static int collect_objects(int grp_cur, int object_idx[], byte mode)
+static int collect_objects(int grp_cur, IDX object_idx[], BIT_FLAGS8 mode)
 {
 {
-       int i, j, k, object_cnt = 0;
+       IDX i;
+       int j, k, object_cnt = 0;
 
        /* Get a list of x_char in this group */
        byte group_tval = object_group_tval[grp_cur];
 
        /* Get a list of x_char in this group */
        byte group_tval = object_group_tval[grp_cur];
@@ -4642,7 +4643,7 @@ static cptr feature_group_text[] =
  *
  * mode & 0x01 : check for non-empty group
  */
  *
  * mode & 0x01 : check for non-empty group
  */
-static int collect_features(int grp_cur, int *feat_idx, byte mode)
+static int collect_features(int grp_cur, IDX *feat_idx, BIT_FLAGS8 mode)
 {
        int i, feat_cnt = 0;
 
 {
        int i, feat_cnt = 0;
 
@@ -6300,7 +6301,7 @@ static void do_cmd_knowledge_kill_count(void)
  * @return なし
  */
 static void display_group_list(int col, int row, int wid, int per_page,
  * @return なし
  */
 static void display_group_list(int col, int row, int wid, int per_page,
-       int grp_idx[], cptr group_text[], int grp_cur, int grp_top)
+       IDX grp_idx[], cptr group_text[], int grp_cur, int grp_top)
 {
        int i;
 
 {
        int i;
 
@@ -6711,7 +6712,7 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
 /*
  * Display known monsters.
  */
 /*
  * Display known monsters.
  */
-static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx)
+static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX direct_r_idx)
 {
        IDX i;
        int len, max;
 {
        IDX i;
        int len, max;
@@ -6731,7 +6732,7 @@ static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int d
        int browser_rows;
        POSITION wid, hgt;
 
        int browser_rows;
        POSITION wid, hgt;
 
-       byte mode;
+       BIT_FLAGS8 mode;
 
        /* Get size */
        Term_get_size(&wid, &hgt);
 
        /* Get size */
        Term_get_size(&wid, &hgt);
@@ -7091,7 +7092,8 @@ static void desc_obj_fake(IDX k_idx)
  */
 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx)
 {
  */
 static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx)
 {
-       int i, len, max;
+       IDX i;
+       int len, max;
        IDX grp_cur, grp_top, old_grp_cur;
        IDX object_old, object_cur, object_top;
        int grp_cnt;
        IDX grp_cur, grp_top, old_grp_cur;
        IDX object_old, object_cur, object_top;
        int grp_cnt;
@@ -7117,7 +7119,7 @@ static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX di
        browser_rows = hgt - 8;
 
        /* Allocate the "object_idx" array */
        browser_rows = hgt - 8;
 
        /* Allocate the "object_idx" array */
-       C_MAKE(object_idx, max_k_idx, int);
+       C_MAKE(object_idx, max_k_idx, IDX);
 
        max = 0;
        grp_cnt = 0;
 
        max = 0;
        grp_cnt = 0;
@@ -7371,7 +7373,7 @@ static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX di
        }
 
        /* Free the "object_idx" array */
        }
 
        /* Free the "object_idx" array */
-       C_KILL(object_idx, max_k_idx, int);
+       C_KILL(object_idx, max_k_idx, IDX);
 }
 
 
 }
 
 
@@ -7451,13 +7453,14 @@ static void display_feature_list(int col, int row, int per_page, int *feat_idx,
  */
 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level)
 {
  */
 static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level)
 {
-       int i, len, max;
+       IDX i;
+       int len, max;
        IDX grp_cur, grp_top, old_grp_cur;
        IDX feat_cur, feat_top;
        int grp_cnt;
        IDX grp_idx[100];
        int feat_cnt;
        IDX grp_cur, grp_top, old_grp_cur;
        IDX feat_cur, feat_top;
        int grp_cnt;
        IDX grp_idx[100];
        int feat_cnt;
-       int *feat_idx;
+       IDX *feat_idx;
 
        int column = 0;
        bool flag;
 
        int column = 0;
        bool flag;
@@ -8342,7 +8345,8 @@ static void do_cmd_knowledge_quests(void)
 {
        FILE *fff;
        char file_name[1024];
 {
        FILE *fff;
        char file_name[1024];
-       int *quest_num, dummy, i;
+       IDX *quest_num;
+       int dummy, i;
 
        /* Open a new file */
        fff = my_fopen_temp(file_name, 1024);
 
        /* Open a new file */
        fff = my_fopen_temp(file_name, 1024);
index 04fbc78..0feaa6e 100644 (file)
@@ -140,7 +140,8 @@ typedef s32b GAME_TURN;     /*!< ゲーム中のターンの型定義 */
 
 typedef s16b PERCENTAGE;     /*!< ゲーム中のパーセント表記の型定義 */
 
 
 typedef s16b PERCENTAGE;     /*!< ゲーム中のパーセント表記の型定義 */
 
-typedef u32b BIT_FLAGS;     /*!< ゲーム中の階層レベルの型定義 */
+typedef u32b BIT_FLAGS;     /*!< 32ビットのフラグ配列の型定義 */
+typedef byte BIT_FLAGS8;    /*!< 8ビットのフラグ配列の型定義 */
 
 /*** Pointers to all the basic types defined above ***/
 
 
 /*** Pointers to all the basic types defined above ***/
 
index f46584b..02e8164 100644 (file)
@@ -1334,8 +1334,8 @@ bool spell_is_inate(u16b spell)
  * @param path_check 射線を判定するための関数ポインタ
  * @return 有効な座標があった場合TRUEを返す
  */
  * @param path_check 射線を判定するための関数ポインタ
  * @return 有効な座標があった場合TRUEを返す
  */
-static bool adjacent_grid_check(monster_type *m_ptr, int *yp, int *xp,
-       int f_flag, bool (*path_check)(int, int, int, int))
+static bool adjacent_grid_check(monster_type *m_ptr, POSITION *yp, POSITION *xp,
+       int f_flag, bool (*path_check)(POSITION, POSITION, POSITION, POSITION))
 {
        int i;
        int tonari;
 {
        int i;
        int tonari;
index dafb11e..4a92db2 100644 (file)
@@ -663,7 +663,8 @@ void show_highclass(void)
 {
 
        register int i = 0, j, m = 0;
 {
 
        register int i = 0, j, m = 0;
-       int pr, clev/*, al*/;
+       int pr;
+       PLAYER_LEVEL clev/*, al*/;
        high_score the_score;
        char buf[1024], out_val[256];
 
        high_score the_score;
        char buf[1024], out_val[256];
 
@@ -695,7 +696,7 @@ void show_highclass(void)
                if (highscore_seek(j)) break;
                if (highscore_read(&the_score)) break;
                pr = atoi(the_score.p_r);
                if (highscore_seek(j)) break;
                if (highscore_read(&the_score)) break;
                pr = atoi(the_score.p_r);
-               clev = atoi(the_score.cur_lev);
+               clev = (PLAYER_LEVEL)atoi(the_score.cur_lev);
 
 #ifdef JP
                sprintf(out_val, "   %3d) %sの%s (レベル %2d)",
 
 #ifdef JP
                sprintf(out_val, "   %3d) %sの%s (レベル %2d)",
index c58c5b0..29e8c31 100644 (file)
@@ -6820,7 +6820,7 @@ bool project(int who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, int t
        POSITION gm[32];
 
        /* Actual radius encoded in gm[] */
        POSITION gm[32];
 
        /* Actual radius encoded in gm[] */
-       int gm_rad = rad;
+       POSITION gm_rad = rad;
 
        bool jump = FALSE;
 
 
        bool jump = FALSE;
 
index 8483de3..0167c93 100644 (file)
@@ -520,7 +520,7 @@ void teleport_player_away(int m_idx, int dis)
        {
                for (yy = -1; yy < 2; yy++)
                {
        {
                for (yy = -1; yy < 2; yy++)
                {
-                       int tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+                       IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
 
                        /* A monster except your mount or caster may follow */
                        if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
 
                        /* A monster except your mount or caster may follow */
                        if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))