OSDN Git Service

#37287 #37353 (2.2.0.89) REAL_TIME 型を再定義し、型の置換を継続中。 / Re-define REAL_TIME, ongoing...
authorDeskull <desull@users.sourceforge.jp>
Sun, 10 Dec 2017 04:16:12 +0000 (13:16 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sun, 10 Dec 2017 04:16:12 +0000 (13:16 +0900)
12 files changed:
src/cave.c
src/cmd5.c
src/cmd6.c
src/dungeon.c
src/h-type.h
src/init1.c
src/object1.c
src/save.c
src/spells3.c
src/types.h
src/util.c
src/xtra2.c

index e75d77d..d8c615a 100644 (file)
@@ -4934,12 +4934,12 @@ bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
  *
  * Currently the "m" parameter is unused.
  */
-void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, int m)
+void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode)
 {
        POSITION nx, ny;
 
        /* Unused */
-       m = m;
+       mode = mode;
 
        /* Pick a location */
        while (TRUE)
index 2565241..b8d6142 100644 (file)
@@ -471,10 +471,10 @@ void do_cmd_browse(void)
        REALM_IDX use_realm = 0;
        int j, line;
        SPELL_IDX spell = -1;
-       int             num = 0;
+       int num = 0;
 
-       int             spells[64];
-       char    temp[62*4];
+       SPELL_IDX spells[64];
+       char temp[62*4];
 
        object_type     *o_ptr;
 
index d344cc7..505ddd1 100644 (file)
@@ -3791,9 +3791,9 @@ static void do_cmd_activate_aux(int item)
                        if(fire_ball(GF_CAPTURE, dir, 0, 0))
                        {
                                o_ptr->pval = (PARAMETER_VALUE)cap_mon;
-                               o_ptr->xtra3 = cap_mspeed;
-                               o_ptr->xtra4 = cap_hp;
-                               o_ptr->xtra5 = cap_maxhp;
+                               o_ptr->xtra3 = (XTRA8)cap_mspeed;
+                               o_ptr->xtra4 = (XTRA16)cap_hp;
+                               o_ptr->xtra5 = (XTRA16)cap_maxhp;
                                if (cap_nickname)
                                {
                                        cptr t;
index e191788..9603301 100644 (file)
@@ -1065,7 +1065,7 @@ static void regen_captured_monsters(void)
                        if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
 
                        /* Hack -- Regenerate */
-                       o_ptr->xtra4 += frac;
+                       o_ptr->xtra4 += (XTRA16)frac;
 
                        /* Do not over-regenerate */
                        if (o_ptr->xtra4 > o_ptr->xtra5) o_ptr->xtra4 = o_ptr->xtra5;
index 9127531..a35844a 100644 (file)
@@ -196,7 +196,7 @@ typedef s32b DEPTH;     /*!< ゲーム中の階層レベルの型定義 */
 typedef byte RARITY;    /*!< ゲーム中の希少度の型定義 */
 
 typedef s32b GAME_TURN;     /*!< ゲーム中のターンの型定義 */
-typedef s32b REAL_TIME;     /*!< 実時刻の型定義 */
+typedef u32b REAL_TIME;     /*!< 実時刻の型定義 */
 
 typedef s16b PERCENTAGE;    /*!< ゲーム中のパーセント表記の型定義(/100倍) */
 typedef s16b MULTIPLY;      /*!< ゲーム中の倍率の型定義(/10倍) */
index 79dd1bf..d826303 100644 (file)
@@ -3358,7 +3358,7 @@ errr parse_d_info(char *buf, header *head)
                d_ptr->mindepth = (DEPTH)min_lev;
                d_ptr->maxdepth = (DEPTH)max_lev;
                d_ptr->min_plev = (PLAYER_LEVEL)min_plev;
-               d_ptr->mode = mode;
+               d_ptr->mode = (BIT_FLAGS8)mode;
                d_ptr->min_m_alloc_level = min_alloc;
                d_ptr->max_m_alloc_chance = max_chance;
                d_ptr->obj_good = obj_good;
@@ -3848,10 +3848,10 @@ static errr parse_line_building(char *buf)
                                strcpy(building[index].act_names[action_index], zz[1]);
 
                                /* Cost of the action for members */
-                               building[index].member_costs[action_index] = atoi(zz[2]);
+                               building[index].member_costs[action_index] = (PRICE)atoi(zz[2]);
 
                                /* Cost of the action for non-members */
-                               building[index].other_costs[action_index] = atoi(zz[3]);
+                               building[index].other_costs[action_index] = (PRICE)atoi(zz[3]);
 
                                /* Letter assigned to the action */
                                building[index].letters[action_index] = zz[4][0];
index ac8176b..60137b3 100644 (file)
@@ -1982,7 +1982,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
  * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
  * and "x" is the "current" command_cmd code.\n
  */
-static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], FLOOR_IDX floor_num)
+static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
 {
        COMMAND_CODE i;
        cptr s;
@@ -2107,7 +2107,7 @@ static void prepare_label_string(char *label, BIT_FLAGS mode)
  */
 /*
  */
-static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], FLOOR_IDX floor_num)
+static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
 {
        cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int  i;
@@ -2653,7 +2653,9 @@ static bool get_item_okay(OBJECT_IDX i)
  */
 bool can_get_item(void)
 {
-       int j, floor_list[23], floor_num = 0;
+       int j;
+       OBJECT_IDX floor_list[23];
+       ITEM_NUMBER floor_num = 0;
 
        for (j = 0; j < INVEN_TOTAL; j++)
                if (item_tester_okay(&inventory[j]))
index ec61b98..8ff1894 100644 (file)
@@ -797,7 +797,7 @@ static void wr_extra(void)
        wr_byte(p_ptr->knowledge);
        wr_byte(p_ptr->autopick_autoregister);
        wr_byte(0);     /* oops */
-       wr_byte(p_ptr->action);
+       wr_byte((byte_hack)p_ptr->action);
        wr_byte(0);
        wr_byte(preserve_mode);
        wr_byte(p_ptr->wait_report_score);
index 3a22045..685803d 100644 (file)
@@ -1243,7 +1243,7 @@ void apply_nexus(monster_type *m_ptr)
  */
 void phlogiston(void)
 {
-       int max_flog = 0;
+       GAME_TURN max_flog = 0;
        object_type * o_ptr = &inventory[INVEN_LITE];
 
        /* It's a lamp */
@@ -1272,7 +1272,7 @@ void phlogiston(void)
        }
 
        /* Refuel */
-       o_ptr->xtra4 += (max_flog / 2);
+       o_ptr->xtra4 += (XTRA16)(max_flog / 2);
 
        /* Message */
        msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
@@ -1280,7 +1280,7 @@ void phlogiston(void)
        /* Comment */
        if (o_ptr->xtra4 >= max_flog)
        {
-               o_ptr->xtra4 = max_flog;
+               o_ptr->xtra4 = (XTRA16)max_flog;
                msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
        }
 
index 639d43b..e61eb9a 100644 (file)
@@ -1456,8 +1456,8 @@ struct building_type
        char owner_race[20];            /* proprietor race */
 
        char act_names[8][30];          /* action names */
-       s32b member_costs[8];           /* Costs for class members of building */
-       s32b other_costs[8];                /* Costs for nonguild members */
+       PRICE member_costs[8];           /* Costs for class members of building */
+       PRICE other_costs[8];               /* Costs for nonguild members */
        char letters[8];                /* action letters */
        s16b actions[8];                /* action codes */
        s16b action_restr[8];           /* action restrictions */
@@ -1614,7 +1614,7 @@ struct dungeon_info_type {
        PLAYER_LEVEL min_plev;         /* Minimal plev needed to enter -- it's an anti-cheating mesure */
        BIT_FLAGS16 pit;
        BIT_FLAGS16 nest;
-       byte mode;              /* Mode of combinaison of the monster flags */
+       BIT_FLAGS8 mode; /* Mode of combinaison of the monster flags */
 
        int min_m_alloc_level;  /* Minimal number of monsters per level */
        int max_m_alloc_chance; /* There is a 1/max_m_alloc_chance chance per round of creating a new monster */
index 1682ea8..fb7cc6c 100644 (file)
@@ -4620,7 +4620,7 @@ void request_command(int shopping)
        if (always_repeat && (command_arg <= 0))
        {
                /* Hack -- auto repeat certain commands */
-               if (my_strchr("TBDoc+", (COMMAND_CODE)command_cmd))
+               if (my_strchr("TBDoc+", (char)command_cmd))
                {
                        /* Repeat 99 times */
                        command_arg = 99;
index b19131c..f40f1f8 100644 (file)
@@ -27,7 +27,7 @@ void check_experience(void)
        bool level_mutation = FALSE;
        bool level_inc_stat = FALSE;
        bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
-       int  old_lev = p_ptr->lev;
+       PLAYER_LEVEL old_lev = p_ptr->lev;
 
        /* Hack -- lower limit */
        if (p_ptr->exp < 0) p_ptr->exp = 0;
@@ -3010,7 +3010,8 @@ static int target_set_aux(int y, int x, BIT_FLAGS mode, cptr info)
        char out_val[MAX_NLEN+80];
 
 #ifdef ALLOW_EASY_FLOOR
-       int floor_list[23], floor_num = 0;
+       OBJECT_IDX floor_list[23];
+       ITEM_NUMBER floor_num = 0;
 
        /* Scan all objects in the grid */
        if (easy_floor)
@@ -3264,10 +3265,10 @@ static int target_set_aux(int y, int x, BIT_FLAGS mode, cptr info)
                                /* Display rough information about items */
 #ifdef JP
                                sprintf(out_val, "%s %d個のアイテム%s%s ['x'で一覧, %s]",
-                                       s1, floor_num, s2, s3, info);
+                                       s1, (int)floor_num, s2, s3, info);
 #else
                                sprintf(out_val, "%s%s%sa pile of %d items [x,%s]",
-                                       s1, s2, s3, floor_num, info);
+                                       s1, s2, s3, (int)floor_num, info);
 #endif
 
                                prt(out_val, 0, 0);
@@ -3300,10 +3301,10 @@ static int target_set_aux(int y, int x, BIT_FLAGS mode, cptr info)
                                /* Prompt */
 #ifdef JP
                                sprintf(out_val, "%s %d個のアイテム%s%s [Enterで次へ, %s]",
-                                       s1, floor_num, s2, s3, info);
+                                       s1, (int)floor_num, s2, s3, info);
 #else
                                sprintf(out_val, "%s%s%sa pile of %d items [Enter,%s]",
-                                       s1, s2, s3, floor_num, info);
+                                       s1, s2, s3, (int)floor_num, info);
 #endif
                                prt(out_val, 0, 0);