OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
authorDeskull <desull@users.sourceforge.jp>
Tue, 3 Oct 2017 12:22:06 +0000 (21:22 +0900)
committerDeskull <desull@users.sourceforge.jp>
Tue, 3 Oct 2017 12:22:06 +0000 (21:22 +0900)
src/bldg.c
src/cmd2.c
src/cmd3.c
src/cmd4.c
src/cmd5.c
src/spells3.c
src/types.h

index 93ed423..d6e7aab 100644 (file)
@@ -3344,7 +3344,7 @@ static int repair_broken_weapon_aux(int bcost)
        /* Copy base object's ability */
        for (i = 0; i < TR_FLAG_SIZE; i++) o_ptr->art_flags[i] |= k_ptr->flags[i];
        if (k_ptr->pval) o_ptr->pval = MAX(o_ptr->pval, randint1(k_ptr->pval));
-       if (have_flag(k_ptr->flags, TR_ACTIVATE)) o_ptr->xtra2 = k_ptr->act_idx;
+       if (have_flag(k_ptr->flags, TR_ACTIVATE)) o_ptr->xtra2 = (byte_hack)k_ptr->act_idx;
 
        /* Dice up */
        if (dd_bonus > 0)
index 4df7daf..1601b40 100644 (file)
@@ -2675,7 +2675,7 @@ void do_cmd_rest(void)
                /* Rest some */
                else
                {
-                       command_arg = atoi(out_val);
+                       command_arg = (COMMAND_ARG)atoi(out_val);
                        if (command_arg <= 0) return;
                }
        }
index 1c43e9f..ec137cc 100644 (file)
@@ -1795,7 +1795,8 @@ void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
  */
 void do_cmd_query_symbol(void)
 {
-       int             i, n;
+       IDX i;
+       int n;
        IDX r_idx;
        char    sym, query;
        char    buf[128];
@@ -1809,7 +1810,7 @@ void do_cmd_query_symbol(void)
        bool    recall = FALSE;
 
        u16b    why = 0;
-       u16b    *who;
+       IDX     *who;
 
        /* Get a character, or abort */
        if (!get_com(_("知りたい文字を入力して下さい(記号 or ^A全,^Uユ,^N非ユ,^R乗馬,^M名前): ", 
@@ -1866,7 +1867,7 @@ void do_cmd_query_symbol(void)
        prt(buf, 0, 0);
 
        /* Allocate the "who" array */
-       C_MAKE(who, max_r_idx, u16b);
+       C_MAKE(who, max_r_idx, IDX);
 
        /* Collect matching monsters */
        for (n = 0, i = 1; i < max_r_idx; i++)
@@ -1896,7 +1897,7 @@ void do_cmd_query_symbol(void)
 #ifdef JP
                    if (iskanji( temp[xx])) { xx++; continue; }
 #endif
-                   if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
+                   if (isupper(temp[xx])) temp[xx] = (char)tolower(temp[xx]);
                  }
   
 #ifdef JP
@@ -1905,14 +1906,14 @@ void do_cmd_query_symbol(void)
                  strcpy(temp2, r_name+r_ptr->name);
 #endif
                  for (xx=0; temp2[xx] && xx<80; xx++)
-                   if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
+                   if (isupper(temp2[xx])) temp2[xx] = (char)tolower(temp2[xx]);
   
 #ifdef JP
                  if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp) )
 #else
                  if (my_strstr(temp2, temp))
 #endif
-                         who[n++]=i;
+                         who[n++] = i;
                }
 
                /* Collect "appropriate" monsters */
@@ -1923,7 +1924,7 @@ void do_cmd_query_symbol(void)
        if (!n)
        {
                /* Free the "who" array */
-               C_KILL(who, max_r_idx, u16b);
+               C_KILL(who, max_r_idx, IDX);
 
                return;
        }
@@ -1959,7 +1960,7 @@ void do_cmd_query_symbol(void)
        if (query != 'y')
        {
                /* Free the "who" array */
-               C_KILL(who, max_r_idx, u16b);
+               C_KILL(who, max_r_idx, IDX);
 
                return;
        }
@@ -2052,7 +2053,7 @@ void do_cmd_query_symbol(void)
        }
 
        /* Free the "who" array */
-       C_KILL(who, max_r_idx, u16b);
+       C_KILL(who, max_r_idx, IDX);
 
        /* Re-display the identity */
        prt(buf, 0, 0);
index 11a38c0..c53358d 100644 (file)
@@ -2632,7 +2632,7 @@ static errr keymap_dump(cptr fname)
                if (!act) continue;
 
                /* Encode the key */
-               buf[0] = i;
+               buf[0] = (char)i;
                buf[1] = '\0';
                ascii_to_text(key, buf);
 
@@ -3093,14 +3093,14 @@ static bool cmd_visuals_aux(int i, IDX *num, IDX max)
        if (iscntrl(i))
        {
                char str[10] = "";
-               int tmp;
+               IDX tmp;
 
                sprintf(str, "%d", *num);
 
                if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
                        return FALSE;
 
-               tmp = strtol(str, NULL, 0);
+               tmp = (IDX)strtol(str, NULL, 0);
                if (tmp >= 0 && tmp < max)
                        *num = tmp;
        }
@@ -3571,7 +3571,7 @@ void do_cmd_visuals(void)
                {
                        static cptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars");
                        static IDX f = 0;
-                       static int lighting_level = F_LIT_STANDARD;
+                       static IDX lighting_level = F_LIT_STANDARD;
                        prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
 
                        /* Hack -- query until done */
@@ -3634,7 +3634,7 @@ void do_cmd_visuals(void)
                                {
                                case 'n':
                                        {
-                                               int prev_f = f;
+                                               IDX prev_f = f;
                                                do
                                                {
                                                        if (!cmd_visuals_aux(i, &f, max_f_idx))
@@ -4314,7 +4314,7 @@ static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
  * mode & 0x01 : check for non-empty group
  * mode & 0x02 : visual operation only
  */
-static int collect_monsters(int grp_cur, IDX mon_idx[], BIT_FLAGS8 mode)
+static int collect_monsters(IDX grp_cur, IDX mon_idx[], BIT_FLAGS8 mode)
 {
        IDX i;
        int mon_cnt = 0;
@@ -4815,7 +4815,7 @@ void do_cmd_load_screen(void)
                        for (i = 0; i < 16; i++)
                        {
                                /* Use attr matches */
-                               if (hack[i] == buf[x]) a = i;
+                               if (hack[i] == buf[x]) a = (byte_hack)i;
                        }
 
                        /* Put the attr/char */
index 6b7f4ac..18e30e1 100644 (file)
@@ -71,7 +71,7 @@ static int get_spell(int *sn, cptr prompt, OBJECT_SUBTYPE_VALUE sval, bool learn
        int         num = 0;
        int         ask = TRUE;
        int         need_mana;
-       byte        spells[64];
+       int         spells[64];
        bool        flag, redraw, okay;
        char        choice;
        const magic_type  *s_ptr;
@@ -242,7 +242,7 @@ static int get_spell(int *sn, cptr prompt, OBJECT_SUBTYPE_VALUE sval, bool learn
                        ask = (isupper(choice));
 
                        /* Lowercase */
-                       if (ask) choice = tolower(choice);
+                       if (ask) choice = (char)tolower(choice);
 
                        /* Extract request */
                        i = (islower(choice) ? A2I(choice) : -1);
index 7960593..a7485d9 100644 (file)
@@ -4113,7 +4113,7 @@ bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
  * @param use_realm 魔法領域ID
  * @return なし
  */
-void print_spells(int target_spell, byte *spells, int num, int y, int x, int use_realm)
+void print_spells(int target_spell, int *spells, int num, int y, int x, int use_realm)
 {
        int             i, spell, exp_level, increment = 64;
        const magic_type *s_ptr;
index 3b4ca8c..91d1c32 100644 (file)
@@ -793,7 +793,7 @@ typedef struct player_magic player_magic;
 
 struct player_magic
 {
-       int spell_book;         /* Tval of spell books (if any) */
+       OBJECT_TYPE_VALUE spell_book; /* Tval of spell books (if any) */
        int spell_xtra;         /* Something for later */
 
        int spell_stat;         /* Stat for spells (if any)  */