OSDN Git Service

#37287 #37353 (2.2.0.89) ESSENCE_IDX 型を定義し、型の置換を継続中。 / Define ESSENCE_IDX, ongoing...
authorDeskull <desull@users.sourceforge.jp>
Mon, 11 Dec 2017 15:59:44 +0000 (00:59 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 11 Dec 2017 15:59:44 +0000 (00:59 +0900)
src/do-spell.c
src/externs.h
src/h-type.h
src/init1.c
src/object2.c
src/types.h
src/util.c
src/xtra1.c

index 53625aa..1cd3674 100644 (file)
@@ -487,7 +487,7 @@ static void cast_invoke_spirits(int dir)
  * @param spell 基準となる引数ID
  * @return なし
  */
-static void wild_magic(int spell)
+static void wild_magic(SPELL_IDX spell)
 {
        int counter = 0;
        int type = SUMMON_MOLD + randint0(6);
@@ -986,7 +986,7 @@ static bool cast_summon_greater_demon(void)
  * @param song 魔法効果のID
  * @return なし
  */
-static void start_singing(MAGIC_NUM2 spell, MAGIC_NUM1 song)
+static void start_singing(SPELL_IDX spell, MAGIC_NUM1 song)
 {
        /* Remember the song index */
        p_ptr->magic_num1[0] = song;
@@ -1048,7 +1048,7 @@ void stop_singing(void)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_life_spell(int spell, BIT_FLAGS mode)
+static cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -1575,7 +1575,7 @@ static cptr do_life_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_sorcery_spell(int spell, BIT_FLAGS mode)
+static cptr do_sorcery_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -2123,7 +2123,7 @@ static cptr do_sorcery_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_nature_spell(int spell, BIT_FLAGS mode)
+static cptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -2728,7 +2728,7 @@ static cptr do_nature_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_chaos_spell(int spell, BIT_FLAGS mode)
+static cptr do_chaos_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -3341,7 +3341,7 @@ static cptr do_chaos_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_death_spell(int spell, BIT_FLAGS mode)
+static cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -4014,7 +4014,7 @@ static cptr do_death_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_trump_spell(int spell, BIT_FLAGS mode)
+static cptr do_trump_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -4660,7 +4660,7 @@ static cptr do_trump_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_arcane_spell(int spell, BIT_FLAGS mode)
+static cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -5221,7 +5221,7 @@ static cptr do_arcane_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_craft_spell(int spell, BIT_FLAGS mode)
+static cptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -5754,7 +5754,7 @@ static cptr do_craft_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_daemon_spell(int spell, BIT_FLAGS mode)
+static cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -6370,7 +6370,7 @@ static cptr do_daemon_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_crusade_spell(int spell, BIT_FLAGS mode)
+static cptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -6983,7 +6983,7 @@ static cptr do_crusade_spell(int spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
  */
-static cptr do_music_spell(MAGIC_NUM2 spell, BIT_FLAGS mode)
+static cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -7900,7 +7900,7 @@ static cptr do_music_spell(MAGIC_NUM2 spell, BIT_FLAGS mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_hissatsu_spell(int spell, BIT_FLAGS mode)
+static cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -8873,7 +8873,7 @@ static bool item_tester_hook_cursed(object_type *o_ptr)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_CONT / SPELL_STOP)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
  */
-static cptr do_hex_spell(int spell, BIT_FLAGS mode)
+static cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
index 4f6c9a3..cb0ee59 100644 (file)
@@ -1394,7 +1394,7 @@ extern bool is_daytime(void);
 extern void extract_day_hour_min(int *day, int *hour, int *min);
 extern void prt_time(void);
 extern cptr map_name(void);
-extern u32b weight_limit(void);
+extern WEIGHT weight_limit(void);
 extern bool buki_motteruka(int i);
 extern bool is_heavy_shoot(object_type *o_ptr);
 extern int bow_tval_ammo(object_type *o_ptr);
index c5e9288..f5139db 100644 (file)
@@ -127,7 +127,7 @@ typedef byte ROOM_IDX;                      /*!< 部屋のID型を定義 */
 
 typedef s16b INVENTORY_IDX;            /*!< ゲーム中の所持品ID型を定義 */
 typedef s16b OBJECT_IDX;               /*!< ゲーム中のアイテムID型を定義 */
-
+typedef s32b ESSENCE_IDX;              /*!< 鍛冶エッセンスのID型 */
 typedef s16b KIND_OBJECT_IDX;  /*!< ゲーム中のベースアイテムID型を定義 */
 
 typedef s32b POSITION;                 /*!< ゲーム中の座標型を定義 */
index 00f81c4..306068d 100644 (file)
@@ -1860,7 +1860,7 @@ errr parse_f_info(char *buf, header *head)
                if (1 != sscanf(buf+2, "%d", &priority)) return (PARSE_ERROR_GENERIC);
 
                /* Save the value */
-               f_ptr->priority = priority;
+               f_ptr->priority = (FEAT_PRIORITY)priority;
        }
 
        /* Process 'K' for "States" (up to four lines + default (which cannot be last)) */
@@ -3497,7 +3497,7 @@ errr parse_d_info(char *buf, header *head)
                        if (1 == sscanf(s, "MONSTER_DIV_%d", &monst))
                        {
                                /* Extract a "Special %" */
-                               d_ptr->special_div = monst;
+                               d_ptr->special_div = (PROB)monst;
 
                                /* Start at next entry */
                                s = t;
index 3f42a93..6584d74 100644 (file)
@@ -7262,7 +7262,7 @@ static bool item_tester_hook_melee_ammo(object_type *o_ptr)
 typedef struct {
        int add;       /* TR flag number or special essence id */
        cptr add_name; /* Name of this ability */
-       int type;      /* Menu number */
+       ESSENCE_IDX type;      /* Menu number */
        int essence;   /* Index for carrying essences */
        int value;     /* Needed value to add this ability */
 } essence_type;
@@ -8095,7 +8095,7 @@ static COMMAND_CODE choose_essence(void)
  * @param mode エッセンスの大別ID
  * @return なし
  */
-static void add_essence(BIT_FLAGS mode)
+static void add_essence(ESSENCE_IDX mode)
 {
        OBJECT_IDX item;
        int max_num = 0;
index 67bee7d..74a2324 100644 (file)
@@ -1644,7 +1644,7 @@ struct dungeon_info_type {
        ARTIFACT_IDX final_artifact;    /* The artifact you'll find at the bottom */
        MONRACE_IDX final_guardian;     /* The artifact's guardian. If an artifact is specified, then it's NEEDED */
 
-       byte special_div;       /* % of monsters affected by the flags/races allowed, to add some variety */
+       PROB special_div;       /* % of monsters affected by the flags/races allowed, to add some variety */
        int tunnel_percent;
        int obj_great;
        int obj_good;
index 60307d6..fb7cc6c 100644 (file)
@@ -2477,8 +2477,7 @@ cptr message_str(int age)
  */
 void message_add(cptr str)
 {
-       u32b i;
-       int k, x, m, n;
+       int i, k, x, m, n;
 
        char u[4096];
        char splitted1[81];
index e4cea31..ec8c7e0 100644 (file)
@@ -3034,12 +3034,12 @@ static void calc_torch(void)
  * Computes current weight limit.
  * @return 制限重量(ポンド)
  */
-u32b weight_limit(void)
+WEIGHT weight_limit(void)
 {
-       u32b i;
+       WEIGHT i;
 
        /* Weight limit based only on strength */
-       i = (u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */
+       i = (WEIGHT)adj_str_wgt[p_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */
        if (p_ptr->pclass == CLASS_BERSERKER) i = i * 3 / 2;
 
        /* Return the result */