OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
authorDeskull <desull@users.sourceforge.jp>
Wed, 25 Oct 2017 23:36:53 +0000 (08:36 +0900)
committerDeskull <desull@users.sourceforge.jp>
Wed, 25 Oct 2017 23:36:53 +0000 (08:36 +0900)
15 files changed:
src/cmd2.c
src/cmd3.c
src/cmd5.c
src/dungeon.c
src/externs.h
src/h-type.h
src/init1.c
src/load.c
src/mind.c
src/object1.c
src/object2.c
src/racial.c
src/types.h
src/util.c
src/variable.c

index fb708a2..bbd673c 100644 (file)
@@ -3863,7 +3863,7 @@ static bool item_tester_hook_boomerang(object_type *o_ptr)
  * the item to be destroyed?  Should it do any damage at all?
  * </pre>
  */
-bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
+bool do_cmd_throw_aux(int mult, bool boomerang, OBJECT_IDX shuriken)
 {
        DIRECTION dir;
        OBJECT_IDX item;
index 5592c73..a2646c4 100644 (file)
@@ -234,7 +234,7 @@ void do_cmd_wield(void)
 
        cptr q, s;
 
-       int need_switch_wielding = 0;
+       OBJECT_IDX need_switch_wielding = 0;
 
        if (p_ptr->special_defense & KATA_MUSOU)
        {
index 9d1628a..07a2828 100644 (file)
@@ -656,7 +656,8 @@ static void change_realm2(CHARACTER_IDX next_realm)
  */
 void do_cmd_study(void)
 {
-       int     i, item;
+       int     i;
+       OBJECT_IDX item;
        OBJECT_SUBTYPE_VALUE sval;
        int     increment = 0;
        bool    learned = FALSE;
@@ -1054,7 +1055,7 @@ static void wild_magic(int spell)
  */
 void do_cmd_cast(void)
 {
-       int     item;
+       OBJECT_IDX item;
        OBJECT_SUBTYPE_VALUE sval;
        SPELL_IDX spell;
        REALM_IDX realm;
index 3655c66..dc55eba 100644 (file)
@@ -628,7 +628,7 @@ static void pattern_teleport(void)
                }
 
                /* Prompt */
-               sprintf(ppp, _("テレポート先:(%d-%d)", "Teleport to level (%d-%d): "), min_level, max_level);
+               sprintf(ppp, _("テレポート先:(%d-%d)", "Teleport to level (%d-%d): "), (int)min_level, (int)max_level);
 
                /* Default */
                sprintf(tmp_val, "%d", (int)dun_level);
@@ -1227,7 +1227,7 @@ void leave_tower_check(void)
  */
 bool psychometry(void)
 {
-       int             item;
+       OBJECT_IDX      item;
        object_type     *o_ptr;
        char            o_name[MAX_NLEN];
        byte            feel;
index fcf394e..dec3378 100644 (file)
@@ -620,7 +620,7 @@ extern FEAT_IDX feat_wall_inner;
 extern FEAT_IDX feat_wall_solid;
 extern FEAT_IDX floor_type[100], fill_type[100];
 extern bool now_damaged;
-extern s16b now_message;
+extern COMMAND_CODE now_message;
 extern bool use_menu;
 
 /* autopick.c */
@@ -735,7 +735,7 @@ extern void do_cmd_rest(void);
 extern void do_cmd_fire(void);
 extern void do_cmd_fire_aux(int item, object_type *j_ptr);
 extern void do_cmd_throw(void);
-extern bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken);
+extern bool do_cmd_throw_aux(int mult, bool boomerang, OBJECT_IDX shuriken);
 #ifdef TRAVEL
 extern void do_cmd_travel(void);
 #endif
@@ -1335,7 +1335,7 @@ extern void ascii_to_text(char *buf, cptr str);
 extern errr macro_add(cptr pat, cptr act);
 extern sint macro_find_exact(cptr pat);
 extern char inkey(void);
-extern cptr quark_str(s16b num);
+extern cptr quark_str(STR_OFFSET num);
 extern void quark_init(void);
 extern s16b quark_add(cptr str);
 extern s32b message_num(void);
index 9fbc5ec..9bb1f60 100644 (file)
@@ -155,6 +155,7 @@ typedef s32b GAME_TURN;     /*!< ゲーム中のターンの型定義 */
 typedef s16b PERCENTAGE;     /*!< ゲーム中のパーセント表記の型定義 */
 
 typedef u32b BIT_FLAGS;     /*!< 32ビットのフラグ配列の型定義 */
+typedef u16b BIT_FLAGS16;   /*!< 16ビットのフラグ配列の型定義 */
 typedef byte BIT_FLAGS8;    /*!< 8ビットのフラグ配列の型定義 */
 
 typedef s16b XTRA16;     /*!< 汎用変数16ビットの型定義 */
index 345252a..7bc8e61 100644 (file)
@@ -1834,7 +1834,7 @@ errr parse_f_info(char *buf, header *head)
                        if (1 == sscanf(s, "POWER_%d", &i))
                        {
                                /* Extract a "power" */
-                               f_ptr->power =  i;
+                               f_ptr->power = (FEAT_POWER)i;
 
                                /* Start at next entry */
                                s = t;
@@ -2233,7 +2233,7 @@ errr parse_k_info(char *buf, header *head)
                                &level, &extra, &wgt, &cost)) return (1);
 
                /* Save the values */
-               k_ptr->level = level;
+               k_ptr->level = (DEPTH)level;
                k_ptr->extra = extra;
                k_ptr->weight = (WEIGHT)wgt;
                k_ptr->cost = (PRICE)cost;
@@ -3355,16 +3355,16 @@ errr parse_d_info(char *buf, header *head)
                                 &min_lev, &max_lev, &min_plev, &mode, &min_alloc, &max_chance, &obj_good, &obj_great, (unsigned int *)&pit, (unsigned int *)&nest)) return (1);
 
                /* Save the values */
-               d_ptr->mindepth = min_lev;
-               d_ptr->maxdepth = max_lev;
-               d_ptr->min_plev = min_plev;
+               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->min_m_alloc_level = min_alloc;
                d_ptr->max_m_alloc_chance = max_chance;
                d_ptr->obj_good = obj_good;
                d_ptr->obj_great = obj_great;
-               d_ptr->pit = pit;
-               d_ptr->nest = nest;
+               d_ptr->pit = (BIT_FLAGS16)pit;
+               d_ptr->nest = (BIT_FLAGS16)nest;
        }
 
        /* Process 'P' for "Place Info" */
index 85cac20..db94d99 100644 (file)
@@ -3753,7 +3753,8 @@ static errr rd_savefile_new_aux(void)
        /* Read the player_hp array */
        for (i = 0; i < tmp16u; i++)
        {
-               rd_s16b(&p_ptr->player_hp[i]);
+               rd_s16b(&tmp16s);
+               p_ptr->player_hp[i] = (HIT_POINT)tmp16s;
        }
 
        /* Important -- Initialize the sex */
index a249ee8..2dd7f21 100644 (file)
@@ -1716,7 +1716,7 @@ static bool cast_ninja_spell(int spell)
                int i;
                for (i = 0; i < 8; i++)
                {
-                       int slot;
+                       OBJECT_IDX slot;
 
                        for (slot = 0; slot < INVEN_PACK; slot++)
                        {
index 5b2453c..f7fb66f 100644 (file)
@@ -1859,7 +1859,7 @@ void display_equip(void)
 static bool get_tag(COMMAND_CODE *cp, char tag, int mode)
 {
        COMMAND_CODE i;
-       int start, end;
+       COMMAND_CODE start, end;
        cptr s;
 
        /* Extract index from mode */
index 74ee35d..0de96c4 100644 (file)
@@ -7718,7 +7718,8 @@ static void display_essence(void)
 static void drain_essence(void)
 {
        int drain_value[sizeof(p_ptr->magic_num1) / sizeof(s32b)];
-       int i, item;
+       int i;
+       OBJECT_IDX item;
        int dec = 4;
        bool observe = FALSE;
        int old_ds, old_dd, old_to_h, old_to_d, old_ac, old_to_a, old_pval, old_name2;
@@ -8074,7 +8075,8 @@ static int choose_essence(void)
  */
 static void add_essence(int mode)
 {
-       int item, max_num = 0;
+       OBJECT_IDX item;
+       int max_num = 0;
        COMMAND_CODE i;
        bool flag,redraw;
        char choice;
@@ -8587,11 +8589,11 @@ static void add_essence(int mode)
  */
 static void erase_essence(void)
 {
-       int item;
+       OBJECT_IDX item;
        cptr q, s;
        object_type *o_ptr;
        char o_name[MAX_NLEN];
-       u32b flgs[TR_FLAG_SIZE];
+       BIT_FLAGS flgs[TR_FLAG_SIZE];
 
        item_tester_hook = object_is_smith;
 
index 7ce3b7e..91b7f4e 100644 (file)
@@ -139,7 +139,7 @@ static bool do_cmd_archer(void)
        /**********Create arrows*********/
        else if (ext == 2)
        {
-               int item;
+               OBJECT_IDX item;
                cptr q, s;
                s16b slot;
 
@@ -198,7 +198,7 @@ static bool do_cmd_archer(void)
        /**********Create bolts*********/
        else if (ext == 3)
        {
-               int item;
+               OBJECT_IDX item;
                cptr q, s;
                s16b slot;
 
@@ -263,7 +263,7 @@ static bool do_cmd_archer(void)
  */
 bool gain_magic(void)
 {
-       int item;
+       OBJECT_IDX item;
        PARAMETER_VALUE pval;
        int ext = 0;
        cptr q, s;
index e6414f6..aef5e97 100644 (file)
@@ -1609,29 +1609,29 @@ struct dungeon_info_type {
 
        DEPTH mindepth;         /* Minimal depth */
        DEPTH maxdepth;         /* Maximal depth */
-       byte min_plev;         /* Minimal plev needed to enter -- it's an anti-cheating mesure */
-       s16b pit;
-       s16b nest;
+       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 */
 
        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 */
 
-       u32b flags1;            /* Flags 1 */
-
-       u32b mflags1;           /* The monster flags that are allowed */
-       u32b mflags2;
-       u32b mflags3;
-       u32b mflags4;
-       u32b mflags7;
-       u32b mflags8;
-       u32b mflags9;
-       u32b mflagsr;
-
-       u32b m_a_ability_flags1;
-       u32b m_a_ability_flags2;
-       u32b m_a_ability_flags3;
-       u32b m_a_ability_flags4;
+       BIT_FLAGS flags1;               /* Flags 1 */
+
+       BIT_FLAGS mflags1;              /* The monster flags that are allowed */
+       BIT_FLAGS mflags2;
+       BIT_FLAGS mflags3;
+       BIT_FLAGS mflags4;
+       BIT_FLAGS mflags7;
+       BIT_FLAGS mflags8;
+       BIT_FLAGS mflags9;
+       BIT_FLAGS mflagsr;
+
+       BIT_FLAGS m_a_ability_flags1;
+       BIT_FLAGS m_a_ability_flags2;
+       BIT_FLAGS m_a_ability_flags3;
+       BIT_FLAGS m_a_ability_flags4;
 
        char r_char[5];         /* Monster race allowed */
        int final_object;       /* The object you'll find at the bottom */
index 0a230c0..f66b35d 100644 (file)
@@ -2379,7 +2379,7 @@ s16b quark_add(cptr str)
 /*
  * This function looks up a quark
  */
-cptr quark_str(s16b i)
+cptr quark_str(STR_OFFSET i)
 {
        cptr q;
 
index 4f63b18..0a853ef 100644 (file)
@@ -1262,7 +1262,7 @@ FEAT_IDX feat_wall_solid;
 FEAT_IDX floor_type[100], fill_type[100];
 
 bool now_damaged;
-s16b now_message;
+COMMAND_CODE now_message;
 bool use_menu;
 
 #ifdef CHUUKEI