OSDN Git Service

#37287 #37353 (2.2.0.89) MAGIC_NUM1型とMAGIC_NUM2型を定義し、型の置換を継続中。 / Define MAGIC_NUM1...
authorDeskull <desull@users.sourceforge.jp>
Mon, 2 Oct 2017 14:50:13 +0000 (23:50 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 2 Oct 2017 14:50:13 +0000 (23:50 +0900)
src/cmd4.c
src/externs.h
src/h-type.h
src/types.h
src/wizard2.c
src/xtra2.c

index b5e0ebc..bc61589 100644 (file)
@@ -3393,7 +3393,7 @@ void do_cmd_visuals(void)
                        {
                                monster_race *r_ptr = &r_info[r];
                                char c;
-                               int t;
+                               IDX t;
 
                                byte da = r_ptr->d_attr;
                                byte dc = r_ptr->d_char;
@@ -3570,7 +3570,7 @@ void do_cmd_visuals(void)
                case '6':
                {
                        static cptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars");
-                       static int f = 0;
+                       static IDX f = 0;
                        static int lighting_level = F_LIT_STANDARD;
                        prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
 
index 05a0167..08ae248 100644 (file)
@@ -1488,7 +1488,7 @@ extern void complete_quest(int quest_num);
 extern void check_quest_completion(monster_type *m_ptr);
 extern void check_find_art_quest_completion(object_type *o_ptr);
 extern cptr extract_note_dies(monster_race *r_ptr);
-extern void monster_death(int m_idx, bool drop_item);
+extern void monster_death(IDX m_idx, bool drop_item);
 extern bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note);
 extern void get_screen_size(int *wid_p, int *hgt_p);
 extern void panel_bounds_center(void);
index f443ddf..448ed92 100644 (file)
@@ -149,6 +149,9 @@ typedef int TERM_POSITION;   /*!< コンソール表示座標の型定義 */
 typedef byte SYMBOL_COLOR;    /*!< キャラの色の型定義 */
 typedef byte SYMBOL_CODE;     /*!< キャラの文字の型定義 */
 
+typedef s32b MAGIC_NUM1; /*!< プレイヤーの汎用魔法情報配列1の型定義*/
+typedef byte MAGIC_NUM2; /*!< プレイヤーの汎用魔法情報配列2の型定義*/
+
 /*** Pointers to all the basic types defined above ***/
 
 typedef real *real_ptr;
index 855914f..0ba35c2 100644 (file)
@@ -1105,8 +1105,8 @@ struct player_type
        SUB_EXP weapon_exp[5][64];    /* Proficiency of weapons */
        SUB_EXP skill_exp[GINOU_MAX]; /* Proficiency of misc. skill */
 
-       s32b magic_num1[108];     /* Array for non-spellbook type magic */
-       byte magic_num2[108];     /* Flags for non-spellbook type magics */
+       MAGIC_NUM1 magic_num1[108];     /*!< Array for non-spellbook type magic */
+       MAGIC_NUM2 magic_num2[108];     /*!< Flags for non-spellbook type magics */
 
        s16b mane_spell[MAX_MANE];
        s16b mane_dam[MAX_MANE];
index ba0fd65..9b0d9a5 100644 (file)
@@ -745,7 +745,7 @@ 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;
@@ -1788,7 +1788,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;
 
@@ -1799,7 +1799,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;
 
index aea7fc2..9040059 100644 (file)
@@ -737,7 +737,7 @@ cptr extract_note_dies(monster_race *r_ptr)
  * it drops all of its objects, which may disappear in crowded rooms.
  * </pre>
  */
-void monster_death(int m_idx, bool drop_item)
+void monster_death(IDX m_idx, bool drop_item)
 {
        int i, j, y, x;
 
@@ -1278,7 +1278,7 @@ void monster_death(int m_idx, bool drop_item)
 
                if ((r_ptr->flags7 & RF7_GUARDIAN) && (d_info[dungeon_type].final_guardian == m_ptr->r_idx))
                {
-                       int k_idx = d_info[dungeon_type].final_object ? d_info[dungeon_type].final_object
+                       IDX k_idx = d_info[dungeon_type].final_object ? d_info[dungeon_type].final_object
                                : lookup_kind(TV_SCROLL, SV_SCROLL_ACQUIREMENT);
 
                        if (d_info[dungeon_type].final_artifact)
@@ -5713,10 +5713,10 @@ int spell_exp_level(int spell_exp)
  * Display a rumor and apply its effects
  */
 
-int rumor_num(char *zz, int max_idx)
+IDX rumor_num(char *zz, IDX max_idx)
 {
        if (strcmp(zz, "*") == 0) return randint1(max_idx - 1);
-       return atoi(zz);
+       return (IDX)atoi(zz);
 }
 
 cptr rumor_bind_name(char *base, cptr fullname)