OSDN Git Service

#37287 #37353 (2.2.0.89) FEAT_SUBTYPE, FEAT_PRIORITY 型を定義し、型の置換を継続中。 / Define FEAT_SU...
[hengband/hengband.git] / src / xtra1.c
index 3841746..e4cea31 100644 (file)
@@ -96,7 +96,7 @@ s16b modify_stat_value(int value, int amount)
        }
 
        /* Return new value */
-       return (value);
+       return (s16b)(value);
 }
 
 
@@ -122,7 +122,7 @@ static void prt_field(cptr info, int row, int col)
 /*!
  * @brief ゲーム時間が日中かどうかを返す /
  * Whether daytime or not
- * @param 日中ならばTRUE、夜ならばFALSE
+ * @return 日中ならばTRUE、夜ならばFALSE
  */
 bool is_daytime(void)
 {
@@ -503,7 +503,7 @@ static struct {
 
 
 /*!
- * @briefs 下部に状態表示を行う / Show status bar
+ * @brief 下部に状態表示を行う / Show status bar
  * @return なし
  */
 static void prt_status(void)
@@ -736,7 +736,7 @@ static void prt_status(void)
 
 
 /*!
- * @briefs プレイヤーの称号を表示する / Prints "title", including "wizard" or "winner" as needed.
+ * @brief プレイヤーの称号を表示する / Prints "title", including "wizard" or "winner" as needed.
  * @return なし
  */
 static void prt_title(void)
@@ -791,7 +791,7 @@ static void prt_title(void)
 
 
 /*!
- * @briefs プレイヤーのレベルを表示する / Prints level
+ * @brief プレイヤーのレベルを表示する / Prints level
  * @return なし
  */
 static void prt_level(void)
@@ -826,7 +826,7 @@ static void prt_level(void)
 
 
 /*!
- * @briefs プレイヤーの経験値を表示する / Display the experience
+ * @brief プレイヤーの経験値を表示する / Display the experience
  * @return なし
  */
 static void prt_exp(void)
@@ -880,7 +880,7 @@ static void prt_exp(void)
 }
 
 /*!
- * @briefs プレイヤーの所持金を表示する / Prints current gold
+ * @brief プレイヤーの所持金を表示する / Prints current gold
  * @return なし
  */
 static void prt_gold(void)
@@ -893,7 +893,7 @@ static void prt_gold(void)
 
 
 /*!
- * @briefs プレイヤーのACを表示する / Prints current AC
+ * @brief プレイヤーのACを表示する / Prints current AC
  * @return なし
  */
 static void prt_ac(void)
@@ -915,7 +915,7 @@ static void prt_ac(void)
 
 
 /*!
- * @briefs プレイヤーのHPを表示する / Prints Cur/Max hit points
+ * @brief プレイヤーのHPを表示する / Prints Cur/Max hit points
  * @return なし
  */
 static void prt_hp(void)
@@ -960,7 +960,7 @@ static void prt_hp(void)
 
 
 /*!
- * @briefs プレイヤーのMPを表示する / Prints players max/cur spell points
+ * @brief プレイヤーのMPを表示する / Prints players max/cur spell points
  * @return なし
  */
 static void prt_sp(void)
@@ -1007,7 +1007,7 @@ static void prt_sp(void)
 
 
 /*!
- * @briefs 現在のフロアの深さを表示する / Prints depth in stat area
+ * @brief 現在のフロアの深さを表示する / Prints depth in stat area
  * @return なし
  */
 static void prt_depth(void)
@@ -1030,8 +1030,8 @@ static void prt_depth(void)
        }
        else
        {
-               if (depth_in_feet) (void)sprintf(depths, _("%d ft", "%d ft"), dun_level * 50);
-               else (void)sprintf(depths, _("%d 階", "Lev %d"), dun_level);
+               if (depth_in_feet) (void)sprintf(depths, _("%d ft", "%d ft"), (int)dun_level * 50);
+               else (void)sprintf(depths, _("%d 階", "Lev %d"), (int)dun_level);
 
                /* Get color of level based on feeling  -JSV- */
                switch (p_ptr->feeling)
@@ -1056,7 +1056,7 @@ static void prt_depth(void)
 
 
 /*!
- * @briefs プレイヤーの空腹状態を表示する / Prints status of hunger
+ * @brief プレイヤーの空腹状態を表示する / Prints status of hunger
  * @return なし
  */
 static void prt_hunger(void)
@@ -1102,7 +1102,7 @@ static void prt_hunger(void)
 
 
 /*!
- * @briefs プレイヤーの行動状態を表示する / Prints Searching, Resting, Paralysis, or 'count' status
+ * @brief プレイヤーの行動状態を表示する / Prints Searching, Resting, Paralysis, or 'count' status
  * @return なし
  * @details
  * Display is always exactly 10 characters wide (see below)
@@ -1256,7 +1256,7 @@ static void prt_state(void)
 
 
 /*!
- * @briefs プレイヤーの行動速度を表示する / Prints the speed of a character.                    -CJS-
+ * @brief プレイヤーの行動速度を表示する / Prints the speed of a character.                     -CJS-
  * @return なし
  */
 static void prt_speed(void)
@@ -1327,7 +1327,7 @@ static void prt_speed(void)
 
 
 /*!
- * @briefs プレイヤーの呪文学習可能状態を表示する
+ * @brief プレイヤーの呪文学習可能状態を表示する
  * @return なし
  */
 static void prt_study(void)
@@ -1350,7 +1350,7 @@ static void prt_study(void)
 
 
 /*!
- * @briefs プレイヤーのものまね可能状態を表示する
+ * @brief プレイヤーのものまね可能状態を表示する
  * @return なし
  */
 static void prt_imitation(void)
@@ -1378,7 +1378,7 @@ static void prt_imitation(void)
 }
 
 /*!
- * @briefs プレイヤーの負傷状態を表示する
+ * @brief プレイヤーの負傷状態を表示する
  * @return なし
  */
 static void prt_cut(void)
@@ -1421,7 +1421,7 @@ static void prt_cut(void)
 
 
 /*!
- * @briefs プレイヤーの朦朧状態を表示する
+ * @brief プレイヤーの朦朧状態を表示する
  * @return なし
  */
 static void prt_stun(void)
@@ -1449,7 +1449,7 @@ static void prt_stun(void)
 
 
 /*!
- * @briefs モンスターの体力ゲージを表示する
+ * @brief モンスターの体力ゲージを表示する
  * @param riding TRUEならば騎乗中のモンスターの体力、FALSEならターゲットモンスターの体力を表示する。表示位置は固定。
  * @return なし
  * @details
@@ -1604,7 +1604,7 @@ static void health_redraw(bool riding)
 
 
 /*!
- * @briefs プレイヤーのステータスを一括表示する(左側部分) / Display basic info (mostly left of map)
+ * @brief プレイヤーのステータスを一括表示する(左側部分) / Display basic info (mostly left of map)
  * @return なし
  */
 static void prt_frame_basic(void)
@@ -1656,7 +1656,7 @@ static void prt_frame_basic(void)
 
 
 /*!
- * @briefs プレイヤーのステータスを一括表示する(下部分) / Display extra info (mostly below map)
+ * @brief プレイヤーのステータスを一括表示する(下部分) / Display extra info (mostly below map)
  * @return なし
  */
 static void prt_frame_extra(void)
@@ -1684,7 +1684,7 @@ static void prt_frame_extra(void)
 
 
 /*!
- * @briefs サブウィンドウに所持品一覧を表示する / Hack -- display inventory in sub-windows
+ * @brief サブウィンドウに所持品一覧を表示する / Hack -- display inventory in sub-windows
  * @return なし
  */
 static void fix_inven(void)
@@ -1718,7 +1718,7 @@ static void fix_inven(void)
 
 
 /*!
- * @briefs モンスターの現在数を一行で表現する / Print monster info in line
+ * @brief モンスターの現在数を一行で表現する / Print monster info in line
  * @param x 表示列
  * @param y 表示行
  * @param m_ptr 思い出を表示するモンスター情報の参照ポインタ
@@ -1736,7 +1736,7 @@ static void fix_inven(void)
 static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){
        char buf[256];
        int i;
-       int r_idx = m_ptr->ap_r_idx;
+       MONRACE_IDX r_idx = m_ptr->ap_r_idx;
        monster_race* r_ptr = &r_info[r_idx];
  
        Term_gotoxy(x, y);
@@ -1762,7 +1762,7 @@ static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){
        Term_add_bigch(r_ptr->x_attr, r_ptr->x_char);
        //LV
        if (r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE)){
-               sprintf(buf, " %2d", r_ptr->level);
+               sprintf(buf, " %2d", (int)r_ptr->level);
        }else{
                strcpy(buf, " ??");
        }
@@ -1775,7 +1775,7 @@ static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){
 }
 
 /*!
- * @briefs モンスターの出現リストを表示する / Print monster info in line
+ * @brief モンスターの出現リストを表示する / Print monster info in line
  * @param x 表示列
  * @param y 表示行
  * @param max_lines 最大何行描画するか
@@ -1795,7 +1795,7 @@ void print_monster_list(int x, int y, int max_lines){
                if(!m_ptr->r_idx)continue;//dead?
                {
                        /*
-                       int r_idx = m_ptr->ap_r_idx;
+                       MONRACE_IDX r_idx = m_ptr->ap_r_idx;
                        monster_race* r_ptr = &r_info[r_idx];
                        cptr name = (r_name + r_ptr->name);
                        cptr ename = (r_name + r_ptr->name);
@@ -1839,7 +1839,7 @@ void print_monster_list(int x, int y, int max_lines){
 }
 
 /*!
- * @briefs 出現中モンスターのリストをサブウィンドウに表示する / Hack -- display monster list in sub-windows
+ * @brief 出現中モンスターのリストをサブウィンドウに表示する / Hack -- display monster list in sub-windows
  * @return なし
  */
 static void fix_monster_list(void)
@@ -1878,7 +1878,7 @@ static void fix_monster_list(void)
 
 
 /*!
- * @briefs 現在の装備品をサブウィンドウに表示する / 
+ * @brief 現在の装備品をサブウィンドウに表示する / 
  * Hack -- display equipment in sub-windows
  * @return なし
  */
@@ -1913,7 +1913,7 @@ static void fix_equip(void)
 
 
 /*!
- * @briefs 現在の習得済魔法をサブウィンドウに表示する / 
+ * @brief 現在の習得済魔法をサブウィンドウに表示する / 
  * Hack -- display spells in sub-windows
  * @return なし
  */
@@ -1948,7 +1948,7 @@ static void fix_spell(void)
 
 
 /*!
- * @briefs 現在のプレイヤーステータスをサブウィンドウに表示する / 
+ * @brief 現在のプレイヤーステータスをサブウィンドウに表示する / 
  * Hack -- display character in sub-windows
  * @return なし
  */
@@ -1984,7 +1984,7 @@ static void fix_player(void)
 }
 
 /*!
- * @briefs ゲームメッセージ履歴をサブウィンドウに表示する / 
+ * @brief ゲームメッセージ履歴をサブウィンドウに表示する / 
  * Hack -- display recent messages in sub-windows
  * XXX XXX XXX Adjust for width and split messages
  * @return なし
@@ -2035,7 +2035,7 @@ static void fix_message(void)
 
 
 /*!
- * @briefs 簡易マップをサブウィンドウに表示する / 
+ * @brief 簡易マップをサブウィンドウに表示する / 
  * Hack -- display overhead view in sub-windows
  * XXX XXX XXX Adjust for width and split messages
  * @return なし
@@ -2081,7 +2081,7 @@ static void fix_overhead(void)
 
 
 /*!
- * @briefs ダンジョンの地形をサブウィンドウに表示する / 
+ * @brief ダンジョンの地形をサブウィンドウに表示する / 
  * Hack -- display dungeon view in sub-windows
  * @return なし
  */
@@ -2116,7 +2116,7 @@ static void fix_dungeon(void)
 
 
 /*!
- * @briefs モンスターの思い出をサブウィンドウに表示する / 
+ * @brief モンスターの思い出をサブウィンドウに表示する / 
  * Hack -- display dungeon view in sub-windows
  * @return なし
  */
@@ -2151,7 +2151,7 @@ static void fix_monster(void)
 
 
 /*!
- * @briefs ベースアイテム情報をサブウィンドウに表示する / 
+ * @brief ベースアイテム情報をサブウィンドウに表示する / 
  * Hack -- display object recall in sub-windows
  * @return なし
  */
@@ -2187,7 +2187,7 @@ static void fix_object(void)
 
 
 /*!
- * @briefs プレイヤーの現在学習可能な魔法数を計算し、増減に応じて魔法の忘却、再学習を処置する。 /
+ * @brief プレイヤーの現在学習可能な魔法数を計算し、増減に応じて魔法の忘却、再学習を処置する。 /
  * Calculate number of spells player should have, and forget,
  * or remember, spells until that number is properly reflected.
  * @return なし
@@ -2202,7 +2202,7 @@ static void calc_spells(void)
        int         num_boukyaku = 0;
 
        const magic_type        *s_ptr;
-       int which;
+       REALM_IDX which;
        int bonus = 0;
 
 
@@ -2503,7 +2503,11 @@ static void calc_spells(void)
                        k++;
                }
                if (k > 32) k = 32;
-               if ((p_ptr->new_spells > k) && ((mp_ptr->spell_book == TV_LIFE_BOOK) || (mp_ptr->spell_book == TV_HISSATSU_BOOK))) p_ptr->new_spells = k;
+               if ((p_ptr->new_spells > k) &&
+                       ((mp_ptr->spell_book == TV_LIFE_BOOK) || (mp_ptr->spell_book == TV_HISSATSU_BOOK)))
+               {
+                       p_ptr->new_spells = (s16b)k;
+               }
        }
 
        if (p_ptr->new_spells < 0) p_ptr->new_spells = 0;
@@ -2541,7 +2545,7 @@ static void calc_spells(void)
 }
 
 /*!
- * @briefs プレイヤーの最大MPを計算する /
+ * @brief プレイヤーの最大MPを計算する /
  * Calculate maximum mana.  You do not need to know any spells.
  * Note that mana is lowered by heavy (or inappropriate) armor.
  * @return なし
@@ -2861,7 +2865,7 @@ static void calc_mana(void)
 
 
 /*!
- * @briefs プレイヤーの最大HPを計算する /
+ * @brief プレイヤーの最大HPを計算する /
  * Calculate the players (maximal) hit points
  * Adjust current hitpoints if necessary
  * @return なし
@@ -2990,7 +2994,7 @@ static void calc_torch(void)
                if (have_flag(flgs, TR_LITE_M1)) rad -= 1;
                if (have_flag(flgs, TR_LITE_M2)) rad -= 2;
                if (have_flag(flgs, TR_LITE_M3)) rad -= 3;
-               p_ptr->cur_lite += rad;
+               p_ptr->cur_lite += (s16b)rad;
        }
 
        /* max radius is 14 (was 5) without rewriting other code -- */
@@ -3092,6 +3096,7 @@ int bow_tval_ammo(object_type *o_ptr)
                        return TV_BOLT;
                }
                case SV_CRIMSON:
+               case SV_HARP:
                {
                        return TV_NO_AMMO;
                }
@@ -3111,7 +3116,7 @@ s16b calc_num_fire(object_type *o_ptr)
        int extra_shots = 0;
        int i;
        int num = 0;
-       int tval_ammo = bow_tval_ammo(o_ptr);
+       OBJECT_TYPE_VALUE tval_ammo = bow_tval_ammo(o_ptr);
        object_type *q_ptr;
        u32b flgs[TR_FLAG_SIZE];
        
@@ -3179,7 +3184,7 @@ s16b calc_num_fire(object_type *o_ptr)
                        num += (p_ptr->lev * 4);
                }
        }
-       return num;
+       return (s16b)num;
 }
 
 /*!
@@ -3245,8 +3250,8 @@ void calc_bonuses(void)
        bool old_mighty_throw = p_ptr->mighty_throw;
 
        /* Save the old armor class */
-       bool old_dis_ac = p_ptr->dis_ac;
-       bool old_dis_to_a = p_ptr->dis_to_a;
+       s16b old_dis_ac = p_ptr->dis_ac;
+       s16b old_dis_to_a = p_ptr->dis_to_a;
 
 
        /* Clear extra blows/shots */
@@ -4357,25 +4362,25 @@ void calc_bonuses(void)
                /* To Bow and Natural attack */
 
                /* Apply the bonuses to hit/damage */
-               p_ptr->to_h_b += bonus_to_h;
-               p_ptr->to_h_m += bonus_to_h;
-               p_ptr->to_d_m += bonus_to_d;
+               p_ptr->to_h_b += (s16b)bonus_to_h;
+               p_ptr->to_h_m += (s16b)bonus_to_h;
+               p_ptr->to_d_m += (s16b)bonus_to_d;
 
                /* Apply the mental bonuses tp hit/damage, if known */
-               if (object_is_known(o_ptr)) p_ptr->dis_to_h_b += bonus_to_h;
+               if (object_is_known(o_ptr)) p_ptr->dis_to_h_b += (s16b)bonus_to_h;
 
                /* To Melee */
                if ((i == INVEN_LEFT || i == INVEN_RIGHT) && !p_ptr->ryoute)
                {
                        /* Apply the bonuses to hit/damage */
-                       p_ptr->to_h[i-INVEN_RIGHT] += bonus_to_h;
-                       p_ptr->to_d[i-INVEN_RIGHT] += bonus_to_d;
+                       p_ptr->to_h[i-INVEN_RIGHT] += (s16b)bonus_to_h;
+                       p_ptr->to_d[i-INVEN_RIGHT] += (s16b)bonus_to_d;
 
                        /* Apply the mental bonuses tp hit/damage, if known */
                        if (object_is_known(o_ptr))
                        {
-                               p_ptr->dis_to_h[i-INVEN_RIGHT] += bonus_to_h;
-                               p_ptr->dis_to_d[i-INVEN_RIGHT] += bonus_to_d;
+                               p_ptr->dis_to_h[i-INVEN_RIGHT] += (s16b)bonus_to_h;
+                               p_ptr->dis_to_d[i-INVEN_RIGHT] += (s16b)bonus_to_d;
                        }
                }
                else if (p_ptr->migite && p_ptr->hidarite)
@@ -4398,14 +4403,14 @@ void calc_bonuses(void)
                else
                {
                        /* Apply the bonuses to hit/damage */
-                       p_ptr->to_h[default_hand] += bonus_to_h;
-                       p_ptr->to_d[default_hand] += bonus_to_d;
+                       p_ptr->to_h[default_hand] += (s16b)bonus_to_h;
+                       p_ptr->to_d[default_hand] += (s16b)bonus_to_d;
 
                        /* Apply the mental bonuses to hit/damage, if known */
                        if (object_is_known(o_ptr))
                        {
-                               p_ptr->dis_to_h[default_hand] += bonus_to_h;
-                               p_ptr->dis_to_d[default_hand] += bonus_to_d;
+                               p_ptr->dis_to_h[default_hand] += (s16b)bonus_to_h;
+                               p_ptr->dis_to_d[default_hand] += (s16b)bonus_to_d;
                        }
                }
        }
@@ -4533,8 +4538,8 @@ void calc_bonuses(void)
                        ac += 5;
                        if (o_ptr->curse_flags & TRC_HEAVY_CURSE) ac += 7;
                        if (o_ptr->curse_flags & TRC_PERMA_CURSE) ac += 13;
-                       p_ptr->to_a += ac;
-                       p_ptr->dis_to_a += ac;
+                       p_ptr->to_a += (s16b)ac;
+                       p_ptr->dis_to_a += (s16b)ac;
                }
        }
 
@@ -4550,7 +4555,7 @@ void calc_bonuses(void)
                if (p_ptr->stat_top[i] != top)
                {
                        /* Save the new value */
-                       p_ptr->stat_top[i] = top;
+                       p_ptr->stat_top[i] = (s16b)top;
 
                        /* Redisplay the stats later */
                        p_ptr->redraw |= (PR_STATS);
@@ -4576,7 +4581,7 @@ void calc_bonuses(void)
                if (p_ptr->stat_use[i] != use)
                {
                        /* Save the new value */
-                       p_ptr->stat_use[i] = use;
+                       p_ptr->stat_use[i] = (s16b)use;
 
                        /* Redisplay the stats later */
                        p_ptr->redraw |= (PR_STATS);
@@ -4599,7 +4604,7 @@ void calc_bonuses(void)
                if (p_ptr->stat_ind[i] != ind)
                {
                        /* Save the new index */
-                       p_ptr->stat_ind[i] = ind;
+                       p_ptr->stat_ind[i] = (s16b)ind;
 
                        /* Change in CON affects Hitpoints */
                        if (i == A_CON)
@@ -4891,10 +4896,10 @@ void calc_bonuses(void)
                }
                if (inventory[INVEN_RARM].tval == TV_POLEARM) penalty1 += 10;
                if (inventory[INVEN_LARM].tval == TV_POLEARM) penalty2 += 10;
-               p_ptr->to_h[0] -= penalty1;
-               p_ptr->to_h[1] -= penalty2;
-               p_ptr->dis_to_h[0] -= penalty1;
-               p_ptr->dis_to_h[1] -= penalty2;
+               p_ptr->to_h[0] -= (s16b)penalty1;
+               p_ptr->to_h[1] -= (s16b)penalty2;
+               p_ptr->dis_to_h[0] -= (s16b)penalty1;
+               p_ptr->dis_to_h[1] -= (s16b)penalty2;
        }
 
        /* Extract the current weight (in tenth pounds) */
@@ -4986,7 +4991,7 @@ void calc_bonuses(void)
        /* Compute "extra shots" if needed */
        if (o_ptr->k_idx)
        {
-               p_ptr->tval_ammo = bow_tval_ammo(o_ptr);
+               p_ptr->tval_ammo = (byte_hack)bow_tval_ammo(o_ptr);
 
                /* Apply special flags */
                if (o_ptr->k_idx && !p_ptr->heavy_shoot)
@@ -5004,8 +5009,7 @@ void calc_bonuses(void)
                }
        }
 
-       if (p_ptr->ryoute)
-               hold *= 2;
+       if (p_ptr->ryoute) hold *= 2;
 
        for(i = 0 ; i < 2 ; i++)
        {
@@ -5164,10 +5168,10 @@ void calc_bonuses(void)
                        p_ptr->num_blow[i] = blows_table[str_index][dex_index];
 
                        /* Maximal value */
-                       if (p_ptr->num_blow[i] > num) p_ptr->num_blow[i] = num;
+                       if (p_ptr->num_blow[i] > num) p_ptr->num_blow[i] = (s16b)num;
 
                        /* Add in the "bonus blows" */
-                       p_ptr->num_blow[i] += extra_blows[i];
+                       p_ptr->num_blow[i] += (s16b)extra_blows[i];
 
 
                        if (p_ptr->pclass == CLASS_WARRIOR) p_ptr->num_blow[i] += (p_ptr->lev / 40);
@@ -5283,8 +5287,8 @@ void calc_bonuses(void)
                                        penalty += 30;
                                        if (penalty < 30) penalty = 30;
                                }
-                               p_ptr->to_h[i] -= penalty;
-                               p_ptr->dis_to_h[i] -= penalty;
+                               p_ptr->to_h[i] -= (s16b)penalty;
+                               p_ptr->dis_to_h[i] -= (s16b)penalty;
 
                                /* Riding weapon */
                                p_ptr->riding_wield[i] = TRUE;
@@ -5323,8 +5327,8 @@ void calc_bonuses(void)
                        if (penalty < 30) penalty = 30;
                }
                if (p_ptr->tval_ammo == TV_BOLT) penalty *= 2;
-               p_ptr->to_h_b -= penalty;
-               p_ptr->dis_to_h_b -= penalty;
+               p_ptr->to_h_b -= (s16b)penalty;
+               p_ptr->dis_to_h_b -= (s16b)penalty;
        }
 
        /* Different calculation for monks with empty hands */
@@ -5340,10 +5344,10 @@ void calc_bonuses(void)
                        if (blow_base > 31) p_ptr->num_blow[0]++;
                        if (blow_base > 44) p_ptr->num_blow[0]++;
                        if (blow_base > 58) p_ptr->num_blow[0]++;
-                       if (p_ptr->magic_num1[0])
+                       if (P_PTR_KI)
                        {
-                               p_ptr->to_d[0] += (p_ptr->magic_num1[0]/5);
-                               p_ptr->dis_to_d[0] += (p_ptr->magic_num1[0]/5);
+                               p_ptr->to_d[0] += P_PTR_KI / 5;
+                               p_ptr->dis_to_d[0] += P_PTR_KI / 5;
                        }
                }
                else
@@ -5424,8 +5428,8 @@ void calc_bonuses(void)
        {
                if (buki_motteruka(INVEN_RARM+i))
                {
-                       int tval = inventory[INVEN_RARM+i].tval - TV_WEAPON_BEGIN;
-                       int sval = inventory[INVEN_RARM+i].sval;
+                       OBJECT_TYPE_VALUE tval = inventory[INVEN_RARM+i].tval - TV_WEAPON_BEGIN;
+                       OBJECT_SUBTYPE_VALUE sval = inventory[INVEN_RARM+i].sval;
 
                        p_ptr->to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
                        p_ptr->dis_to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
@@ -5762,10 +5766,9 @@ void calc_bonuses(void)
                if ((inventory[i].tval == TV_NATURE_BOOK) && (inventory[i].sval == 2)) have_sw = TRUE;
                if ((inventory[i].tval == TV_CRAFT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE;
        }
-       for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
-       {
-               object_type *o_ptr;
 
+       for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+       {
                /* Acquire object */
                o_ptr = &o_list[this_o_idx];
 
@@ -6299,7 +6302,7 @@ s16b empty_hands(bool riding_control)
  */
 bool heavy_armor(void)
 {
-       u16b monk_arm_wgt = 0;
+       WEIGHT monk_arm_wgt = 0;
 
        if ((p_ptr->pclass != CLASS_MONK) && (p_ptr->pclass != CLASS_FORCETRAINER) && (p_ptr->pclass != CLASS_NINJA)) return FALSE;
 
@@ -6323,7 +6326,7 @@ void update_playtime(void)
        /* Check if the game has started */
        if (start_time != 0)
        {
-               u32b tmp = time(NULL);
+               u32b tmp = (u32b)time(NULL);
                playtime += (tmp - start_time);
                start_time = tmp;
        }