OSDN Git Service

#37287 #37353 (2.2.0.89) FEAT_POWER 型を定義し、型の置換を継続中。 / Define FEAT_POWER, ongoing...
authorDeskull <desull@users.sourceforge.jp>
Tue, 17 Oct 2017 14:23:45 +0000 (23:23 +0900)
committerDeskull <desull@users.sourceforge.jp>
Tue, 17 Oct 2017 14:23:45 +0000 (23:23 +0900)
src/externs.h
src/h-type.h
src/hex.c
src/hissatsu.c
src/init1.c
src/mspells3.c
src/object1.c
src/types.h
src/util.c

index 785cdfb..2beea34 100644 (file)
@@ -1018,7 +1018,7 @@ extern int show_inven(int target_item);
 extern int show_equip(int target_item);
 extern void toggle_inven_equip(void);
 extern bool can_get_item(void);
-extern bool get_item(int *cp, cptr pmt, cptr str, int mode);
+extern bool get_item(COMMAND_CODE *cp, cptr pmt, cptr str, int mode);
 
 /* object2.c */
 extern void excise_object_idx(int o_idx);
index 64aa4a1..9fbc5ec 100644 (file)
@@ -172,6 +172,7 @@ typedef byte MAGIC_NUM2;   /*!< プレイヤーの汎用魔法情報配列2の
 
 typedef s32b SPELL_IDX;    /*!< 各魔法領域/職業能力ごとの呪文ID型定義 */
 typedef s16b PROB;         /*!< 確率の重みの型定義 */
+typedef byte FEAT_POWER;   /*!< 地形強度の型定義 */
 
 /*** Pointers to all the basic types defined above ***/
 
index 8d27a26..27e9102 100644 (file)
--- a/src/hex.c
+++ b/src/hex.c
@@ -103,7 +103,7 @@ bool stop_hex_spell(void)
                        }
 
                        if (!get_com(out_val, &choice, TRUE)) break;
-                       if (isupper(choice)) choice = tolower(choice);
+                       if (isupper(choice)) choice = (char)tolower(choice);
 
                        if (choice == 'l')      /* All */
                        {
index b6ffab8..ec0316e 100644 (file)
@@ -254,7 +254,7 @@ static int get_hissatsu_power(SPELL_IDX *sn)
                                ask = (isupper(choice));
 
                                /* Lowercase */
-                               if (ask) choice = tolower(choice);
+                               if (ask) choice = (char)tolower(choice);
 
                                /* Extract request */
                                i = (islower(choice) ? A2I(choice) : -1);
index add6673..345252a 100644 (file)
@@ -1309,8 +1309,8 @@ errr parse_v_info(char *buf, header *head)
                /* Save the values */
                v_ptr->typ = typ;
                v_ptr->rat = rat;
-               v_ptr->hgt = hgt;
-               v_ptr->wid = wid;
+               v_ptr->hgt = (POSITION)hgt;
+               v_ptr->wid = (POSITION)wid;
        }
 
        /* Oops */
@@ -2728,9 +2728,9 @@ errr parse_e_info(char *buf, header *head)
                if (4 != sscanf(buf+2, "%d:%d:%d:%d",
                                &th, &td, &ta, &pval)) return (1);
 
-               e_ptr->max_to_h = th;
-               e_ptr->max_to_d = td;
-               e_ptr->max_to_a = ta;
+               e_ptr->max_to_h = (HIT_PROB)th;
+               e_ptr->max_to_d = (HIT_POINT)td;
+               e_ptr->max_to_a = (ARMOUR_CLASS)ta;
                e_ptr->max_pval = (PARAMETER_VALUE)pval;
        }
 
index a2748cd..6eebf3b 100644 (file)
@@ -538,7 +538,7 @@ static int get_learned_power(SPELL_IDX *sn)
                        ask = isupper(choice);
 
                        /* Lowercase */
-                       if (ask) choice = tolower(choice);
+                       if (ask) choice = (char)tolower(choice);
 
                        /* Extract request */
                        i = (islower(choice) ? A2I(choice) : -1);
index 0ed6548..3b3d09a 100644 (file)
@@ -4868,7 +4868,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, int mode)
 
                                /* Extract "query" setting */
                                ver = isupper(which);
-                               which = tolower(which);
+                               which = (char)tolower(which);
 
                                /* Convert letter to inventory index */
                                if (command_wrk == (USE_INVEN))
index 24eeab2..e6414f6 100644 (file)
@@ -80,7 +80,7 @@ struct feature_type
        feature_state state[MAX_FEAT_STATES]; /*!< feature_state テーブル */
 
        byte subtype;  /*!< 副特性値 */
-       byte power;    /*!< 地形強度 */
+       FEAT_POWER power;    /*!< 地形強度 */
 
        SYMBOL_COLOR d_attr[F_LIT_MAX];   /*!< デフォルトの地形シンボルカラー / Default feature attribute */
        SYMBOL_CODE d_char[F_LIT_MAX];   /*!< デフォルトの地形シンボルアルファベット / Default feature character */
@@ -251,8 +251,8 @@ struct monster_blow
 {
        byte method;
        byte effect;
-       byte d_dice;
-       byte d_side;
+       DICE_NUMBER d_dice;
+       DICE_SID d_side;
 };
 
 
@@ -1492,7 +1492,7 @@ struct wilderness_type
        int         town;
        int         road;
        u32b        seed;
-       s16b        level;
+       DEPTH        level;
        byte        entrance;
 };
 
@@ -1602,13 +1602,13 @@ struct dungeon_info_type {
 
        feat_prob floor[DUNGEON_FEAT_PROB_NUM]; /* Floor probability */
        feat_prob fill[DUNGEON_FEAT_PROB_NUM];  /* Cave wall probability */
-       s16b outer_wall;                        /* Outer wall tile */
-       s16b inner_wall;                        /* Inner wall tile */
-       s16b stream1;                           /* stream tile */
-       s16b stream2;                           /* stream tile */
+       FEAT_IDX outer_wall;                        /* Outer wall tile */
+       FEAT_IDX inner_wall;                        /* Inner wall tile */
+       FEAT_IDX stream1;                           /* stream tile */
+       FEAT_IDX stream2;                           /* stream tile */
 
-       s16b mindepth;         /* Minimal depth */
-       s16b maxdepth;         /* Maximal depth */
+       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;
index 2f75790..0a230c0 100644 (file)
@@ -3878,7 +3878,7 @@ s16b get_quantity(cptr prompt, COMMAND_CODE max)
        if (!res) return 0;
 
        /* Extract a number */
-       amt = atoi(buf);
+       amt = (COMMAND_CODE)atoi(buf);
 
        /* A letter means "all" */
        if (isalpha(buf[0])) amt = max;
@@ -4862,7 +4862,7 @@ static int repeat__cnt = 0;
 static int repeat__idx = 0;
 
 /* Saved "stuff" */
-static int repeat__key[REPEAT_MAX];
+static COMMAND_CODE repeat__key[REPEAT_MAX];
 
 
 void repeat_push(COMMAND_CODE what)