OSDN Git Service

#37287 #37353 (2.2.0.89) KIND_OBJECT_IDX型とMONSTER_NUMBER型を定義し、型の置換を継続中。 / KIND_OBJECT...
[hengband/hengband.git] / src / wizard2.c
index 84f4cf7..1c94028 100644 (file)
@@ -31,7 +31,7 @@ void do_cmd_rerate_aux(void)
        while (1)
        {
                /* Pre-calculate level 1 hitdice */
-               p_ptr->player_hp[0] = p_ptr->hitdie;
+               p_ptr->player_hp[0] = (HIT_POINT)p_ptr->hitdie;
 
                for (i = 1; i < 4; i++)
                {
@@ -182,7 +182,7 @@ static void do_cmd_wiz_hack_ben(void)
  */
 static void do_cmd_summon_horde(void)
 {
-       int wy = p_ptr->y, wx = p_ptr->x;
+       POSITION wy = p_ptr->y, wx = p_ptr->x;
        int attempts = 1000;
 
        while (--attempts)
@@ -233,7 +233,7 @@ static void prt_binary(u32b flags, int row, int col)
  * @param col 表示行
  * @return なし
  */
-static void prt_alloc(byte tval, byte sval, int row, int col)
+static void prt_alloc(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval, TERM_POSITION row, TERM_POSITION col)
 {
        int i, j;
        int home = 0;
@@ -745,11 +745,11 @@ void strip_name(char *buf, int k_idx)
  * This function returns the k_idx of an object type, or zero if failed
  * List up to 50 choices in three columns
  */
-static int wiz_create_itemtype(void)
+static IDX wiz_create_itemtype(void)
 {
        int i, num, max_num;
        int col, row;
-       int tval;
+       OBJECT_TYPE_VALUE tval;
 
        cptr tval_desc;
        char ch;
@@ -1205,7 +1205,7 @@ static void wiz_quantity_item(object_type *o_ptr)
        tmp_qnt = o_ptr->number;
 
        /* Default */
-       sprintf(tmp_val, "%d", o_ptr->number);
+       sprintf(tmp_val, "%d", (int)o_ptr->number);
 
        /* Query */
        if (get_string("Quantity: ", tmp_val, 2))
@@ -1272,7 +1272,7 @@ static void do_cmd_wiz_blue_mage(void)
  */
 static void do_cmd_wiz_play(void)
 {
-       int item;
+       OBJECT_IDX item;
 
        object_type     forge;
        object_type *q_ptr;
@@ -1415,8 +1415,7 @@ static void wiz_create_item(void)
        object_type     forge;
        object_type *q_ptr;
 
-       int k_idx;
-
+       IDX k_idx;
 
        /* Save the screen */
        screen_save();
@@ -1427,7 +1426,6 @@ static void wiz_create_item(void)
        /* Restore the screen */
        screen_load();
 
-
        /* Return if failed */
        if (!k_idx) return;
 
@@ -1557,7 +1555,8 @@ static void do_cmd_wiz_jump(void)
                if (!d_info[tmp_dungeon_type].maxdepth || (tmp_dungeon_type > max_d_idx)) tmp_dungeon_type = DUNGEON_ANGBAND;
 
                /* Prompt */
-               sprintf(ppp, "Jump to level (0, %d-%d): ", d_info[tmp_dungeon_type].mindepth, d_info[tmp_dungeon_type].maxdepth);
+               sprintf(ppp, "Jump to level (0, %d-%d): ",
+                       (int)d_info[tmp_dungeon_type].mindepth, (int)d_info[tmp_dungeon_type].maxdepth);
 
                /* Default */
                sprintf(tmp_val, "%d", (int)dun_level);
@@ -1619,7 +1618,7 @@ static void do_cmd_wiz_jump(void)
  */
 static void do_cmd_wiz_learn(void)
 {
-       int i;
+       IDX i;
 
        object_type forge;
        object_type *q_ptr;
@@ -1671,7 +1670,7 @@ static void do_cmd_wiz_summon(int num)
  * @details
  * XXX XXX XXX This function is rather dangerous
  */
-static void do_cmd_wiz_named(int r_idx)
+static void do_cmd_wiz_named(MONRACE_IDX r_idx)
 {
        (void)summon_named_creature(0, p_ptr->y, p_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
 }
@@ -1685,7 +1684,7 @@ static void do_cmd_wiz_named(int r_idx)
  * @details
  * XXX XXX XXX This function is rather dangerous
  */
-static void do_cmd_wiz_named_friendly(int r_idx)
+static void do_cmd_wiz_named_friendly(MONRACE_IDX r_idx)
 {
        (void)summon_named_creature(0, p_ptr->y, p_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET));
 }
@@ -1699,7 +1698,7 @@ static void do_cmd_wiz_named_friendly(int r_idx)
  */
 static void do_cmd_wiz_zap(void)
 {
-       int i;
+       MONSTER_IDX i;
 
 
        /* Genocide everyone nearby */
@@ -1737,7 +1736,7 @@ static void do_cmd_wiz_zap(void)
  */
 static void do_cmd_wiz_zap_all(void)
 {
-       int i;
+       MONSTER_IDX i;
 
        /* Genocide everyone */
        for (i = 1; i < m_max; i++)
@@ -1776,7 +1775,7 @@ static void do_cmd_wiz_create_feature(void)
        cave_type    *c_ptr;
        feature_type *f_ptr;
        char         tmp_val[160];
-       int          tmp_feat, tmp_mimic;
+       IDX          tmp_feat, tmp_mimic;
        POSITION y, x;
 
        if (!tgt_pt(&x, &y)) return;
@@ -1790,7 +1789,7 @@ static void do_cmd_wiz_create_feature(void)
        if (!get_string(_("地形: ", "Feature: "), tmp_val, 3)) return;
 
        /* Extract */
-       tmp_feat = atoi(tmp_val);
+       tmp_feat = (IDX)atoi(tmp_val);
        if (tmp_feat < 0) tmp_feat = 0;
        else if (tmp_feat >= max_f_idx) tmp_feat = max_f_idx - 1;
 
@@ -1801,7 +1800,7 @@ static void do_cmd_wiz_create_feature(void)
        if (!get_string(_("地形 (mimic): ", "Feature (mimic): "), tmp_val, 3)) return;
 
        /* Extract */
-       tmp_mimic = atoi(tmp_val);
+       tmp_mimic = (IDX)atoi(tmp_val);
        if (tmp_mimic < 0) tmp_mimic = 0;
        else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1;