OSDN Git Service

[Refactor] #1366 Removed type alias 's16b' and replaced them all to 'int16_t'
authorHourier <grapefox.whitelucifer.0408@gmail.com>
Thu, 19 Aug 2021 05:28:55 +0000 (14:28 +0900)
committerHourier <grapefox.whitelucifer.0408@gmail.com>
Thu, 19 Aug 2021 11:31:01 +0000 (20:31 +0900)
143 files changed:
src/action/activation-execution.cpp
src/action/open-close-execution.cpp
src/action/run-execution.cpp
src/avatar/avatar.cpp
src/birth/auto-roller.cpp
src/birth/auto-roller.h
src/birth/birth-wizard.cpp
src/birth/history-generator.cpp
src/birth/inventory-initializer.cpp
src/birth/quick-start.h
src/cmd-action/cmd-attack.cpp
src/cmd-action/cmd-spell.cpp
src/cmd-io/cmd-gameoption.cpp
src/cmd-io/macro-util.cpp
src/cmd-io/macro-util.h
src/cmd-item/cmd-magiceat.cpp
src/combat/attack-criticality.cpp
src/combat/attack-criticality.h
src/combat/shoot.cpp
src/combat/shoot.h
src/core/player-processor.cpp
src/effect/effect-feature.cpp
src/flavor/flavor-describer.cpp
src/flavor/object-flavor.cpp
src/floor/floor-changer.cpp
src/floor/floor-save-util.h
src/floor/wild.cpp
src/game-option/special-options.cpp
src/game-option/special-options.h
src/grid/grid.cpp
src/grid/grid.h
src/grid/trap.cpp
src/info-reader/feature-reader.cpp
src/info-reader/feature-reader.h
src/info-reader/general-parser.cpp
src/info-reader/general-parser.h
src/inventory/inventory-object.cpp
src/inventory/inventory-object.h
src/io-dump/character-dump.cpp
src/io/input-key-requester.cpp
src/io/input-key-requester.h
src/io/signal-handlers.cpp
src/io/signal-handlers.h
src/io/tokenizer.cpp
src/io/tokenizer.h
src/knowledge/knowledge-monsters.cpp
src/knowledge/knowledge-uniques.cpp
src/load/birth-loader.cpp
src/load/dummy-loader.cpp
src/load/dungeon-loader.cpp
src/load/floor-loader.cpp
src/load/item-loader.cpp
src/load/load-util.cpp
src/load/load-util.h
src/load/load-v1-5-0.cpp
src/load/load-v1-7-0.cpp
src/load/load-zangband.cpp
src/load/load.cpp
src/load/lore-loader.cpp
src/load/monster-loader.cpp
src/load/player-info-loader.cpp
src/load/quest-loader.cpp
src/load/store-loader.cpp
src/load/world-loader.cpp
src/main-win/main-win-tokenizer.cpp
src/main-win/main-win-tokenizer.h
src/main-x11.cpp
src/main/game-data-initializer.cpp
src/main/x11-gamma-builder.cpp
src/market/arena.cpp
src/market/building-craft-weapon.cpp
src/market/play-gamble.cpp
src/mind/mind-archer.cpp
src/monster-attack/monster-eating.cpp
src/monster-floor/monster-direction.cpp
src/monster-floor/one-monster-placer.cpp
src/monster/monster-status-setter.cpp
src/monster/monster-status.cpp
src/object/object-info.cpp
src/object/object-info.h
src/player-ability/player-charisma.cpp
src/player-ability/player-charisma.h
src/player-ability/player-constitution.cpp
src/player-ability/player-constitution.h
src/player-ability/player-dexterity.cpp
src/player-ability/player-dexterity.h
src/player-ability/player-intelligence.cpp
src/player-ability/player-intelligence.h
src/player-ability/player-strength.cpp
src/player-ability/player-strength.h
src/player-ability/player-wisdom.cpp
src/player-ability/player-wisdom.h
src/player-attack/player-attack-util.h
src/player-attack/player-attack.cpp
src/player-attack/player-attack.h
src/player-status/player-basic-statistics.cpp
src/player-status/player-basic-statistics.h
src/player-status/player-infravision.cpp
src/player-status/player-infravision.h
src/player-status/player-speed.cpp
src/player-status/player-speed.h
src/player-status/player-status-base.cpp
src/player-status/player-status-base.h
src/player-status/player-stealth.cpp
src/player-status/player-stealth.h
src/player/player-class.h
src/player/player-personality.h
src/player/player-race.h
src/player/player-status.cpp
src/player/player-status.h
src/room/cave-filler.cpp
src/room/room-generator.cpp
src/room/room-info-table.h
src/room/rooms-pit-nest.cpp
src/room/rooms-trap.cpp
src/save/floor-writer.cpp
src/save/info-writer.cpp
src/save/item-writer.cpp
src/save/monster-writer.cpp
src/save/player-writer.cpp
src/save/save-util.cpp
src/save/save-util.h
src/save/save.cpp
src/spell-kind/spells-teleport.cpp
src/status/shape-changer.cpp
src/store/store-util.h
src/store/store.cpp
src/store/store.h
src/system/alloc-entries.cpp
src/system/alloc-entries.h
src/system/floor-type-definition.h
src/system/grid-type-definition.h
src/system/h-type.h
src/system/player-type-definition.h
src/target/target-describer.cpp
src/term/z-rand.cpp
src/term/z-rand.h
src/view/display-lore-status.cpp
src/window/display-sub-windows.cpp
src/window/main-window-left-frame.cpp
src/wizard/monster-info-spoiler.cpp
src/wizard/wizard-item-modifier.cpp
src/wizard/wizard-special-process.cpp

index 87ab0dc..9371bfd 100644 (file)
@@ -152,7 +152,7 @@ static bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
         return false;
 
     if (act_ptr->timeout.constant >= 0) {
-        o_ptr->timeout = (s16b)act_ptr->timeout.constant;
+        o_ptr->timeout = (int16_t)act_ptr->timeout.constant;
         if (act_ptr->timeout.dice > 0)
             o_ptr->timeout += randint1(act_ptr->timeout.dice);
 
index 674273e..7eab34e 100644 (file)
@@ -100,7 +100,7 @@ bool exe_close(player_type *creature_ptr, POSITION y, POSITION x)
     if (!has_flag(f_info[old_feat].flags, FF_CLOSE))
         return more;
 
-    s16b closed_feat = feat_state(creature_ptr->current_floor_ptr, old_feat, FF_CLOSE);
+    int16_t closed_feat = feat_state(creature_ptr->current_floor_ptr, old_feat, FF_CLOSE);
     if ((!g_ptr->o_idx_list.empty() || g_ptr->is_object()) && (closed_feat != old_feat) && !has_flag(f_info[closed_feat].flags, FF_DROP)) {
         msg_print(_("何かがつっかえて閉まらない。", "Something prevents it from closing."));
         return more;
index 789d583..603fb5c 100644 (file)
@@ -68,7 +68,7 @@ static bool see_wall(player_type *creature_ptr, DIRECTION dir, POSITION y, POSIT
     if (!g_ptr->is_mark())
         return false;
 
-    s16b feat = g_ptr->get_feat_mimic();
+    int16_t feat = g_ptr->get_feat_mimic();
     feature_type *f_ptr = &f_info[feat];
     if (!player_can_enter(creature_ptr, feat, 0))
         return !has_flag(f_ptr->flags, FF_DOOR);
index 700c31b..7930be3 100644 (file)
@@ -145,7 +145,7 @@ static void get_random_virtue(player_type *creature_ptr, int which)
         }
     }
 
-    creature_ptr->vir_types[which] = (s16b)type;
+    creature_ptr->vir_types[which] = (int16_t)type;
 }
 
 /*!
@@ -214,7 +214,7 @@ static enum virtue_idx get_realm_virtues(player_type *creature_ptr, REALM_IDX re
 void initialize_virtues(player_type *creature_ptr)
 {
     int i = 0, j = 0;
-    s16b tmp_vir;
+    int16_t tmp_vir;
 
     /* Reset */
     for (i = 0; i < 8; i++) {
@@ -503,7 +503,7 @@ void set_virtue(player_type *creature_ptr, int virtue_id, int amount)
 {
     for (int i = 0; i < 8; i++)
         if (creature_ptr->vir_types[i] == virtue_id) {
-            creature_ptr->virtues[i] = (s16b)amount;
+            creature_ptr->virtues[i] = (int16_t)amount;
             return;
         }
 }
index 1fd905a..463b58c 100644 (file)
@@ -16,7 +16,7 @@
 #include "util/int-char-converter.h"
 
 /*! オートローラの能力値的要求水準 / Autoroll limit */
-s16b stat_limit[6];
+int16_t stat_limit[6];
 
 /*! オートローラの試行回数 / Autoroll round */
 s32b auto_round;
@@ -323,7 +323,7 @@ bool get_stat_limits(player_type *creature_ptr)
     }
 
     for (int i = 0; i < A_MAX; i++)
-        stat_limit[i] = (s16b)cval[i];
+        stat_limit[i] = (int16_t)cval[i];
 
     return true;
 }
@@ -572,13 +572,13 @@ bool get_chara_limits(player_type *creature_ptr, chara_limit_type *chara_limit_p
             break;
     }
 
-    chara_limit_ptr->agemin = (s16b)cval[0];
-    chara_limit_ptr->agemax = (s16b)cval[1];
-    chara_limit_ptr->htmin = (s16b)cval[2];
-    chara_limit_ptr->htmax = (s16b)cval[3];
-    chara_limit_ptr->wtmin = (s16b)cval[4];
-    chara_limit_ptr->wtmax = (s16b)cval[5];
-    chara_limit_ptr->scmin = (s16b)cval[6];
-    chara_limit_ptr->scmax = (s16b)cval[7];
+    chara_limit_ptr->agemin = (int16_t)cval[0];
+    chara_limit_ptr->agemax = (int16_t)cval[1];
+    chara_limit_ptr->htmin = (int16_t)cval[2];
+    chara_limit_ptr->htmax = (int16_t)cval[3];
+    chara_limit_ptr->wtmin = (int16_t)cval[4];
+    chara_limit_ptr->wtmax = (int16_t)cval[5];
+    chara_limit_ptr->scmin = (int16_t)cval[6];
+    chara_limit_ptr->scmax = (int16_t)cval[7];
     return true;
 }
index 5e0a642..3f73d65 100644 (file)
@@ -4,13 +4,13 @@
 
 /*! オートローラの年齢、身長、体重、社会的地位の要求水準 */
 typedef struct {
-    s16b agemin, agemax;
-    s16b htmin, htmax;
-    s16b wtmin, wtmax;
-    s16b scmin, scmax;
+    int16_t agemin, agemax;
+    int16_t htmin, htmax;
+    int16_t wtmin, wtmax;
+    int16_t scmin, scmax;
 } chara_limit_type;
 
-extern s16b stat_limit[6];
+extern int16_t stat_limit[6];
 extern s32b auto_round;
 extern s32b auto_upper_round;
 extern s32b autoroll_chance;
index 30a9a7c..df827e7 100644 (file)
@@ -269,7 +269,7 @@ static bool let_player_build_character(player_type *creature_ptr)
 static void display_initial_options(player_type *creature_ptr)
 {
     u16b expfact = get_expfact(creature_ptr) - 100;
-    s16b adj[A_MAX];
+    int16_t adj[A_MAX];
     for (int i = 0; i < A_MAX; i++) {
         adj[i] = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
     }
@@ -502,7 +502,7 @@ static bool display_auto_roller(player_type *creature_ptr, chara_limit_type char
 
         get_extra(creature_ptr, true);
         get_money(creature_ptr);
-        creature_ptr->chaos_patron = (s16b)randint0(MAX_PATRON);
+        creature_ptr->chaos_patron = (int16_t)randint0(MAX_PATRON);
 
         char c;
         if (!display_auto_roller_result(creature_ptr, prev, &c))
index 43d8b54..7c42f48 100644 (file)
@@ -112,7 +112,7 @@ static void decide_social_class(player_type *creature_ptr, char *buf)
     else if (social_class < 1)
         social_class = 1;
 
-    creature_ptr->sc = (s16b)social_class;
+    creature_ptr->sc = (int16_t)social_class;
 }
 
 /*!
index 9a934ef..4bb7404 100644 (file)
@@ -78,7 +78,7 @@ void add_outfit(player_type *creature_ptr, object_type *o_ptr)
 {
     object_aware(creature_ptr, o_ptr);
     object_known(o_ptr);
-    s16b slot = store_item_to_inventory(creature_ptr, o_ptr);
+    int16_t slot = store_item_to_inventory(creature_ptr, o_ptr);
     autopick_alter_item(creature_ptr, slot, false);
     wield_all(creature_ptr);
 }
index 4d0fa6f..aedfd56 100644 (file)
@@ -17,10 +17,10 @@ struct birther {
     REALM_IDX realm1{}; /* First magic realm */
     REALM_IDX realm2{}; /* Second magic realm */
 
-    s16b age{};
-    s16b ht{};
-    s16b wt{};
-    s16b sc{};
+    int16_t age{};
+    int16_t ht{};
+    int16_t wt{};
+    int16_t sc{};
 
     PRICE au{}; /*!< 初期の所持金 */
 
@@ -30,7 +30,7 @@ struct birther {
 
     PATRON_IDX chaos_patron{};
 
-    s16b vir_types[8]{};
+    int16_t vir_types[8]{};
 
     char history[4][60]{};
 
index e27277e..3ebaf63 100644 (file)
@@ -123,7 +123,7 @@ static void natural_attack(player_type *attacker_ptr, MONSTER_IDX m_idx, MUTA at
     msg_format(_("%sを%sで攻撃した。", "You hit %s with your %s."), m_name, atk_desc);
 
     HIT_POINT k = damroll(dice_num, dice_side);
-    k = critical_norm(attacker_ptr, n_weight, bonus, k, (s16b)bonus, HISSATSU_NONE);
+    k = critical_norm(attacker_ptr, n_weight, bonus, k, (int16_t)bonus, HISSATSU_NONE);
     k += attacker_ptr->to_d_m;
     if (k < 0)
         k = 0;
index 8656d21..ceeb843 100644 (file)
@@ -1315,8 +1315,8 @@ bool do_cmd_cast(player_type *caster_ptr)
             break;
         }
         if (any_bits(mp_ptr->spell_xtra, extra_magic_gain_exp)) {
-            s16b cur_exp = caster_ptr->spell_exp[(increment ? 32 : 0) + spell];
-            s16b exp_gain = 0;
+            int16_t cur_exp = caster_ptr->spell_exp[(increment ? 32 : 0) + spell];
+            int16_t exp_gain = 0;
 
             if (cur_exp < SPELL_EXP_BEGINNER)
                 exp_gain += 60;
index 9a2b1fe..d28010e 100644 (file)
@@ -58,7 +58,7 @@ static opts option_fields[OPT_NUM] = {
  * @param current 現在のセーブ頻度ターン値
  * @return 次のセーブ頻度ターン値
  */
-static s16b toggle_frequency(s16b current)
+static int16_t toggle_frequency(int16_t current)
 {
     switch (current) {
     case 0:
index bfb20df..5e359e4 100644 (file)
@@ -13,7 +13,7 @@ concptr *macro__pat;
 concptr *macro__act;
 
 /* Number of active macros */
-s16b macro__num;
+int16_t macro__num;
 
 /* Expand macros in "get_com" or not */
 bool get_com_no_macros = false;
index e12640a..fae3593 100644 (file)
@@ -9,7 +9,7 @@ extern bool get_com_no_macros;
 
 extern concptr *macro__pat;
 extern concptr *macro__act;
-extern s16b macro__num;
+extern int16_t macro__num;
 
 int macro_find_exact(concptr pat);
 int macro_find_check(concptr pat);
index 8b5a167..61d1279 100644 (file)
@@ -302,7 +302,7 @@ static OBJECT_SUBTYPE_VALUE select_magic_eater(player_type *creature_ptr, bool o
                             col = TERM_RED;
                     } else {
                         strcat(dummy,
-                            format(" %-22.22s    %2d/%2d %3d%%", k_info[k_idx].name.c_str(), (s16b)(creature_ptr->magic_num1[ctr + ext] / EATER_CHARGE),
+                            format(" %-22.22s    %2d/%2d %3d%%", k_info[k_idx].name.c_str(), (int16_t)(creature_ptr->magic_num1[ctr + ext] / EATER_CHARGE),
                                 creature_ptr->magic_num2[ctr + ext], chance));
                         if (creature_ptr->magic_num1[ctr + ext] < EATER_CHARGE)
                             col = TERM_RED;
index e19e26f..8311804 100644 (file)
@@ -48,7 +48,7 @@ std::tuple<HIT_POINT, concptr, sound_type> apply_critical_norm_damage(int k, HIT
  * @param mode オプションフラグ
  * @return クリティカル修正が入ったダメージ値
  */
-HIT_POINT critical_norm(player_type *attacker_ptr, WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, combat_options mode, bool impact)
+HIT_POINT critical_norm(player_type *attacker_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, combat_options mode, bool impact)
 {
     /* Extract "blow" power */
     int i = (weight + (meichuu * 3 + plus * 5) + attacker_ptr->skill_thn);
index f4b54a0..0c4e29d 100644 (file)
@@ -9,6 +9,6 @@
 typedef struct player_attack_type player_attack_type;
 typedef struct player_type player_type;
 std::tuple<HIT_POINT, concptr, sound_type> apply_critical_norm_damage(int k, HIT_POINT base_dam);
-HIT_POINT critical_norm(player_type *attacker_ptr, WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, combat_options mode, bool impact = false);
+HIT_POINT critical_norm(player_type *attacker_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, combat_options mode, bool impact = false);
 int calc_monster_critical(DICE_NUMBER dice, DICE_SID sides, HIT_POINT dam);
 void critical_attack(player_type *attacker_ptr, player_attack_type *pa_ptr);
index 136ae35..fa02b65 100644 (file)
@@ -1189,7 +1189,7 @@ HIT_POINT calc_expect_crit_shot(player_type *shooter_ptr, WEIGHT weight, int plu
  * @param impact 強撃かどうか
  * @return ダメージ期待値
  */
-HIT_POINT calc_expect_crit(player_type *shooter_ptr, WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, bool dokubari, bool impact)
+HIT_POINT calc_expect_crit(player_type *shooter_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, bool dokubari, bool impact)
 {
     if (dokubari)
         return dam;
index 079f7ce..ba474e9 100644 (file)
@@ -11,5 +11,5 @@ ENERGY bow_energy(OBJECT_SUBTYPE_VALUE sval);
 int bow_tmul(OBJECT_SUBTYPE_VALUE sval);
 HIT_POINT calc_crit_ratio_shot(player_type *shooter_ptr, HIT_POINT plus_ammo, HIT_POINT plus_bow);
 HIT_POINT calc_expect_crit_shot(player_type *shooter_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam);
-HIT_POINT calc_expect_crit(player_type *shooter_ptr, WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, bool dokubari, bool impact);
+HIT_POINT calc_expect_crit(player_type *shooter_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, bool dokubari, bool impact);
 void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type);
index 0462228..39fdced 100644 (file)
@@ -312,7 +312,7 @@ void process_player(player_type *creature_ptr)
             if (creature_ptr->timewalk || creature_ptr->energy_use > 400) {
                 creature_ptr->energy_need += creature_ptr->energy_use * TURNS_PER_TICK / 10;
             } else {
-                creature_ptr->energy_need += (s16b)((s32b)creature_ptr->energy_use * ENERGY_NEED() / 100L);
+                creature_ptr->energy_need += (int16_t)((s32b)creature_ptr->energy_use * ENERGY_NEED() / 100L);
             }
 
             if (creature_ptr->image)
index 59723d1..61841e8 100644 (file)
@@ -220,7 +220,7 @@ bool affect_feature(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSITI
         if (!has_flag(f_ptr->flags, FF_SPIKE))
             break;
 
-        s16b old_mimic = g_ptr->mimic;
+        int16_t old_mimic = g_ptr->mimic;
         feature_type *mimic_f_ptr = &f_info[g_ptr->get_feat_mimic()];
 
         cave_alter_feat(caster_ptr, y, x, FF_SPIKE);
index ce33749..3043834 100644 (file)
@@ -286,7 +286,7 @@ static void describe_bow_power(player_type *player_ptr, flavor_type *flavor_ptr)
 static void describe_spike_power(player_type *player_ptr, flavor_type *flavor_ptr)
 {
     int avgdam = player_ptr->mighty_throw ? (1 + 3) : 1;
-    s16b energy_fire = 100 - player_ptr->lev;
+    int16_t energy_fire = 100 - player_ptr->lev;
     avgdam += ((player_ptr->lev + 30) * (player_ptr->lev + 30) - 900) / 55;
     flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
     flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
index 0531fcd..d92be89 100644 (file)
@@ -213,12 +213,12 @@ static void shuffle_flavors(tval_type tval)
     for (KIND_OBJECT_IDX i = 0; i < k_idx_list_num; i++) {
         object_kind *k1_ptr = &k_info[k_idx_list[i]];
         object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
-        s16b tmp = k1_ptr->flavor;
+        int16_t tmp = k1_ptr->flavor;
         k1_ptr->flavor = k2_ptr->flavor;
         k2_ptr->flavor = tmp;
     }
 
-    C_KILL(k_idx_list, max_k_idx, s16b);
+    C_KILL(k_idx_list, max_k_idx, int16_t);
 }
 
 /*!
index 57b6eff..1fe8d45 100644 (file)
@@ -163,7 +163,7 @@ static void place_pet(player_type *master_ptr)
  * while new floor creation since dungeons may be re-created by\n
  * auto-scum option.\n
  */
-static void update_unique_artifact(floor_type *floor_ptr, s16b cur_floor_id)
+static void update_unique_artifact(floor_type *floor_ptr, int16_t cur_floor_id)
 {
     for (int i = 1; i < floor_ptr->m_max; i++) {
         monster_race *r_ptr;
index 281d204..654fcfc 100644 (file)
@@ -8,7 +8,7 @@
 
 typedef struct saved_floor_type {
     FLOOR_IDX floor_id; /* No recycle until 65536 IDs are all used */
-    s16b savefile_id; /* ID for savefile (from 0 to MAX_SAVED_FLOOR) */
+    int16_t savefile_id; /* ID for savefile (from 0 to MAX_SAVED_FLOOR) */
     DEPTH dun_level;
     s32b last_visit; /* Time count of last visit. 0 for new floor. */
     u32b visit_mark; /* Older has always smaller mark. */
index 1b27b0a..b54efea 100644 (file)
@@ -54,14 +54,14 @@ wilderness_type **wilderness;
 bool generate_encounter;
 
 typedef struct border_type {
-    s16b north[MAX_WID];
-    s16b south[MAX_WID];
-    s16b east[MAX_HGT];
-    s16b west[MAX_HGT];
-    s16b north_west;
-    s16b north_east;
-    s16b south_west;
-    s16b south_east;
+    int16_t north[MAX_WID];
+    int16_t south[MAX_WID];
+    int16_t east[MAX_HGT];
+    int16_t west[MAX_HGT];
+    int16_t north_west;
+    int16_t north_east;
+    int16_t south_west;
+    int16_t south_east;
 } border_type;
 
 /*!
@@ -69,7 +69,7 @@ typedef struct border_type {
  * @param feat_type 非一様確率を再現するための要素数100の配列
  * @param prob 元の確率テーブル
  */
-static void set_floor_and_wall_aux(s16b feat_type[100], feat_prob prob[DUNGEON_FEAT_PROB_NUM])
+static void set_floor_and_wall_aux(int16_t feat_type[100], feat_prob prob[DUNGEON_FEAT_PROB_NUM])
 {
     int lim[DUNGEON_FEAT_PROB_NUM];
     lim[0] = prob[0].percent;
@@ -210,7 +210,7 @@ static void plasma_recursive(floor_type *floor_ptr, POSITION x1, POSITION y1, PO
 }
 
 /* The default table in terrain level generation. */
-static s16b terrain_table[MAX_WILDERNESS][MAX_FEAT_IN_TERRAIN];
+static int16_t terrain_table[MAX_WILDERNESS][MAX_FEAT_IN_TERRAIN];
 
 /*!
  * @brief 荒野フロア生成のサブルーチン
@@ -232,16 +232,16 @@ static void generate_wilderness_area(floor_type *floor_ptr, int terrain, u32b se
     u32b state_backup[4];
     Rand_state_backup(state_backup);
     Rand_state_set(seed);
-    int table_size = sizeof(terrain_table[0]) / sizeof(s16b);
+    int table_size = sizeof(terrain_table[0]) / sizeof(int16_t);
     if (!corner)
         for (POSITION y1 = 0; y1 < MAX_HGT; y1++)
             for (POSITION x1 = 0; x1 < MAX_WID; x1++)
                 floor_ptr->grid_array[y1][x1].feat = table_size / 2;
 
-    floor_ptr->grid_array[1][1].feat = (s16b)randint0(table_size);
-    floor_ptr->grid_array[MAX_HGT - 2][1].feat = (s16b)randint0(table_size);
-    floor_ptr->grid_array[1][MAX_WID - 2].feat = (s16b)randint0(table_size);
-    floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat = (s16b)randint0(table_size);
+    floor_ptr->grid_array[1][1].feat = (int16_t)randint0(table_size);
+    floor_ptr->grid_array[MAX_HGT - 2][1].feat = (int16_t)randint0(table_size);
+    floor_ptr->grid_array[1][MAX_WID - 2].feat = (int16_t)randint0(table_size);
+    floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat = (int16_t)randint0(table_size);
     if (corner) {
         floor_ptr->grid_array[1][1].feat = terrain_table[terrain][floor_ptr->grid_array[1][1].feat];
         floor_ptr->grid_array[MAX_HGT - 2][1].feat = terrain_table[terrain][floor_ptr->grid_array[MAX_HGT - 2][1].feat];
@@ -251,10 +251,10 @@ static void generate_wilderness_area(floor_type *floor_ptr, int terrain, u32b se
         return;
     }
 
-    s16b north_west = floor_ptr->grid_array[1][1].feat;
-    s16b south_west = floor_ptr->grid_array[MAX_HGT - 2][1].feat;
-    s16b north_east = floor_ptr->grid_array[1][MAX_WID - 2].feat;
-    s16b south_east = floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
+    int16_t north_west = floor_ptr->grid_array[1][1].feat;
+    int16_t south_west = floor_ptr->grid_array[MAX_HGT - 2][1].feat;
+    int16_t north_east = floor_ptr->grid_array[1][MAX_WID - 2].feat;
+    int16_t south_east = floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
     FEAT_IDX roughness = 1; /* The roughness of the level. */
     plasma_recursive(floor_ptr, 1, 1, MAX_WID - 2, MAX_HGT - 2, table_size - 1, roughness);
     floor_ptr->grid_array[1][1].feat = north_west;
@@ -546,7 +546,7 @@ void wilderness_gen(player_type *creature_ptr)
             quest[i].status = QUEST_STATUS_FINISHED;
 }
 
-static s16b conv_terrain2feat[MAX_WILDERNESS];
+static int16_t conv_terrain2feat[MAX_WILDERNESS];
 
 /*!
  * @brief 広域マップの生成(簡易処理版) /
@@ -563,8 +563,8 @@ void wilderness_gen_small(player_type *creature_ptr)
     for (int i = 0; i < current_world_ptr->max_wild_x; i++) {
         for (int j = 0; j < current_world_ptr->max_wild_y; j++) {
             if (wilderness[j][i].town && (wilderness[j][i].town != NO_TOWN)) {
-                floor_ptr->grid_array[j][i].feat = (s16b)feat_town;
-                floor_ptr->grid_array[j][i].special = (s16b)wilderness[j][i].town;
+                floor_ptr->grid_array[j][i].feat = (int16_t)feat_town;
+                floor_ptr->grid_array[j][i].special = (int16_t)wilderness[j][i].town;
                 floor_ptr->grid_array[j][i].info |= (CAVE_GLOW | CAVE_MARK);
                 continue;
             }
@@ -587,8 +587,8 @@ void wilderness_gen_small(player_type *creature_ptr)
         }
     }
 
-    floor_ptr->height = (s16b)current_world_ptr->max_wild_y;
-    floor_ptr->width = (s16b)current_world_ptr->max_wild_x;
+    floor_ptr->height = (int16_t)current_world_ptr->max_wild_y;
+    floor_ptr->width = (int16_t)current_world_ptr->max_wild_x;
     if (floor_ptr->height > MAX_HGT)
         floor_ptr->height = MAX_HGT;
 
@@ -653,7 +653,7 @@ parse_error_type parse_line_wilderness(player_type *creature_ptr, char *buf, int
                 w_letter[index].terrain = TERRAIN_EDGE;
 
             if (num > 2)
-                w_letter[index].level = (s16b)atoi(zz[2]);
+                w_letter[index].level = (int16_t)atoi(zz[2]);
             else
                 w_letter[index].level = 0;
 
@@ -775,7 +775,7 @@ errr init_wilderness(void)
  * @param feat_global 基本的な地形ID
  * @param fmt 地勢内の地形数を参照するための独自フォーマット
  */
-static void init_terrain_table(int terrain, s16b feat_global, concptr fmt, ...)
+static void init_terrain_table(int terrain, int16_t feat_global, concptr fmt, ...)
 {
     va_list vp;
     va_start(vp, fmt);
@@ -788,7 +788,7 @@ static void init_terrain_table(int terrain, s16b feat_global, concptr fmt, ...)
             continue;
         }
 
-        FEAT_IDX feat = (s16b)va_arg(vp, int);
+        FEAT_IDX feat = (int16_t)va_arg(vp, int);
         int num = va_arg(vp, int);
         int lim = cur + num;
         for (; (cur < lim) && (cur < MAX_FEAT_IN_TERRAIN); cur++)
index a718bf6..e519a80 100644 (file)
@@ -5,7 +5,7 @@ byte mana_warn; /* Mana color (0 to 9) */
 byte delay_factor; /* Delay factor (0 to 9) */
 bool autosave_l; /* Autosave before entering new levels */
 bool autosave_t; /* Timed autosave */
-s16b autosave_freq; /* Autosave frequency */
+int16_t autosave_freq; /* Autosave frequency */
 bool use_sound; /* The "sound" mode is enabled */
 bool use_music; /* The "music" mode is enabled */
 bool use_graphics; /* The "graphics" mode is enabled */
index 3bc1207..d545eb1 100644 (file)
@@ -5,7 +5,7 @@
 extern byte hitpoint_warn;
 extern byte mana_warn;
 extern byte delay_factor;
-extern s16b autosave_freq;
+extern int16_t autosave_freq;
 extern bool autosave_t;
 extern bool autosave_l;
 extern bool use_sound;
index 8b6c267..1c9f1b3 100644 (file)
@@ -1003,7 +1003,7 @@ void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type gb_typ
     case GB_OUTER_NOPERM: {
         feature_type *f_ptr = &f_info[feat_wall_outer];
         if (permanent_wall(f_ptr)) {
-            g_ptr->feat = (s16b)feat_state(player_ptr->current_floor_ptr, feat_wall_outer, FF_UNPERM);
+            g_ptr->feat = (int16_t)feat_state(player_ptr->current_floor_ptr, feat_wall_outer, FF_UNPERM);
         } else {
             g_ptr->feat = feat_wall_outer;
         }
@@ -1027,7 +1027,7 @@ void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type gb_typ
     case GB_SOLID_NOPERM: {
         feature_type *f_ptr = &f_info[feat_wall_solid];
         if ((g_ptr->info & CAVE_VAULT) && permanent_wall(f_ptr))
-            g_ptr->feat = (s16b)feat_state(player_ptr->current_floor_ptr, feat_wall_solid, FF_UNPERM);
+            g_ptr->feat = (int16_t)feat_state(player_ptr->current_floor_ptr, feat_wall_solid, FF_UNPERM);
         else
             g_ptr->feat = feat_wall_solid;
         g_ptr->info &= ~(CAVE_MASK);
index 351e89a..131bfe7 100644 (file)
@@ -23,7 +23,7 @@ struct grid_template_type {
     BIT_FLAGS info;
     FEAT_IDX feat;
     FEAT_IDX mimic;
-    s16b special;
+    int16_t special;
     u16b occurrence;
 };
 
index 3c075b3..b358484 100644 (file)
@@ -45,7 +45,7 @@
 #include "view/display-messages.h"
 #include "world/world.h"
 
-static s16b normal_traps[MAX_NORMAL_TRAPS];
+static int16_t normal_traps[MAX_NORMAL_TRAPS];
 
 /*!
  * @brief 箱のトラップテーブル
index 2d6fba9..b3287a8 100644 (file)
@@ -237,7 +237,7 @@ errr init_feat_variables(void)
     /* Locked doors */
     FEAT_IDX i;
     for (i = 1; i < MAX_LJ_DOORS; i++) {
-        s16b door = f_tag_to_index(format("LOCKED_DOOR_%d", i));
+        int16_t door = f_tag_to_index(format("LOCKED_DOOR_%d", i));
         if (door < 0)
             break;
         feat_door[DOOR_DOOR].locked[i - 1] = door;
@@ -249,7 +249,7 @@ errr init_feat_variables(void)
 
     /* Jammed doors */
     for (i = 0; i < MAX_LJ_DOORS; i++) {
-        s16b door = f_tag_to_index(format("JAMMED_DOOR_%d", i));
+        int16_t door = f_tag_to_index(format("JAMMED_DOOR_%d", i));
         if (door < 0)
             break;
         feat_door[DOOR_DOOR].jammed[i] = door;
@@ -266,7 +266,7 @@ errr init_feat_variables(void)
 
     /* Locked glass doors */
     for (i = 1; i < MAX_LJ_DOORS; i++) {
-        s16b door = f_tag_to_index(format("LOCKED_GLASS_DOOR_%d", i));
+        int16_t door = f_tag_to_index(format("LOCKED_GLASS_DOOR_%d", i));
         if (door < 0)
             break;
         feat_door[DOOR_GLASS_DOOR].locked[i - 1] = door;
@@ -278,7 +278,7 @@ errr init_feat_variables(void)
 
     /* Jammed glass doors */
     for (i = 0; i < MAX_LJ_DOORS; i++) {
-        s16b door = f_tag_to_index(format("JAMMED_GLASS_DOOR_%d", i));
+        int16_t door = f_tag_to_index(format("JAMMED_GLASS_DOOR_%d", i));
         if (door < 0)
             break;
         feat_door[DOOR_GLASS_DOOR].jammed[i] = door;
@@ -391,7 +391,7 @@ FEAT_IDX f_tag_to_index(std::string_view str)
  * Initialize quest array
  * @return 地形ID
  */
-s16b f_tag_to_index_in_init(concptr str)
+int16_t f_tag_to_index_in_init(concptr str)
 {
     FEAT_IDX feat = f_tag_to_index(str);
 
index c944eb8..89349ba 100644 (file)
@@ -7,5 +7,5 @@ struct angband_header;
 errr parse_f_info(std::string_view buf, angband_header *head);
 errr init_feat_variables(void);
 FEAT_IDX f_tag_to_index(std::string_view str);
-s16b f_tag_to_index_in_init(concptr str);
+int16_t f_tag_to_index_in_init(concptr str);
 void retouch_f_info(angband_header *head);
index ef6eaea..07480f7 100644 (file)
@@ -92,7 +92,7 @@ parse_error_type parse_line_feature(floor_type *floor_ptr, char *buf)
 
     switch (num) {
     case 9:
-        letter[index].special = (s16b)atoi(zz[8]);
+        letter[index].special = (int16_t)atoi(zz[8]);
         /* Fall through */
     case 8:
         if ((zz[7][0] == '*') && !zz[7][1]) {
index d3d975e..31a4982 100644 (file)
@@ -14,7 +14,7 @@ typedef struct dungeon_grid {
     ARTIFACT_IDX artifact; /* Artifact */
     IDX trap; /* Trap */
     BIT_FLAGS cave_info; /* Flags for CAVE_MARK, CAVE_GLOW, CAVE_ICKY, CAVE_ROOM */
-    s16b special; /* Reserved for special terrain info */
+    int16_t special; /* Reserved for special terrain info */
     int random; /* Number of the random effect */
 } dungeon_grid;
 
index 5534883..738fcd8 100644 (file)
@@ -282,7 +282,7 @@ void reorder_pack(player_type *owner_ptr)
  * Note that this code must remove any location/stack information\n
  * from the object once it is placed into the inventory.\n
  */
-s16b store_item_to_inventory(player_type *owner_ptr, object_type *o_ptr)
+int16_t store_item_to_inventory(player_type *owner_ptr, object_type *o_ptr)
 {
     INVENTORY_IDX i, j, k;
     INVENTORY_IDX n = -1;
index 3518565..52b0283 100644 (file)
@@ -10,6 +10,6 @@ void inven_item_optimize(player_type *owner_ptr, INVENTORY_IDX item);
 void drop_from_inventory(player_type *owner_type, INVENTORY_IDX item, ITEM_NUMBER amt);
 void combine_pack(player_type *owner_ptr);
 void reorder_pack(player_type *owner_ptr);
-s16b store_item_to_inventory(player_type *owner_ptr, object_type *o_ptr);
+int16_t store_item_to_inventory(player_type *owner_ptr, object_type *o_ptr);
 bool check_store_item_to_inventory(player_type *owner_ptr, object_type *o_ptr);
 INVENTORY_IDX inven_takeoff(player_type *owner_ptr, INVENTORY_IDX item, ITEM_NUMBER amt);
index 08a107d..0de2953 100644 (file)
@@ -139,7 +139,7 @@ static void dump_aux_last_message(player_type *creature_ptr, FILE *fff)
     if (!current_world_ptr->total_winner) {
         fprintf(fff, _("\n  [死ぬ直前のメッセージ]\n\n", "\n  [Last Messages]\n\n"));
         for (int i = MIN(message_num(), 30); i >= 0; i--) {
-            fprintf(fff, "> %s\n", message_str((s16b)i));
+            fprintf(fff, "> %s\n", message_str((int16_t)i));
         }
 
         fputc('\n', fff);
@@ -320,7 +320,7 @@ static void dump_aux_monsters(player_type *creature_ptr, FILE *fff)
     /* No monsters is defeated */
     if (norm_total < 1) {
         fprintf(fff, _("まだ敵を倒していません。\n", "You have defeated no enemies yet.\n"));
-        C_KILL(who, max_r_idx, s16b);
+        C_KILL(who, max_r_idx, int16_t);
         return;
     }
 
@@ -331,7 +331,7 @@ static void dump_aux_monsters(player_type *creature_ptr, FILE *fff)
 #else
         fprintf(fff, "You have defeated %ld %s.\n", norm_total, norm_total == 1 ? "enemy" : "enemies");
 #endif
-        C_KILL(who, max_r_idx, s16b);
+        C_KILL(who, max_r_idx, int16_t);
         return;
     }
 
@@ -359,7 +359,7 @@ static void dump_aux_monsters(player_type *creature_ptr, FILE *fff)
         fprintf(fff, _("  %-40s (レベル%3d)%s\n", "  %-40s (level %3d)%s\n"), r_ptr->name.c_str(), (int)r_ptr->level, buf);
     }
 
-    C_KILL(who, max_r_idx, s16b);
+    C_KILL(who, max_r_idx, int16_t);
 }
 
 /*!
index 86904cc..129cdff 100644 (file)
@@ -32,14 +32,14 @@ concptr keymap_act[KEYMAP_MODES][256];
 
 bool use_menu;
 
-s16b command_cmd; /* Current "Angband Command" */
+int16_t command_cmd; /* Current "Angband Command" */
 COMMAND_ARG command_arg; /*!< 各種コマンドの汎用的な引数として扱う / Gives argument of current command */
 COMMAND_NUM command_rep; /*!< 各種コマンドの汎用的なリピート数として扱う / Gives repetition of current command */
 DIRECTION command_dir; /*!< 各種コマンドの汎用的な方向値処理として扱う/ Gives direction of current command */
-s16b command_see; /* アイテム使用時等にリストを表示させるかどうか (ゲームオプションの他、様々なタイミングでONになったりOFFになったりする模様……) */
-s16b command_wrk; /* アイテムの使用許可状況 (ex. 装備品のみ、床上もOK等) */
+int16_t command_see; /* アイテム使用時等にリストを表示させるかどうか (ゲームオプションの他、様々なタイミングでONになったりOFFになったりする模様……) */
+int16_t command_wrk; /* アイテムの使用許可状況 (ex. 装備品のみ、床上もOK等) */
 TERM_LEN command_gap = 999; /* アイテムの表示に使う (詳細未調査) */
-s16b command_new; /* Command chaining from inven/equip view */
+int16_t command_new; /* Command chaining from inven/equip view */
 
 /*
  * Hack -- special buffer to hold the action of the current keymap
@@ -189,7 +189,7 @@ static char inkey_from_menu(player_type *player_ptr)
  */
 void request_command(player_type *player_ptr, int shopping)
 {
-    s16b cmd;
+    int16_t cmd;
     int mode;
 
     concptr act;
index 186931b..2527191 100644 (file)
@@ -9,12 +9,12 @@ extern bool use_menu;
 
 extern COMMAND_CODE command_cmd;
 extern COMMAND_ARG command_arg;
-extern s16b command_rep;
+extern int16_t command_rep;
 extern DIRECTION command_dir;
-extern s16b command_see;
+extern int16_t command_see;
 extern TERM_LEN command_gap;
-extern s16b command_wrk;
-extern s16b command_new;
+extern int16_t command_wrk;
+extern int16_t command_new;
 
 typedef struct player_type player_type;
 void request_command(player_type *player_ptr, int shopping);
index 375a8f1..c43f4ea 100644 (file)
@@ -18,7 +18,7 @@
 #include "term/term-color-types.h"
 #include "world/world.h"
 
-s16b signal_count; /* Hack -- Count interupts */
+int16_t signal_count; /* Hack -- Count interupts */
 
 #include <signal.h>
 
index 47f712a..908b4fd 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 
 #include "system/angband.h"
-extern s16b signal_count;
+extern int16_t signal_count;
 
 extern void signals_ignore_tstp(void);
 extern void signals_handle_tstp(void);
index a884c66..f56b762 100644 (file)
@@ -18,9 +18,9 @@
  * Hack -- We will always extract at least one token
  * </pre>
  */
-s16b tokenize(char *buf, s16b num, char **tokens, BIT_FLAGS mode)
+int16_t tokenize(char *buf, int16_t num, char **tokens, BIT_FLAGS mode)
 {
-       s16b i = 0;
+       int16_t i = 0;
        char *s = buf;
        while (i < num - 1)
        {
index bc9c5ab..6756717 100644 (file)
@@ -4,4 +4,4 @@
 
 #define TOKENIZE_CHECKQUOTE 0x01  /* Special handling of single quotes */
 
-s16b tokenize(char *buf, s16b num, char **tokens, BIT_FLAGS mode);
+int16_t tokenize(char *buf, int16_t num, char **tokens, BIT_FLAGS mode);
index f54be82..d922502 100644 (file)
@@ -247,7 +247,7 @@ void do_cmd_knowledge_kill_count(player_type *creature_ptr)
     fprintf(fff, "   Total: %lu creature%s killed.\n", (unsigned long int)total, (total == 1 ? "" : "s"));
 #endif
 
-    C_KILL(who, max_r_idx, s16b);
+    C_KILL(who, max_r_idx, int16_t);
     angband_fclose(fff);
     (void)show_file(creature_ptr, true, file_name, _("倒した敵の数", "Kill Count"), 0, 0);
     fd_kill(file_name);
@@ -256,7 +256,7 @@ void do_cmd_knowledge_kill_count(player_type *creature_ptr)
 /*
  * Display the monsters in a group.
  */
-static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], int mon_cur, int mon_top, bool visual_only)
+static void display_monster_list(int col, int row, int per_page, int16_t mon_idx[], int mon_cur, int mon_top, bool visual_only)
 {
     int i;
     for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++) {
index 7cb2544..fc4cac8 100644 (file)
@@ -160,7 +160,7 @@ void do_cmd_knowledge_uniques(player_type *creature_ptr, bool is_alive)
 
     ang_sort(creature_ptr, unique_list_ptr->who, &unique_list_ptr->why, unique_list_ptr->n, ang_sort_comp_hook, ang_sort_swap_hook);
     display_uniques(unique_list_ptr, fff);
-    C_KILL(unique_list_ptr->who, max_r_idx, s16b);
+    C_KILL(unique_list_ptr->who, max_r_idx, int16_t);
     angband_fclose(fff);
     concptr title_desc
         = unique_list_ptr->is_alive ? _("まだ生きているユニーク・モンスター", "Alive Uniques") : _("もう撃破したユニーク・モンスター", "Dead Uniques");
index d340d79..8657f52 100644 (file)
@@ -41,7 +41,7 @@ void load_quick_start(void)
         rd_s16b(&previous_char.stat_max_max[i]);
 
     for (int i = 0; i < PY_MAX_LEVEL; i++) {
-        s16b tmp16s;
+        int16_t tmp16s;
         rd_s16b(&tmp16s);
         previous_char.player_hp[i] = (HIT_POINT)tmp16s;
     }
index 7c248d8..9d1545b 100644 (file)
  */
 void rd_dummy1(void)
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     for (int i = 0; i < tmp16s; i++) {
-        s16b tmp16s2;
+        int16_t tmp16s2;
         rd_s16b(&tmp16s2);
     }
 }
@@ -45,7 +45,7 @@ void rd_dummy_monsters(player_type *creature_ptr)
     if (h_older_than(1, 5, 0, 2))
         return;
 
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     for (int i = 0; i < tmp16s; i++) {
         monster_type dummy_mon;
index cf26c3e..8ba0322 100644 (file)
@@ -51,9 +51,9 @@ static errr rd_dungeon(player_type *player_ptr)
 
             rd_s16b(&sf_ptr->floor_id);
             rd_byte(&tmp8u);
-            sf_ptr->savefile_id = (s16b)tmp8u;
+            sf_ptr->savefile_id = (int16_t)tmp8u;
 
-            s16b tmp16s;
+            int16_t tmp16s;
             rd_s16b(&tmp16s);
             sf_ptr->dun_level = (DEPTH)tmp16s;
 
index 321eaac..c1420c1 100644 (file)
@@ -51,12 +51,12 @@ errr rd_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr)
     player_ptr->x = player_ptr->y = 0;
 
     if (!sf_ptr) {
-        s16b tmp16s;
+        int16_t tmp16s;
         rd_s16b(&tmp16s);
         floor_ptr->dun_level = (DEPTH)tmp16s;
         floor_ptr->base_level = floor_ptr->dun_level;
     } else {
-        s16b tmp16s;
+        int16_t tmp16s;
         rd_s16b(&tmp16s);
         if (tmp16s != sf_ptr->floor_id)
             return 171;
@@ -90,7 +90,7 @@ errr rd_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr)
             return 171;
     }
 
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     floor_ptr->base_level = (DEPTH)tmp16s;
     rd_s16b(&tmp16s);
@@ -121,9 +121,9 @@ errr rd_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr)
         if (h_older_than(1, 7, 0, 2)) {
             byte tmp8u;
             rd_byte(&tmp8u);
-            ct_ptr->feat = (s16b)tmp8u;
+            ct_ptr->feat = (int16_t)tmp8u;
             rd_byte(&tmp8u);
-            ct_ptr->mimic = (s16b)tmp8u;
+            ct_ptr->mimic = (int16_t)tmp8u;
         } else {
             rd_s16b(&ct_ptr->feat);
             rd_s16b(&ct_ptr->mimic);
index c36b7db..7a6772b 100644 (file)
@@ -58,7 +58,7 @@ void rd_item(player_type *player_ptr, object_type *o_ptr)
     } else
         o_ptr->number = 1;
 
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     o_ptr->weight = tmp16s;
 
index 6712291..c73a5b5 100644 (file)
@@ -73,7 +73,7 @@ void rd_u16b(u16b *ip)
  * @brief ロードファイルポインタから符号つき16bit値を読み込んでポインタに渡す
  * @param ip 読み込みポインタ
  */
-void rd_s16b(s16b *ip) { rd_u16b((u16b *)ip); }
+void rd_s16b(int16_t *ip) { rd_u16b((u16b *)ip); }
 
 /*!
  * @brief ロードファイルポインタから符号なし32bit値を読み込んでポインタに渡す
index 4404d7b..b5eb3b5 100644 (file)
@@ -13,7 +13,7 @@ void load_note(concptr msg);
 byte sf_get(void);
 void rd_byte(byte *ip);
 void rd_u16b(u16b *ip);
-void rd_s16b(s16b *ip);
+void rd_s16b(int16_t *ip);
 void rd_u32b(u32b *ip);
 void rd_s32b(s32b *ip);
 void rd_string(char *str, int max);
index 7a8a166..bcdc739 100644 (file)
@@ -90,7 +90,7 @@ void rd_item_old(player_type *player_ptr, object_type *o_ptr)
     rd_byte(&tmp8u);
     o_ptr->number = (ITEM_NUMBER)tmp8u;
 
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     o_ptr->weight = tmp16s;
 
@@ -272,7 +272,7 @@ void rd_item_old(player_type *player_ptr, object_type *o_ptr)
             else
                 o_ptr->xtra5 = damroll(r_info[o_ptr->pval].hdice, r_info[o_ptr->pval].hside);
             if (ironman_nightmare) {
-                o_ptr->xtra5 = (s16b)MIN(30000, o_ptr->xtra5 * 2L);
+                o_ptr->xtra5 = (int16_t)MIN(30000, o_ptr->xtra5 * 2L);
             }
             o_ptr->xtra4 = o_ptr->xtra5;
         }
@@ -372,7 +372,7 @@ void rd_monster_old(player_type *player_ptr, monster_type *m_ptr)
     m_ptr->fx = (POSITION)tmp8u;
     m_ptr->current_floor_ptr = player_ptr->current_floor_ptr;
 
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     m_ptr->hp = tmp16s;
     rd_s16b(&tmp16s);
@@ -396,7 +396,7 @@ void rd_monster_old(player_type *player_ptr, monster_type *m_ptr)
 
     if (h_older_than(0, 4, 2)) {
         rd_byte(&tmp8u);
-        m_ptr->energy_need = (s16b)tmp8u;
+        m_ptr->energy_need = (int16_t)tmp8u;
     } else
         rd_s16b(&m_ptr->energy_need);
 
@@ -408,17 +408,17 @@ void rd_monster_old(player_type *player_ptr, monster_type *m_ptr)
         m_ptr->mtimed[MTIMED_SLOW] = 0;
     } else {
         rd_byte(&tmp8u);
-        m_ptr->mtimed[MTIMED_FAST] = (s16b)tmp8u;
+        m_ptr->mtimed[MTIMED_FAST] = (int16_t)tmp8u;
         rd_byte(&tmp8u);
-        m_ptr->mtimed[MTIMED_SLOW] = (s16b)tmp8u;
+        m_ptr->mtimed[MTIMED_SLOW] = (int16_t)tmp8u;
     }
 
     rd_byte(&tmp8u);
-    m_ptr->mtimed[MTIMED_STUNNED] = (s16b)tmp8u;
+    m_ptr->mtimed[MTIMED_STUNNED] = (int16_t)tmp8u;
     rd_byte(&tmp8u);
-    m_ptr->mtimed[MTIMED_CONFUSED] = (s16b)tmp8u;
+    m_ptr->mtimed[MTIMED_CONFUSED] = (int16_t)tmp8u;
     rd_byte(&tmp8u);
-    m_ptr->mtimed[MTIMED_MONFEAR] = (s16b)tmp8u;
+    m_ptr->mtimed[MTIMED_MONFEAR] = (int16_t)tmp8u;
 
     if (h_older_than(0, 0, 10)) {
         reset_target(m_ptr);
@@ -433,7 +433,7 @@ void rd_monster_old(player_type *player_ptr, monster_type *m_ptr)
     }
 
     rd_byte(&tmp8u);
-    m_ptr->mtimed[MTIMED_INVULNER] = (s16b)tmp8u;
+    m_ptr->mtimed[MTIMED_INVULNER] = (int16_t)tmp8u;
 
     u32b tmp32u;
     rd_u32b(&tmp32u);
@@ -554,7 +554,7 @@ void set_old_lore(monster_race *r_ptr, BIT_FLAGS f4, const MONRACE_IDX r_idx)
  */
 errr rd_dungeon_old(player_type *player_ptr)
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     floor_type *floor_ptr = player_ptr->current_floor_ptr;
     floor_ptr->dun_level = (DEPTH)tmp16s;
@@ -623,7 +623,7 @@ errr rd_dungeon_old(player_type *player_ptr)
         for (int i = count; i > 0; i--) {
             grid_type *g_ptr;
             g_ptr = &floor_ptr->grid_array[y][x];
-            g_ptr->feat = (s16b)tmp8u;
+            g_ptr->feat = (int16_t)tmp8u;
             if (++x >= xmax) {
                 x = 0;
                 if (++y >= ymax)
@@ -640,7 +640,7 @@ errr rd_dungeon_old(player_type *player_ptr)
         for (int i = count; i > 0; i--) {
             grid_type *g_ptr;
             g_ptr = &floor_ptr->grid_array[y][x];
-            g_ptr->mimic = (s16b)tmp8u;
+            g_ptr->mimic = (int16_t)tmp8u;
             if (++x >= xmax) {
                 x = 0;
                 if (++y >= ymax)
index 264565a..999271a 100644 (file)
@@ -8,7 +8,7 @@
 
 void set_hp_old(player_type *creature_ptr)
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     creature_ptr->mhp = tmp16s;
 
@@ -22,7 +22,7 @@ void set_hp_old(player_type *creature_ptr)
 
 void set_mana_old(player_type *creature_ptr)
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     creature_ptr->msp = tmp16s;
 
index 5c4e8af..89b7c8c 100644 (file)
@@ -145,7 +145,7 @@ void set_zangband_reflection(player_type *creature_ptr)
 
 void rd_zangband_dungeon()
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     max_dlv[DUNGEON_ANGBAND] = tmp16s;
 }
@@ -160,7 +160,7 @@ void set_zangband_game_turns(player_type *creature_ptr)
 
 void set_zangband_gambling_monsters(int i)
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     mon_odds[i] = tmp16s;
 }
index 66d51dc..d450692 100644 (file)
@@ -129,7 +129,7 @@ static errr load_hp(player_type *creature_ptr)
     }
 
     for (int i = 0; i < tmp16u; i++) {
-        s16b tmp16s;
+        int16_t tmp16s;
         rd_s16b(&tmp16s);
         creature_ptr->player_hp[i] = (HIT_POINT)tmp16s;
     }
index 790d533..54749f7 100644 (file)
@@ -13,7 +13,7 @@
  */
 void rd_lore(monster_race *r_ptr, MONRACE_IDX r_idx)
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     r_ptr->r_sights = (MONSTER_NUMBER)tmp16s;
 
index 944bf74..852250b 100644 (file)
@@ -28,7 +28,7 @@ void rd_monster(player_type *player_ptr, monster_type *m_ptr)
     rd_byte(&tmp8u);
     m_ptr->fx = (POSITION)tmp8u;
 
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     m_ptr->hp = (HIT_POINT)tmp16s;
     rd_s16b(&tmp16s);
@@ -64,31 +64,31 @@ void rd_monster(player_type *player_ptr, monster_type *m_ptr)
 
     if (flags & SAVE_MON_FAST) {
         rd_byte(&tmp8u);
-        m_ptr->mtimed[MTIMED_FAST] = (s16b)tmp8u;
+        m_ptr->mtimed[MTIMED_FAST] = (int16_t)tmp8u;
     } else
         m_ptr->mtimed[MTIMED_FAST] = 0;
 
     if (flags & SAVE_MON_SLOW) {
         rd_byte(&tmp8u);
-        m_ptr->mtimed[MTIMED_SLOW] = (s16b)tmp8u;
+        m_ptr->mtimed[MTIMED_SLOW] = (int16_t)tmp8u;
     } else
         m_ptr->mtimed[MTIMED_SLOW] = 0;
 
     if (flags & SAVE_MON_STUNNED) {
         rd_byte(&tmp8u);
-        m_ptr->mtimed[MTIMED_STUNNED] = (s16b)tmp8u;
+        m_ptr->mtimed[MTIMED_STUNNED] = (int16_t)tmp8u;
     } else
         m_ptr->mtimed[MTIMED_STUNNED] = 0;
 
     if (flags & SAVE_MON_CONFUSED) {
         rd_byte(&tmp8u);
-        m_ptr->mtimed[MTIMED_CONFUSED] = (s16b)tmp8u;
+        m_ptr->mtimed[MTIMED_CONFUSED] = (int16_t)tmp8u;
     } else
         m_ptr->mtimed[MTIMED_CONFUSED] = 0;
 
     if (flags & SAVE_MON_MONFEAR) {
         rd_byte(&tmp8u);
-        m_ptr->mtimed[MTIMED_MONFEAR] = (s16b)tmp8u;
+        m_ptr->mtimed[MTIMED_MONFEAR] = (int16_t)tmp8u;
     } else
         m_ptr->mtimed[MTIMED_MONFEAR] = 0;
 
@@ -106,7 +106,7 @@ void rd_monster(player_type *player_ptr, monster_type *m_ptr)
 
     if (flags & SAVE_MON_INVULNER) {
         rd_byte(&tmp8u);
-        m_ptr->mtimed[MTIMED_INVULNER] = (s16b)tmp8u;
+        m_ptr->mtimed[MTIMED_INVULNER] = (int16_t)tmp8u;
     } else
         m_ptr->mtimed[MTIMED_INVULNER] = 0;
 
index 89cdb70..52dae5f 100644 (file)
@@ -207,7 +207,7 @@ static void set_imitation(player_type *creature_ptr)
     }
 
     if (h_older_than(0, 2, 3)) {
-        s16b tmp16s;
+        int16_t tmp16s;
         const int OLD_MAX_MANE = 22;
         for (int i = 0; i < OLD_MAX_MANE; i++) {
             rd_s16b(&tmp16s);
@@ -225,7 +225,7 @@ static void set_imitation(player_type *creature_ptr)
     }
 
     for (int i = 0; i < MAX_MANE; i++) {
-        s16b tmp16s;
+        int16_t tmp16s;
         rd_s16b(&tmp16s);
         creature_ptr->mane_spell[i] = static_cast<RF_ABILITY>(tmp16s);
         rd_s16b(&tmp16s);
@@ -237,7 +237,7 @@ static void set_imitation(player_type *creature_ptr)
 
 static void rd_phase_out(player_type *creature_ptr)
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     creature_ptr->current_floor_ptr->inside_arena = (bool)tmp16s;
     rd_s16b(&creature_ptr->current_floor_ptr->inside_quest);
@@ -267,7 +267,7 @@ static void rd_arena(player_type *creature_ptr)
     rd_byte(&creature_ptr->exit_bldg);
     rd_byte(&tmp8u);
 
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     creature_ptr->oldpx = (POSITION)tmp16s;
     rd_s16b(&tmp16s);
index 0f6f896..83a050b 100644 (file)
@@ -71,7 +71,7 @@ static bool check_quest_index(int loading_quest_index)
 static void load_quest_completion(quest_type *q_ptr)
 {
     rd_s16b(&q_ptr->status);
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     q_ptr->level = tmp16s;
 
@@ -91,7 +91,7 @@ static void load_quest_completion(quest_type *q_ptr)
 
 static void load_quest_details(player_type *creature_ptr, quest_type *q_ptr, int loading_quest_index)
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     rd_s16b(&tmp16s);
     q_ptr->cur_num = (MONSTER_NUMBER)tmp16s;
     rd_s16b(&tmp16s);
index 3f339bd..cad911c 100644 (file)
@@ -76,7 +76,7 @@ static errr rd_store(player_type *player_ptr, int town_number, int store_number)
 
     byte owner_idx;
     byte tmp8u;
-    s16b inven_num;
+    int16_t inven_num;
     rd_s32b(&store_ptr->store_open);
     rd_s16b(&store_ptr->insult_cur);
     rd_byte(&owner_idx);
index 1300447..00a1b1b 100644 (file)
@@ -15,7 +15,7 @@ static void rd_hengband_dungeons(void)
 {
     byte max = (byte)current_world_ptr->max_d_idx;
     rd_byte(&max);
-    s16b tmp16s;
+    int16_t tmp16s;
     for (int i = 0; i < max; i++) {
         rd_s16b(&tmp16s);
         max_dlv[i] = tmp16s;
@@ -41,7 +41,7 @@ void rd_dungeons(player_type *creature_ptr)
  */
 void rd_alter_reality(player_type *creature_ptr)
 {
-    s16b tmp16s;
+    int16_t tmp16s;
     if (h_older_than(0, 3, 8))
         creature_ptr->recall_dungeon = DUNGEON_ANGBAND;
     else {
index 06cdcbc..3fa7f75 100644 (file)
@@ -22,9 +22,9 @@
  *
  * We save pointers to the tokens in "tokens", and return the number found.
  */
-s16b tokenize_whitespace(char *buf, s16b num, char **tokens)
+int16_t tokenize_whitespace(char *buf, int16_t num, char **tokens)
 {
-    s16b k = 0;
+    int16_t k = 0;
     char *s = buf;
 
     while (k < num) {
index b67d6ee..580e03b 100644 (file)
@@ -2,4 +2,4 @@
 
 #include "system/h-type.h"
 
-s16b tokenize_whitespace(char *buf, s16b num, char **tokens);
+int16_t tokenize_whitespace(char *buf, int16_t num, char **tokens);
index afdc380..d07ccc2 100644 (file)
@@ -273,10 +273,9 @@ struct infowin {
 
     long mask;
 
-    s16b ox, oy;
-
-    s16b x, y;
-    s16b w, h;
+    int16_t ox, oy;
+    int16_t x, y;
+    int16_t w, h;
     u16b b;
 
     byte byte1;
@@ -342,10 +341,10 @@ struct infofnt {
 #endif
     concptr name;
 
-    s16b wid;
-    s16b twid;
-    s16b hgt;
-    s16b asc;
+    int16_t wid;
+    int16_t twid;
+    int16_t hgt;
+    int16_t asc;
 
     byte off;
 
index deebab5..d51b000 100644 (file)
@@ -58,7 +58,7 @@ errr init_other(player_type *player_ptr)
     C_MAKE(floor_ptr->o_list, current_world_ptr->max_o_idx, object_type);
     C_MAKE(floor_ptr->m_list, current_world_ptr->max_m_idx, monster_type);
     for (int i = 0; i < MAX_MTIMED; i++)
-        C_MAKE(floor_ptr->mproc_list[i], current_world_ptr->max_m_idx, s16b);
+        C_MAKE(floor_ptr->mproc_list[i], current_world_ptr->max_m_idx, int16_t);
 
     C_MAKE(max_dlv, current_world_ptr->max_d_idx, DEPTH);
     for (int i = 0; i < MAX_HGT; i++)
@@ -106,11 +106,11 @@ errr init_other(player_type *player_ptr)
  */
 errr init_object_alloc(void)
 {
-    s16b aux[MAX_DEPTH];
-    (void)C_WIPE(aux, MAX_DEPTH, s16b);
+    int16_t aux[MAX_DEPTH];
+    (void)C_WIPE(aux, MAX_DEPTH, int16_t);
 
-    s16b num[MAX_DEPTH];
-    (void)C_WIPE(num, MAX_DEPTH, s16b);
+    int16_t num[MAX_DEPTH];
+    (void)C_WIPE(num, MAX_DEPTH, int16_t);
 
     if (alloc_kind_table)
         C_KILL(alloc_kind_table, alloc_kind_size, alloc_entry);
index 6e736be..e54915a 100644 (file)
@@ -55,7 +55,7 @@
 byte gamma_table[256];
 
 /* Table of ln(x/256) * 256 for x going from 0 -> 255 */
-static s16b gamma_helper[256] =
+static int16_t gamma_helper[256] =
 {
 0,-1420,-1242,-1138,-1065,-1007,-961,-921,-887,-857,-830,-806,-783,-762,-744,-726,
 -710,-694,-679,-666,-652,-640,-628,-617,-606,-596,-586,-576,-567,-577,-549,-541,
index c5a9701..54cfb26 100644 (file)
@@ -343,7 +343,7 @@ bool monster_arena_comm(player_type *player_ptr)
 
     /*
      * Use get_string() because we may need more than
-     * the s16b value returned by get_quantity().
+     * the int16_t value returned by get_quantity().
      */
     if (!get_string(tmp_str, out_val, 32)) {
         screen_load();
index 3766540..014d1da 100644 (file)
@@ -70,7 +70,7 @@ static HIT_POINT calc_slaydam(HIT_POINT dam, int mult, int div, bool force)
  * @return ダメージ期待値
  */
 static u32b calc_expect_dice(
-    player_type *owner_ptr, u32b dam, int mult, int div, bool force, WEIGHT weight, int plus, s16b meichuu, bool dokubari, bool impact, int vorpal_mult, int vorpal_div)
+    player_type *owner_ptr, u32b dam, int mult, int div, bool force, WEIGHT weight, int plus, int16_t meichuu, bool dokubari, bool impact, int vorpal_mult, int vorpal_div)
 {
     dam = calc_slaydam(dam, mult, div, force);
     dam = calc_expect_crit(owner_ptr, weight, plus, dam, meichuu, dokubari, impact);
index e7f38f3..cb01ded 100644 (file)
@@ -53,7 +53,7 @@ bool gamble_comm(player_type *player_ptr, int cmd)
 
     /*
      * Use get_string() because we may need more than
-     * the s16b value returned by get_quantity().
+     * the int16_t value returned by get_quantity().
      */
     if (!get_string(tmp_str, out_val, 32)) {
         msg_print(NULL);
index 349bbd6..5291ba8 100644 (file)
@@ -127,7 +127,7 @@ bool create_ammo(player_type *creature_ptr)
         object_known(q_ptr);
         apply_magic_to_object(creature_ptr, q_ptr, creature_ptr->lev, AM_NO_FIXED_ART);
         q_ptr->discount = 99;
-        s16b slot = store_item_to_inventory(creature_ptr, q_ptr);
+        int16_t slot = store_item_to_inventory(creature_ptr, q_ptr);
         GAME_TEXT o_name[MAX_NLEN];
         describe_flavor(creature_ptr, o_name, q_ptr, 0);
         msg_format(_("%sを作った。", "You make some ammo."), o_name);
@@ -159,7 +159,7 @@ bool create_ammo(player_type *creature_ptr)
         describe_flavor(creature_ptr, o_name, q_ptr, 0);
         msg_format(_("%sを作った。", "You make some ammo."), o_name);
         vary_item(creature_ptr, item, -1);
-        s16b slot = store_item_to_inventory(creature_ptr, q_ptr);
+        int16_t slot = store_item_to_inventory(creature_ptr, q_ptr);
         if (slot >= 0)
             autopick_alter_item(creature_ptr, slot, false);
 
@@ -186,7 +186,7 @@ bool create_ammo(player_type *creature_ptr)
         describe_flavor(creature_ptr, o_name, q_ptr, 0);
         msg_format(_("%sを作った。", "You make some ammo."), o_name);
         vary_item(creature_ptr, item, -1);
-        s16b slot = store_item_to_inventory(creature_ptr, q_ptr);
+        int16_t slot = store_item_to_inventory(creature_ptr, q_ptr);
         if (slot >= 0)
             autopick_alter_item(creature_ptr, slot, false);
 
index 5f2ec52..d71c72b 100644 (file)
@@ -182,7 +182,7 @@ void process_eat_lite(player_type *target_ptr, monap_type *monap_ptr)
     if ((monap_ptr->o_ptr->xtra4 <= 0) || object_is_fixed_artifact(monap_ptr->o_ptr))
         return;
 
-    monap_ptr->o_ptr->xtra4 -= (s16b)(250 + randint1(250));
+    monap_ptr->o_ptr->xtra4 -= (int16_t)(250 + randint1(250));
     if (monap_ptr->o_ptr->xtra4 < 1)
         monap_ptr->o_ptr->xtra4 = 1;
 
index 6fa1e50..4f04b57 100644 (file)
@@ -207,7 +207,7 @@ static bool decide_pet_movement_direction(MonsterSweepGrid *msd)
     }
 
     (void)msd->get_movable_grid();
-    msd->target_ptr->pet_follow_distance = (s16b)dis;
+    msd->target_ptr->pet_follow_distance = (int16_t)dis;
     return true;
 }
 
index 2194cdc..f7799da 100644 (file)
@@ -360,9 +360,9 @@ bool place_monster_one(player_type *player_ptr, MONSTER_IDX who, POSITION y, POS
         (void)set_monster_fast(player_ptr, g_ptr->m_idx, 100);
 
     if (!ironman_nightmare) {
-        m_ptr->energy_need = ENERGY_NEED() - (s16b)randint0(100);
+        m_ptr->energy_need = ENERGY_NEED() - (int16_t)randint0(100);
     } else {
-        m_ptr->energy_need = ENERGY_NEED() - (s16b)randint0(100) * 2;
+        m_ptr->energy_need = ENERGY_NEED() - (int16_t)randint0(100) * 2;
     }
 
     if (any_bits(r_ptr->flags1, RF1_PREVENT_SUDDEN_MAGIC) && !ironman_nightmare) {
index 29b69c9..edc0d26 100644 (file)
@@ -112,7 +112,7 @@ bool set_monster_csleep(player_type *target_ptr, MONSTER_IDX m_idx, int v)
         }
     }
 
-    m_ptr->mtimed[MTIMED_CSLEEP] = (s16b)v;
+    m_ptr->mtimed[MTIMED_CSLEEP] = (int16_t)v;
     if (!notice)
         return false;
 
@@ -156,7 +156,7 @@ bool set_monster_fast(player_type *target_ptr, MONSTER_IDX m_idx, int v)
         }
     }
 
-    m_ptr->mtimed[MTIMED_FAST] = (s16b)v;
+    m_ptr->mtimed[MTIMED_FAST] = (int16_t)v;
     if (!notice)
         return false;
 
@@ -187,7 +187,7 @@ bool set_monster_slow(player_type *target_ptr, MONSTER_IDX m_idx, int v)
         }
     }
 
-    m_ptr->mtimed[MTIMED_SLOW] = (s16b)v;
+    m_ptr->mtimed[MTIMED_SLOW] = (int16_t)v;
     if (!notice)
         return false;
 
@@ -223,7 +223,7 @@ bool set_monster_stunned(player_type *target_ptr, MONSTER_IDX m_idx, int v)
         }
     }
 
-    m_ptr->mtimed[MTIMED_STUNNED] = (s16b)v;
+    m_ptr->mtimed[MTIMED_STUNNED] = (int16_t)v;
     return notice;
 }
 
@@ -253,7 +253,7 @@ bool set_monster_confused(player_type *target_ptr, MONSTER_IDX m_idx, int v)
         }
     }
 
-    m_ptr->mtimed[MTIMED_CONFUSED] = (s16b)v;
+    m_ptr->mtimed[MTIMED_CONFUSED] = (int16_t)v;
     return notice;
 }
 
@@ -283,7 +283,7 @@ bool set_monster_monfear(player_type *target_ptr, MONSTER_IDX m_idx, int v)
         }
     }
 
-    m_ptr->mtimed[MTIMED_MONFEAR] = (s16b)v;
+    m_ptr->mtimed[MTIMED_MONFEAR] = (int16_t)v;
 
     if (!notice)
         return false;
@@ -328,7 +328,7 @@ bool set_monster_invulner(player_type *target_ptr, MONSTER_IDX m_idx, int v, boo
         }
     }
 
-    m_ptr->mtimed[MTIMED_INVULNER] = (s16b)v;
+    m_ptr->mtimed[MTIMED_INVULNER] = (int16_t)v;
     if (!notice)
         return false;
 
index e0dfd7f..7e95dd0 100644 (file)
@@ -101,7 +101,7 @@ HIT_POINT mon_damage_mod(player_type *target_ptr, monster_type *m_ptr, HIT_POINT
  */
 int get_mproc_idx(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
 {
-    s16b *cur_mproc_list = floor_ptr->mproc_list[mproc_type];
+    int16_t *cur_mproc_list = floor_ptr->mproc_list[mproc_type];
     for (int i = floor_ptr->mproc_max[mproc_type] - 1; i >= 0; i--) {
         if (cur_mproc_list[i] == m_idx) {
             return i;
@@ -120,7 +120,7 @@ int get_mproc_idx(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
 void mproc_add(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
 {
     if (floor_ptr->mproc_max[mproc_type] < current_world_ptr->max_m_idx) {
-        floor_ptr->mproc_list[mproc_type][floor_ptr->mproc_max[mproc_type]++] = (s16b)m_idx;
+        floor_ptr->mproc_list[mproc_type][floor_ptr->mproc_max[mproc_type]++] = (int16_t)m_idx;
     }
 }
 
index f43ab10..20f1dbc 100644 (file)
@@ -204,7 +204,7 @@ char index_to_label(int i) { return (i < INVEN_MAIN_HAND) ? (I2A(i)) : (I2A(i -
  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
  * @return 対応する装備部位ID
  */
-s16b wield_slot(player_type *owner_ptr, object_type *o_ptr)
+int16_t wield_slot(player_type *owner_ptr, object_type *o_ptr)
 {
     switch (o_ptr->tval) {
     case TV_DIGGING:
index d6464a4..873ca13 100644 (file)
@@ -9,7 +9,7 @@ typedef struct object_type object_type;
 typedef struct player_type player_type;
 concptr activation_explanation(player_type *owner_ptr, object_type *o_ptr);
 char index_to_label(int i);
-s16b wield_slot(player_type *owner_ptr, object_type *o_ptr);
+int16_t wield_slot(player_type *owner_ptr, object_type *o_ptr);
 bool check_book_realm(player_type *owner_ptr, const tval_type book_tval, const OBJECT_SUBTYPE_VALUE book_sval);
 object_type *ref_item(player_type *owner_ptr, INVENTORY_IDX item);
 TERM_COLOR object_attr(object_type *o_ptr);
index 7b2aad3..772f43d 100644 (file)
@@ -27,9 +27,9 @@ void PlayerCharisma::set_locals()
  * * 型による魅力修正値
  * * 降鬼陣で加算(+5)
  */
-s16b PlayerCharisma::battleform_value()
+int16_t PlayerCharisma::battleform_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (any_bits(this->owner_ptr->special_defense, KATA_KOUKIJIN)) {
         result += 5;
@@ -49,9 +49,9 @@ s16b PlayerCharisma::battleform_value()
  * * 変異MUT3_WART_SKINで減算(-2)
  * * 変異MUT3_SCALESで減算(-1)
  */
-s16b PlayerCharisma::mutation_value()
+int16_t PlayerCharisma::mutation_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (this->owner_ptr->muta.any()) {
         if (this->owner_ptr->muta.has(MUTA::FLESH_ROT)) {
@@ -74,9 +74,9 @@ s16b PlayerCharisma::mutation_value()
     return result;
 }
 
-s16b PlayerCharisma::set_exception_value(s16b value)
+int16_t PlayerCharisma::set_exception_value(int16_t value)
 {
-    s16b result = value;
+    int16_t result = value;
 
     if (this->owner_ptr->muta.has(MUTA::ILL_NORM)) {
         result = 0;
@@ -115,7 +115,7 @@ BIT_FLAGS PlayerCharisma::get_bad_flags()
  * * MUT3_ILL_NORMを保持しているときの例外処理。
  * * 魅力現在値をレベル依存の値に修正する。
  */
-s16b PlayerCharisma::set_exception_use_status(s16b value)
+int16_t PlayerCharisma::set_exception_use_status(int16_t value)
 {
     if (this->owner_ptr->muta.has(MUTA::ILL_NORM)) {
         /* 10 to 18/90 charisma, guaranteed, based on level */
index 5f8e573..d154db2 100644 (file)
@@ -11,8 +11,8 @@ public:
 
 protected:
     void set_locals() override;
-    s16b battleform_value() override;
-    s16b mutation_value() override;
-    s16b set_exception_value(s16b value) override;
-    s16b set_exception_use_status(s16b value) override;
+    int16_t battleform_value() override;
+    int16_t mutation_value() override;
+    int16_t set_exception_value(int16_t value) override;
+    int16_t set_exception_use_status(int16_t value) override;
 };
index a3ccf65..b0b3cdc 100644 (file)
@@ -27,9 +27,9 @@ void PlayerConstitution::set_locals()
  * * 種族による耐久力修正値。
  * * エントは別途レベル26,41,46到達ごとに加算(+1)
  */
-s16b PlayerConstitution::race_value()
+int16_t PlayerConstitution::race_value()
 {
-    s16b result = PlayerBasicStatistics::race_value();
+    int16_t result = PlayerBasicStatistics::race_value();
 
     if (is_specific_player_race(this->owner_ptr, player_race_type::ENT)) {
         if (this->owner_ptr->lev > 25)
@@ -50,9 +50,9 @@ s16b PlayerConstitution::race_value()
  * * 一時効果による耐久力修正値
  * * 呪術の肉体強化で加算(+4)
  */
-s16b PlayerConstitution::time_effect_value()
+int16_t PlayerConstitution::time_effect_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (this->owner_ptr->realm1 == REALM_HEX) {
         if (hex_spelling(this->owner_ptr, HEX_BUILDING)) {
@@ -74,9 +74,9 @@ s16b PlayerConstitution::time_effect_value()
  * * 朱雀の構えで減算(-2)
  * * ネオ・つよしスペシャル中で加算(+4)
  */
-s16b PlayerConstitution::battleform_value()
+int16_t PlayerConstitution::battleform_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (any_bits(this->owner_ptr->special_defense, KATA_KOUKIJIN)) {
         result += 5;
@@ -106,9 +106,9 @@ s16b PlayerConstitution::battleform_value()
  * * 変異MUT3_XTRA_FATで加算(+2)
  * * 変異MUT3_FLESH_ROTで減算(-2)
  */
-s16b PlayerConstitution::mutation_value()
+int16_t PlayerConstitution::mutation_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (this->owner_ptr->muta.any()) {
         if (this->owner_ptr->muta.has(MUTA::RESILIENT)) {
index 236f48e..07f1cac 100644 (file)
@@ -8,8 +8,8 @@ public:
 
 protected:
     void set_locals() override;
-    s16b race_value() override;
-    s16b time_effect_value() override;
-    s16b battleform_value() override;
-    s16b mutation_value() override;
+    int16_t race_value() override;
+    int16_t time_effect_value() override;
+    int16_t battleform_value() override;
+    int16_t mutation_value() override;
 };
index 2e2cd36..965968a 100644 (file)
@@ -27,9 +27,9 @@ void PlayerDexterity::set_locals()
  * * 種族による器用さ修正値。
  * * エントは別途レベル26,41,46到達ごとに減算(-1)
  */
-s16b PlayerDexterity::race_value()
+int16_t PlayerDexterity::race_value()
 {
-    s16b result = PlayerBasicStatistics::race_value();
+    int16_t result = PlayerBasicStatistics::race_value();
 
     if (is_specific_player_race(this->owner_ptr, player_race_type::ENT)) {
         if (this->owner_ptr->lev > 25)
@@ -50,9 +50,9 @@ s16b PlayerDexterity::race_value()
  * * 一時効果による器用さ修正値
  * * 呪術の肉体強化で加算(+4)
  */
-s16b PlayerDexterity::time_effect_value()
+int16_t PlayerDexterity::time_effect_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (this->owner_ptr->realm1 == REALM_HEX) {
         if (hex_spelling(this->owner_ptr, HEX_BUILDING)) {
@@ -73,9 +73,9 @@ s16b PlayerDexterity::time_effect_value()
  * * 玄武の構えで減算(-2)
  * * 朱雀の構えで加算(+2)
  */
-s16b PlayerDexterity::battleform_value()
+int16_t PlayerDexterity::battleform_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (any_bits(this->owner_ptr->special_defense, KATA_KOUKIJIN)) {
         result += 5;
@@ -101,9 +101,9 @@ s16b PlayerDexterity::battleform_value()
  * * 変異MUT3_LIMBERで加算(+3)
  * * 変異MUT3_ARTHRITISで減算(-3)
  */
-s16b PlayerDexterity::mutation_value()
+int16_t PlayerDexterity::mutation_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (this->owner_ptr->muta.has(MUTA::IRON_SKIN)) {
         result -= 1;
index 97d1309..eba81bb 100644 (file)
@@ -8,8 +8,8 @@ public:
 
 protected:
     void set_locals() override;
-    s16b race_value() override;
-    s16b time_effect_value() override;
-    s16b battleform_value() override;
-    s16b mutation_value() override;
+    int16_t race_value() override;
+    int16_t time_effect_value() override;
+    int16_t battleform_value() override;
+    int16_t mutation_value() override;
 };
index c979e62..2159829 100644 (file)
@@ -29,9 +29,9 @@ void PlayerIntelligence::set_locals()
  * * 玄武の構えで減算(-1)
  * * 朱雀の構えで加算(+1)
  */
-s16b PlayerIntelligence::battleform_value()
+int16_t PlayerIntelligence::battleform_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (any_bits(this->owner_ptr->special_defense, KATA_KOUKIJIN)) {
         result += 5;
@@ -54,9 +54,9 @@ s16b PlayerIntelligence::battleform_value()
  * * 変異MUT3_HYPER_INTで加算(+4)
  * * 変異MUT3_MORONICで減算(-4)
  */
-s16b PlayerIntelligence::mutation_value()
+int16_t PlayerIntelligence::mutation_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
     if (this->owner_ptr->muta.any()) {
         if (this->owner_ptr->muta.has(MUTA::HYPER_INT)) {
             result += 4;
index d3b349e..f9b742c 100644 (file)
@@ -8,6 +8,6 @@ public:
 
 protected:
     void set_locals() override;
-    s16b battleform_value() override;
-    s16b mutation_value() override;
+    int16_t battleform_value() override;
+    int16_t mutation_value() override;
 };
index 918ba00..ce85eae 100644 (file)
@@ -27,9 +27,9 @@ void PlayerStrength::set_locals()
  * * 種族による腕力修正値。
  * * エントは別途レベル26,41,46到達ごとに加算(+1)
  */
-s16b PlayerStrength::race_value()
+int16_t PlayerStrength::race_value()
 {
-    s16b result = PlayerBasicStatistics::race_value();
+    int16_t result = PlayerBasicStatistics::race_value();
 
     if (is_specific_player_race(this->owner_ptr, player_race_type::ENT)) {
         if (this->owner_ptr->lev > 25)
@@ -52,9 +52,9 @@ s16b PlayerStrength::race_value()
  * * 呪術の肉体強化で加算(+4)
  * * ネオ・つよしスペシャル中で加算(+4)
  */
-s16b PlayerStrength::time_effect_value()
+int16_t PlayerStrength::time_effect_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (this->owner_ptr->realm1 == REALM_HEX) {
         if (hex_spelling(this->owner_ptr, HEX_XTRA_MIGHT)) {
@@ -81,9 +81,9 @@ s16b PlayerStrength::time_effect_value()
  * * 白虎の構えで加算(+2)
  * * 朱雀の構えで減算(-2)
  */
-s16b PlayerStrength::battleform_value()
+int16_t PlayerStrength::battleform_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (any_bits(this->owner_ptr->special_defense, KATA_KOUKIJIN)) {
         result += 5;
@@ -106,9 +106,9 @@ s16b PlayerStrength::battleform_value()
  * * 変異MUT3_HYPER_STRで加算(+4)
  * * 変異MUT3_PUNYで減算(-4)
  */
-s16b PlayerStrength::mutation_value()
+int16_t PlayerStrength::mutation_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (this->owner_ptr->muta.any()) {
         if (this->owner_ptr->muta.has(MUTA::HYPER_STR)) {
index f75d3f5..ea140e4 100644 (file)
@@ -8,8 +8,8 @@ public:
 
 protected:
     void set_locals() override;
-    s16b race_value() override;
-    s16b time_effect_value() override;
-    s16b battleform_value() override;
-    s16b mutation_value() override;
+    int16_t race_value() override;
+    int16_t time_effect_value() override;
+    int16_t battleform_value() override;
+    int16_t mutation_value() override;
 };
index 3cb0130..567bffc 100644 (file)
@@ -27,9 +27,9 @@ void PlayerWisdom::set_locals()
  * * 玄武の構えで減算(-1)
  * * 朱雀の構えで加算(+1)
  */
-s16b PlayerWisdom::battleform_value()
+int16_t PlayerWisdom::battleform_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (any_bits(this->owner_ptr->special_defense, KATA_KOUKIJIN)) {
         result += 5;
@@ -52,9 +52,9 @@ s16b PlayerWisdom::battleform_value()
  * * 変異MUT3_HYPER_INTで加算(+4)
  * * 変異MUT3_MORONICで減算(-4)
  */
-s16b PlayerWisdom::mutation_value()
+int16_t PlayerWisdom::mutation_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (this->owner_ptr->muta.any()) {
         if (this->owner_ptr->muta.has(MUTA::HYPER_INT)) {
index c685a85..3076218 100644 (file)
@@ -8,6 +8,6 @@ public:
 
 protected:
     void set_locals() override;
-    s16b battleform_value() override;
-    s16b mutation_value() override;
+    int16_t battleform_value() override;
+    int16_t mutation_value() override;
 };
index 463a92d..25eda46 100644 (file)
@@ -29,7 +29,7 @@ typedef struct grid_type grid_type;
 typedef struct monster_race monster_race;
 typedef struct monster_type monster_type;
 typedef struct player_attack_type {
-    s16b hand{}; //!< 武器の持ち手
+    int16_t hand{}; //!< 武器の持ち手
     grid_type *g_ptr; //!< ターゲットのいる地形情報
     MONSTER_IDX m_idx{}; //!< モンスターID
     monster_type *m_ptr{}; //!< モンスター情報(参照ポインタ)
index be22935..d3b7f31 100644 (file)
@@ -63,7 +63,7 @@
  * @brief プレイヤーの攻撃情報を初期化する(コンストラクタ以外の分)
  */
 static player_attack_type *initialize_player_attack_type(
-    player_attack_type *pa_ptr, player_type *attacker_ptr, POSITION y, POSITION x, s16b hand, combat_options mode, bool *fear, bool *mdeath)
+    player_attack_type *pa_ptr, player_type *attacker_ptr, POSITION y, POSITION x, int16_t hand, combat_options mode, bool *fear, bool *mdeath)
 {
     auto floor_ptr = attacker_ptr->current_floor_ptr;
     auto g_ptr = &floor_ptr->grid_array[y][x];
@@ -533,7 +533,7 @@ static void cause_earthquake(player_type *attacker_ptr, player_attack_type *pa_p
  * @details
  * If no "weapon" is available, then "punch" the monster one time.
  */
-void exe_player_attack_to_monster(player_type *attacker_ptr, POSITION y, POSITION x, bool *fear, bool *mdeath, s16b hand, combat_options mode)
+void exe_player_attack_to_monster(player_type *attacker_ptr, POSITION y, POSITION x, bool *fear, bool *mdeath, int16_t hand, combat_options mode)
 {
     bool do_quake = false;
     bool drain_msg = true;
index 6bdb46d..47c8331 100644 (file)
@@ -4,5 +4,5 @@
 #include "combat/combat-options-type.h"
 
 typedef struct player_type player_type;
-void exe_player_attack_to_monster(player_type *attacker_ptr, POSITION y, POSITION x, bool *fear, bool *mdeath, s16b hand, combat_options mode);
+void exe_player_attack_to_monster(player_type *attacker_ptr, POSITION y, POSITION x, bool *fear, bool *mdeath, int16_t hand, combat_options mode);
 void massacre(player_type *caster_ptr);
index d463195..bf975a8 100644 (file)
@@ -21,7 +21,7 @@
  * @details
  * * 各要素によるステータス修正値の合計
  */
-s16b PlayerBasicStatistics::modification_value()
+int16_t PlayerBasicStatistics::modification_value()
 {
     return PlayerStatusBase::get_value();
 }
@@ -30,7 +30,7 @@ s16b PlayerBasicStatistics::modification_value()
  * @brief 基礎ステータスの実値
  * @return status_typeに対応するステータスの実値を返す
  */
-s16b PlayerBasicStatistics::get_value()
+int16_t PlayerBasicStatistics::get_value()
 {
     this->set_locals();
     return this->owner_ptr->stat_index[(int)this->ability_type];
@@ -43,7 +43,7 @@ s16b PlayerBasicStatistics::get_value()
  * @details
  * * 種族によるステータス修正値。
  */
-s16b PlayerBasicStatistics::race_value()
+int16_t PlayerBasicStatistics::race_value()
 {
     const player_race *tmp_rp_ptr;
     if (this->owner_ptr->mimic_form)
@@ -61,7 +61,7 @@ s16b PlayerBasicStatistics::race_value()
  * @details
  * * 職業によるステータス修正値
  */
-s16b PlayerBasicStatistics::class_value()
+int16_t PlayerBasicStatistics::class_value()
 {
     const player_class *c_ptr = &class_info[this->owner_ptr->pclass];
     return c_ptr->c_adj[this->ability_type];
@@ -74,7 +74,7 @@ s16b PlayerBasicStatistics::class_value()
  * @details
  * * 性格によるステータス修正値
  */
-s16b PlayerBasicStatistics::personality_value()
+int16_t PlayerBasicStatistics::personality_value()
 {
     const player_personality *a_ptr = &personality_info[this->owner_ptr->pseikaku];
     return a_ptr->a_adj[this->ability_type];
@@ -105,7 +105,7 @@ void PlayerBasicStatistics::update_top_status()
     int top = modify_stat_value(this->owner_ptr->stat_max[status], this->owner_ptr->stat_add[status]);
 
     if (this->owner_ptr->stat_top[status] != top) {
-        this->owner_ptr->stat_top[status] = (s16b)top;
+        this->owner_ptr->stat_top[status] = (int16_t)top;
         set_bits(this->owner_ptr->redraw, PR_STATS);
         set_bits(this->owner_ptr->window_flags, PW_PLAYER);
     }
@@ -119,7 +119,7 @@ void PlayerBasicStatistics::update_top_status()
  * * owner_ptrのステータス現在値を更新する際の例外処理
  * * 派生クラスでoverrideして使用する。
  */
-s16b PlayerBasicStatistics::set_exception_use_status(s16b value)
+int16_t PlayerBasicStatistics::set_exception_use_status(int16_t value)
 {
     return value;
 }
@@ -133,12 +133,12 @@ s16b PlayerBasicStatistics::set_exception_use_status(s16b value)
 void PlayerBasicStatistics::update_use_status()
 {
     int status = (int)this->ability_type;
-    s16b use = modify_stat_value(this->owner_ptr->stat_cur[status], this->owner_ptr->stat_add[status]);
+    int16_t use = modify_stat_value(this->owner_ptr->stat_cur[status], this->owner_ptr->stat_add[status]);
 
     use = this->set_exception_use_status(use);
 
     if (this->owner_ptr->stat_use[status] != use) {
-        this->owner_ptr->stat_use[status] = (s16b)use;
+        this->owner_ptr->stat_use[status] = (int16_t)use;
         set_bits(this->owner_ptr->redraw, PR_STATS);
         set_bits(this->owner_ptr->window_flags, PW_PLAYER);
     }
@@ -165,7 +165,7 @@ void PlayerBasicStatistics::update_index_status()
     if (this->owner_ptr->stat_index[status] == index)
         return;
 
-    this->owner_ptr->stat_index[status] = (s16b)index;
+    this->owner_ptr->stat_index[status] = (int16_t)index;
     if (status == A_CON) {
         set_bits(this->owner_ptr->update, PU_HP);
     } else if (status == A_INT) {
index d83a561..6543012 100644 (file)
@@ -9,18 +9,18 @@ public:
     PlayerBasicStatistics() = delete;
 
     void update_value();
-    s16b modification_value();
-    s16b get_value() override;
+    int16_t modification_value();
+    int16_t get_value() override;
 
 protected:
     player_ability_type ability_type;
-    s16b race_value() override;
-    s16b class_value() override;
-    s16b personality_value() override;
+    int16_t race_value() override;
+    int16_t class_value() override;
+    int16_t personality_value() override;
     void update_top_status();
     void update_use_status();
     void update_index_status();
-    virtual s16b set_exception_use_status(s16b value);
+    virtual int16_t set_exception_use_status(int16_t value);
 };
 
 #include "player-ability/player-charisma.h"
index 53e6f5b..b53e2fb 100644 (file)
@@ -22,7 +22,7 @@ void PlayerInfravision::set_locals()
  * @details
  * * 種族による加算
  */
-s16b PlayerInfravision::race_value()
+int16_t PlayerInfravision::race_value()
 {
     const player_race *tmp_rp_ptr;
 
@@ -40,9 +40,9 @@ s16b PlayerInfravision::race_value()
  * @details
  * * 変異MUT3_INFRAVISによる加算(+3)
  */
-s16b PlayerInfravision::mutation_value()
+int16_t PlayerInfravision::mutation_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
     if (this->owner_ptr->muta.has(MUTA::INFRAVIS)) {
         result += 3;
     }
@@ -56,9 +56,9 @@ s16b PlayerInfravision::mutation_value()
  * @details
  * * 魔法効果tim_infraによる加算(+3)
  */
-s16b PlayerInfravision::time_effect_value()
+int16_t PlayerInfravision::time_effect_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
     if (this->owner_ptr->tim_infra) {
         result += 3;
     }
index 5bc2344..95637d2 100644 (file)
@@ -8,7 +8,7 @@ public:
 
 protected:
     void set_locals() override;
-    s16b race_value() override;
-    s16b time_effect_value() override;
-    s16b mutation_value() override;
+    int16_t race_value() override;
+    int16_t time_effect_value() override;
+    int16_t mutation_value() override;
 };
index f117fc9..33b09de 100644 (file)
@@ -53,9 +53,9 @@ void PlayerSpeed::set_locals()
  * ** マーフォークがFF_WATER地形にいれば加算(+2+レベル/10)
  * ** そうでなく浮遊を持っていないなら減算(-2)
  */
-s16b PlayerSpeed::race_value()
+int16_t PlayerSpeed::race_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (is_specific_player_race(this->owner_ptr, player_race_type::KLACKON) || is_specific_player_race(this->owner_ptr, player_race_type::SPRITE))
         result += (this->owner_ptr->lev) / 10;
@@ -95,7 +95,7 @@ s16b PlayerSpeed::race_value()
  * ** 錬気術師で装備が重くなくクラッコン、妖精、いかさま以外なら加算(+レベル/10)
  * ** 狂戦士なら加算(+3),レベル20/30/40/50ごとに+1
  */
-s16b PlayerSpeed::class_value()
+int16_t PlayerSpeed::class_value()
 {
     SPEED result = 0;
 
@@ -137,9 +137,9 @@ s16b PlayerSpeed::class_value()
  * @details
  * ** いかさまでクラッコン/妖精以外なら加算(+5+レベル/10)
  */
-s16b PlayerSpeed::personality_value()
+int16_t PlayerSpeed::personality_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
     if (this->owner_ptr->pseikaku == PERSONALITY_MUNCHKIN && this->owner_ptr->prace != player_race_type::KLACKON && this->owner_ptr->prace != player_race_type::SPRITE) {
         result += (this->owner_ptr->lev) / 10 + 5;
     }
@@ -153,9 +153,9 @@ s16b PlayerSpeed::personality_value()
  * ** 棘セット装備中ならば加算(+7)
  * ** アイシングデス-トゥインクル装備中ならば加算(+7)
  */
-s16b PlayerSpeed::special_weapon_set_value()
+int16_t PlayerSpeed::special_weapon_set_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
     if (has_melee_weapon(this->owner_ptr, INVEN_MAIN_HAND) && has_melee_weapon(this->owner_ptr, INVEN_SUB_HAND)) {
         if ((this->owner_ptr->inventory_list[INVEN_MAIN_HAND].name1 == ART_QUICKTHORN)
             && (this->owner_ptr->inventory_list[INVEN_SUB_HAND].name1 == ART_TINYTHORN)) {
@@ -177,9 +177,9 @@ s16b PlayerSpeed::special_weapon_set_value()
  * ** 装備品にTR_SPEEDがあれば加算(+pval+1
  * ** セットで加速増減があるものを計算
  */
-s16b PlayerSpeed::equipments_value()
+int16_t PlayerSpeed::equipments_value()
 {
-    s16b result = PlayerStatusBase::equipments_value();
+    int16_t result = PlayerStatusBase::equipments_value();
     result += this->special_weapon_set_value();
 
     return result;
@@ -195,9 +195,9 @@ s16b PlayerSpeed::equipments_value()
  * ** 食い過ぎなら減算(-10)
  * ** 光速移動中は+999(最終的に+99になる)
  */
-s16b PlayerSpeed::time_effect_value()
+int16_t PlayerSpeed::time_effect_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
 
     if (is_fast(this->owner_ptr)) {
         result += 10;
@@ -229,9 +229,9 @@ s16b PlayerSpeed::time_effect_value()
  * @details
  * ** 朱雀の構えなら加算(+10)
  */
-s16b PlayerSpeed::battleform_value()
+int16_t PlayerSpeed::battleform_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
     if (any_bits(this->owner_ptr->special_defense, KAMAE_SUZAKU))
         result += 10;
     return result;
@@ -245,7 +245,7 @@ s16b PlayerSpeed::battleform_value()
  * ** 変異MUT3_XTRA_LEGなら加算(+3)
  * ** 変異MUT3_SHORT_LEGなら減算(-3)
  */
-s16b PlayerSpeed::mutation_value()
+int16_t PlayerSpeed::mutation_value()
 {
     SPEED result = 0;
 
@@ -271,7 +271,7 @@ s16b PlayerSpeed::mutation_value()
  * @details
  * * 騎乗中ならばモンスターの加速に準拠、ただし騎乗技能値とモンスターレベルによるキャップ処理あり
  */
-s16b PlayerSpeed::riding_value()
+int16_t PlayerSpeed::riding_value()
 {
     monster_type *riding_m_ptr = &(this->owner_ptr)->current_floor_ptr->m_list[this->owner_ptr->riding];
     SPEED speed = riding_m_ptr->mspeed;
@@ -282,7 +282,7 @@ s16b PlayerSpeed::riding_value()
     }
 
     if (riding_m_ptr->mspeed > 110) {
-        result = (s16b)((speed - 110) * (this->owner_ptr->skill_exp[SKILL_RIDING] * 3 + this->owner_ptr->lev * 160L - 10000L) / (22000L));
+        result = (int16_t)((speed - 110) * (this->owner_ptr->skill_exp[SKILL_RIDING] * 3 + this->owner_ptr->lev * 160L - 10000L) / (22000L));
         if (result < 0)
             result = 0;
     } else {
@@ -305,7 +305,7 @@ s16b PlayerSpeed::riding_value()
  * @details
  * * 所持品の重量による減速処理。乗馬時は別計算。
  */
-s16b PlayerSpeed::inventory_weight_value()
+int16_t PlayerSpeed::inventory_weight_value()
 {
     SPEED result = 0;
 
@@ -339,7 +339,7 @@ s16b PlayerSpeed::inventory_weight_value()
  * @details
  * * 探索中なら減算(-10)
  */
-s16b PlayerSpeed::action_value()
+int16_t PlayerSpeed::action_value()
 {
     SPEED result = 0;
     if (this->owner_ptr->action == ACTION_SEARCH)
@@ -370,7 +370,7 @@ BIT_FLAGS PlayerSpeed::equipments_flags(tr_type check_flag)
  * * 非乗馬時 - ここまでの修正値合算をそのまま使用
  * * 乗馬時 - 乗馬の速度と重量減衰のみを計算
  */
-s16b PlayerSpeed::set_exception_value(s16b value)
+int16_t PlayerSpeed::set_exception_value(int16_t value)
 {
     if (this->owner_ptr->riding) {
         value = this->default_value;
index 1b813dc..71dcfee 100644 (file)
@@ -8,17 +8,17 @@ public:
 
 protected:
     void set_locals() override;
-    s16b race_value() override;
-    s16b class_value() override;
-    s16b personality_value() override;
-    s16b equipments_value() override;
-    s16b time_effect_value() override;
-    s16b battleform_value() override;
-    s16b mutation_value() override;
-    s16b riding_value() override;
-    s16b inventory_weight_value() override;
-    s16b action_value() override;
+    int16_t race_value() override;
+    int16_t class_value() override;
+    int16_t personality_value() override;
+    int16_t equipments_value() override;
+    int16_t time_effect_value() override;
+    int16_t battleform_value() override;
+    int16_t mutation_value() override;
+    int16_t riding_value() override;
+    int16_t inventory_weight_value() override;
+    int16_t action_value() override;
     BIT_FLAGS equipments_flags(tr_type check_flag) override;
-    s16b special_weapon_set_value();
-    s16b set_exception_value(s16b value) override;
+    int16_t special_weapon_set_value();
+    int16_t set_exception_value(int16_t value) override;
 };
index 8cae29d..b988974 100644 (file)
@@ -24,10 +24,10 @@ PlayerStatusBase::PlayerStatusBase(player_type *owner_ptr)
  * * 派生クラスからset_locals()をコールして初期値、上限、下限をセット。
  * * 各要素毎に計算した値を初期値に単純に加算し、上限と下限で丸める。
  */
-s16b PlayerStatusBase::get_value()
+int16_t PlayerStatusBase::get_value()
 {
     this->set_locals(); /* 計算前に値のセット。派生クラスの値がセットされる。*/
-    s16b pow = this->default_value;
+    int16_t pow = this->default_value;
 
     pow += this->action_value();
     pow += this->battleform_value();
@@ -231,10 +231,10 @@ BIT_FLAGS PlayerStatusBase::equipments_bad_flags(tr_type check_flag)
  * @brief this->tr_flagを持つ装備品のpval合計値を返す
  * @return 該当するfalgを持つ全装備のpvalの合計値
  */
-s16b PlayerStatusBase::equipments_value()
+int16_t PlayerStatusBase::equipments_value()
 {
     this->set_locals(); /* 計算前に値のセット。派生クラスの値がセットされる。*/
-    s16b result = 0;
+    int16_t result = 0;
     for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
         object_type *o_ptr = &owner_ptr->inventory_list[i];
         BIT_FLAGS flgs[TR_FLAG_SIZE];
@@ -248,43 +248,43 @@ s16b PlayerStatusBase::equipments_value()
     return result;
 }
 
-s16b PlayerStatusBase::race_value()
+int16_t PlayerStatusBase::race_value()
 {
     return 0;
 }
-s16b PlayerStatusBase::class_value()
+int16_t PlayerStatusBase::class_value()
 {
     return 0;
 }
-s16b PlayerStatusBase::class_base_value()
+int16_t PlayerStatusBase::class_base_value()
 {
     return 0;
 }
-s16b PlayerStatusBase::personality_value()
+int16_t PlayerStatusBase::personality_value()
 {
     return 0;
 }
-s16b PlayerStatusBase::time_effect_value()
+int16_t PlayerStatusBase::time_effect_value()
 {
     return 0;
 }
-s16b PlayerStatusBase::battleform_value()
+int16_t PlayerStatusBase::battleform_value()
 {
     return 0;
 }
-s16b PlayerStatusBase::mutation_value()
+int16_t PlayerStatusBase::mutation_value()
 {
     return 0;
 }
-s16b PlayerStatusBase::riding_value()
+int16_t PlayerStatusBase::riding_value()
 {
     return 0;
 }
-s16b PlayerStatusBase::inventory_weight_value()
+int16_t PlayerStatusBase::inventory_weight_value()
 {
     return 0;
 }
-s16b PlayerStatusBase::action_value()
+int16_t PlayerStatusBase::action_value()
 {
     return 0;
 }
@@ -296,7 +296,7 @@ s16b PlayerStatusBase::action_value()
  * * 派生クラスで必要とされる例外処理でoverrideされる
  * @return 直接変更された値。このままmin-max処理され最終的なvalueになる。
  */
-s16b PlayerStatusBase::set_exception_value(s16b value)
+int16_t PlayerStatusBase::set_exception_value(int16_t value)
 {
     return value;
 }
index 36bf9be..eaee4b7 100644 (file)
@@ -8,31 +8,31 @@ public:
     PlayerStatusBase(player_type *owner_ptr);
     PlayerStatusBase() = delete;
     virtual ~PlayerStatusBase() = default;
-    virtual s16b get_value();
+    virtual int16_t get_value();
     virtual BIT_FLAGS get_all_flags();
     virtual BIT_FLAGS get_good_flags();
     virtual BIT_FLAGS get_bad_flags();
 
 protected:
-    s16b default_value;
-    s16b min_value;
-    s16b max_value;
+    int16_t default_value;
+    int16_t min_value;
+    int16_t max_value;
     player_type *owner_ptr;
     tr_type tr_flag;
     tr_type tr_bad_flag;
     virtual void set_locals();
-    virtual s16b race_value();
-    virtual s16b class_value();
-    virtual s16b class_base_value();
-    virtual s16b personality_value();
-    virtual s16b equipments_value();
-    virtual s16b time_effect_value();
-    virtual s16b battleform_value();
-    virtual s16b mutation_value();
-    virtual s16b riding_value();
-    virtual s16b inventory_weight_value();
-    virtual s16b action_value();
-    virtual s16b set_exception_value(s16b value);
+    virtual int16_t race_value();
+    virtual int16_t class_value();
+    virtual int16_t class_base_value();
+    virtual int16_t personality_value();
+    virtual int16_t equipments_value();
+    virtual int16_t time_effect_value();
+    virtual int16_t battleform_value();
+    virtual int16_t mutation_value();
+    virtual int16_t riding_value();
+    virtual int16_t inventory_weight_value();
+    virtual int16_t action_value();
+    virtual int16_t set_exception_value(int16_t value);
     virtual BIT_FLAGS equipments_flags(tr_type check_flag);
     virtual BIT_FLAGS equipments_bad_flags(tr_type check_flag);
 };
index 57cefe6..c05f06e 100644 (file)
@@ -21,7 +21,7 @@
  * @details
  * * 種族による加算
  */
-s16b PlayerStealth::race_value()
+int16_t PlayerStealth::race_value()
 {
     const player_race *tmp_rp_ptr;
 
@@ -39,7 +39,7 @@ s16b PlayerStealth::race_value()
  * @details
  * * 性格による加算
  */
-s16b PlayerStealth::personality_value()
+int16_t PlayerStealth::personality_value()
 {
     const player_personality *a_ptr = &personality_info[this->owner_ptr->pseikaku];
     return a_ptr->a_stl;
@@ -51,7 +51,7 @@ s16b PlayerStealth::personality_value()
  * @details
  * * 職業による加算
  */
-s16b PlayerStealth::class_base_value()
+int16_t PlayerStealth::class_base_value()
 {
     const player_class *c_ptr = &class_info[this->owner_ptr->pclass];
     return c_ptr->c_stl + (c_ptr->x_stl * this->owner_ptr->lev / 10);
@@ -64,7 +64,7 @@ s16b PlayerStealth::class_base_value()
  * * 忍者がheavy_armorならば減算(-レベル/10)
  * * 忍者がheavy_armorでなく適正な武器を持っていれば加算(+レベル/10)
  */
-s16b PlayerStealth::class_value()
+int16_t PlayerStealth::class_value()
 {
     ACTION_SKILL_POWER result = 0;
 
@@ -87,9 +87,9 @@ s16b PlayerStealth::class_value()
  * * 変異MUT3_XTRA_NOISで減算(-3)
  * * 変異MUT3_MOTIONで加算(+1)
  */
-s16b PlayerStealth::mutation_value()
+int16_t PlayerStealth::mutation_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
     const auto &muta = this->owner_ptr->muta;
     if (muta.has(MUTA::XTRA_NOIS)) {
         result -= 3;
@@ -108,9 +108,9 @@ s16b PlayerStealth::mutation_value()
  * * 狂戦士化で減算(-7)
  * * 隠密の歌で加算(+999)
  */
-s16b PlayerStealth::time_effect_value()
+int16_t PlayerStealth::time_effect_value()
 {
-    s16b result = 0;
+    int16_t result = 0;
     if (this->owner_ptr->realm1 == REALM_HEX) {
         if (hex_spelling_any(this->owner_ptr))
             result -= (1 + casting_hex_num(this->owner_ptr));
@@ -135,7 +135,7 @@ bool PlayerStealth::is_aggravated_s_fairy()
  * @details
  * * セクシーギャルでない影フェアリーがTRC_AGGRAVATE持ちの時、別処理でTRC_AGGRAVATEを無効にする代わりに減算(-3か3未満なら(現在値+2)/2)
  */
-s16b PlayerStealth::set_exception_value(s16b value)
+int16_t PlayerStealth::set_exception_value(int16_t value)
 {
     if (this->is_aggravated_s_fairy()) {
         value = MIN(value - 3, (value + 2) / 2);
index e40ede7..2bc09f9 100644 (file)
@@ -10,12 +10,12 @@ public:
 
 protected:
     void set_locals() override;
-    s16b race_value() override;
-    s16b class_value() override;
-    s16b class_base_value() override;
-    s16b personality_value() override;
-    s16b time_effect_value() override;
-    s16b mutation_value() override;
-    s16b set_exception_value(s16b value) override;
+    int16_t race_value() override;
+    int16_t class_value() override;
+    int16_t class_base_value() override;
+    int16_t personality_value() override;
+    int16_t time_effect_value() override;
+    int16_t mutation_value() override;
+    int16_t set_exception_value(int16_t value) override;
     bool is_aggravated_s_fairy();
 };
index 6d6976e..0afd256 100644 (file)
@@ -49,28 +49,28 @@ struct player_class
 #ifdef JP
        concptr E_title;                /* 英語職業 */
 #endif
-       s16b c_adj[6];          /* Class stat modifier */
-
-       s16b c_dis;                     /* class disarming */
-       s16b c_dev;                     /* class magic devices */
-       s16b c_sav;                     /* class saving throws */
-       s16b c_stl;                     /* class stealth */
-       s16b c_srh;                     /* class searching ability */
-       s16b c_fos;                     /* class searching frequency */
-       s16b c_thn;                     /* class to hit (normal) */
-       s16b c_thb;                     /* class to hit (bows) */
-
-       s16b x_dis;                     /* extra disarming */
-       s16b x_dev;                     /* extra magic devices */
-       s16b x_sav;                     /* extra saving throws */
-       s16b x_stl;                     /* extra stealth */
-       s16b x_srh;                     /* extra searching ability */
-       s16b x_fos;                     /* extra searching frequency */
-       s16b x_thn;                     /* extra to hit (normal) */
-       s16b x_thb;                     /* extra to hit (bows) */
-
-       s16b c_mhp;                     /* Class hit-dice adjustment */
-       s16b c_exp;                     /* Class experience factor */
+       int16_t c_adj[6];               /* Class stat modifier */
+
+       int16_t c_dis;                  /* class disarming */
+       int16_t c_dev;                  /* class magic devices */
+       int16_t c_sav;                  /* class saving throws */
+       int16_t c_stl;                  /* class stealth */
+       int16_t c_srh;                  /* class searching ability */
+       int16_t c_fos;                  /* class searching frequency */
+       int16_t c_thn;                  /* class to hit (normal) */
+       int16_t c_thb;                  /* class to hit (bows) */
+
+       int16_t x_dis;                  /* extra disarming */
+       int16_t x_dev;                  /* extra magic devices */
+       int16_t x_sav;                  /* extra saving throws */
+       int16_t x_stl;                  /* extra stealth */
+       int16_t x_srh;                  /* extra searching ability */
+       int16_t x_fos;                  /* extra searching frequency */
+       int16_t x_thn;                  /* extra to hit (normal) */
+       int16_t x_thb;                  /* extra to hit (bows) */
+
+       int16_t c_mhp;                  /* Class hit-dice adjustment */
+       int16_t c_exp;                  /* Class experience factor */
 
        byte pet_upkeep_div; /* Pet upkeep divider */
 
index db0494f..874a963 100644 (file)
@@ -10,18 +10,18 @@ typedef struct player_personality {
        concptr E_title;                /* 英語性格 */
 #endif
 
-       s16b a_adj[6];          /* ersonality stat bonuses */
-
-       s16b a_dis;                     /* personality disarming */
-       s16b a_dev;                     /* personality magic devices */
-       s16b a_sav;                     /* personality saving throw */
-       s16b a_stl;                     /* personality stealth */
-       s16b a_srh;                     /* personality search ability */
-       s16b a_fos;                     /* personality search frequency */
-       s16b a_thn;                     /* personality combat (normal) */
-       s16b a_thb;                     /* personality combat (shooting) */
-
-       s16b a_mhp;                     /* Race hit-dice modifier */
+       int16_t a_adj[6];               /* ersonality stat bonuses */
+
+       int16_t a_dis;                  /* personality disarming */
+       int16_t a_dev;                  /* personality magic devices */
+       int16_t a_sav;                  /* personality saving throw */
+       int16_t a_stl;                  /* personality stealth */
+       int16_t a_srh;                  /* personality search ability */
+       int16_t a_fos;                  /* personality search frequency */
+       int16_t a_thn;                  /* personality combat (normal) */
+       int16_t a_thb;                  /* personality combat (shooting) */
+
+       int16_t a_mhp;                  /* Race hit-dice modifier */
 
        byte no;                        /* の */
        byte sex;                       /* seibetu seigen */
index 83ab2d0..dcc7fa7 100644 (file)
@@ -74,16 +74,16 @@ struct player_race {
     concptr E_title{}; //!< 英語種族名
 #endif
     concptr symbol{}; //!< 種族シンボル(救援召喚) / Race symbols
-    s16b r_adj[A_MAX]{}; //!< 能力値ボーナス / Racial stat bonuses
-
-    s16b r_dis{}; //!< 解除 / disarming
-    s16b r_dev{}; //!< 魔道具使用 /magic devices
-    s16b r_sav{}; //!< 魔法防御 / saving throw
-    s16b r_stl{}; //!< 隠密 / stealth
-    s16b r_srh{}; //!< 探索 / search ability
-    s16b r_fos{}; //!< 知覚 / search frequency
-    s16b r_thn{}; //!< 打撃修正(命中) / combat (normal)
-    s16b r_thb{}; //!< 射撃修正(命中) / combat (shooting)
+    int16_t r_adj[A_MAX]{}; //!< 能力値ボーナス / Racial stat bonuses
+
+    int16_t r_dis{}; //!< 解除 / disarming
+    int16_t r_dev{}; //!< 魔道具使用 /magic devices
+    int16_t r_sav{}; //!< 魔法防御 / saving throw
+    int16_t r_stl{}; //!< 隠密 / stealth
+    int16_t r_srh{}; //!< 探索 / search ability
+    int16_t r_fos{}; //!< 知覚 / search frequency
+    int16_t r_thn{}; //!< 打撃修正(命中) / combat (normal)
+    int16_t r_thb{}; //!< 射撃修正(命中) / combat (shooting)
 
     byte r_mhp{}; //!< ヒットダイス /  Race hit-dice modifier
     byte r_exp{}; //!< 経験値修正 /Race experience factor
index 6a87d43..08b992e 100644 (file)
@@ -122,22 +122,22 @@ static ACTION_SKILL_POWER calc_to_hit_shoot(player_type *creature_ptr);
 static ACTION_SKILL_POWER calc_to_hit_throw(player_type *creature_ptr);
 static ACTION_SKILL_POWER calc_skill_dig(player_type *creature_ptr);
 static bool is_heavy_wield(player_type *creature_ptr, int i);
-static s16b calc_num_blow(player_type *creature_ptr, int i);
-static s16b calc_to_magic_chance(player_type *creature_ptr);
+static int16_t calc_num_blow(player_type *creature_ptr, int i);
+static int16_t calc_to_magic_chance(player_type *creature_ptr);
 static ARMOUR_CLASS calc_base_ac(player_type *creature_ptr);
 static ARMOUR_CLASS calc_to_ac(player_type *creature_ptr, bool is_real_value);
-static s16b calc_double_weapon_penalty(player_type *creature_ptr, INVENTORY_IDX slot);
+static int16_t calc_double_weapon_penalty(player_type *creature_ptr, INVENTORY_IDX slot);
 static bool is_riding_two_hands(player_type *creature_ptr);
-static s16b calc_riding_bow_penalty(player_type *creature_ptr);
+static int16_t calc_riding_bow_penalty(player_type *creature_ptr);
 static void put_equipment_warning(player_type *creature_ptr);
 
-static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value);
-static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value);
+static int16_t calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value);
+static int16_t calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value);
 
-static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_real_value);
+static int16_t calc_to_hit_bow(player_type *creature_ptr, bool is_real_value);
 
-static s16b calc_to_damage_misc(player_type *creature_ptr);
-static s16b calc_to_hit_misc(player_type *creature_ptr);
+static int16_t calc_to_damage_misc(player_type *creature_ptr);
+static int16_t calc_to_hit_misc(player_type *creature_ptr);
 
 static DICE_NUMBER calc_to_weapon_dice_num(player_type *creature_ptr, INVENTORY_IDX slot);
 static player_hand main_attack_hand(player_type *creature_ptr);
@@ -304,7 +304,7 @@ static void update_bonuses(player_type *creature_ptr)
     BIT_FLAGS old_esp_unique = creature_ptr->esp_unique;
     BIT_FLAGS old_see_inv = creature_ptr->see_inv;
     BIT_FLAGS old_mighty_throw = creature_ptr->mighty_throw;
-    s16b old_speed = creature_ptr->pspeed;
+    int16_t old_speed = creature_ptr->pspeed;
 
     ARMOUR_CLASS old_dis_ac = creature_ptr->dis_ac;
     ARMOUR_CLASS old_dis_to_a = creature_ptr->dis_to_a;
@@ -735,7 +735,7 @@ static void update_num_of_spells(player_type *creature_ptr)
         if (k > 32)
             k = 32;
         if ((creature_ptr->new_spells > k) && ((mp_ptr->spell_book == TV_LIFE_BOOK) || (mp_ptr->spell_book == TV_HISSATSU_BOOK))) {
-            creature_ptr->new_spells = (s16b)k;
+            creature_ptr->new_spells = (int16_t)k;
         }
     }
 
@@ -985,7 +985,7 @@ static void update_max_mana(player_type *creature_ptr)
  * @param o_ptr 計算する射撃武器のアイテム情報参照ポインタ
  * @return 射撃倍率の値(100で1.00倍)
  */
-s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr)
+int16_t calc_num_fire(player_type *creature_ptr, object_type *o_ptr)
 {
     int extra_shots = 0;
     BIT_FLAGS flgs[TR_FLAG_SIZE];
@@ -1010,13 +1010,13 @@ s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr)
 
     int num = 0;
     if (o_ptr->k_idx == 0)
-        return (s16b)num;
+        return (int16_t)num;
 
     num = 100;
     num += (extra_shots * 100);
 
     if (is_heavy_shoot(creature_ptr, o_ptr))
-        return (s16b)num;
+        return (int16_t)num;
 
     tval_type tval_ammo = static_cast<tval_type>(bow_tval_ammo(o_ptr));
     if ((creature_ptr->pclass == CLASS_RANGER) && (tval_ammo == TV_ARROW)) {
@@ -1042,7 +1042,7 @@ s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr)
         num += (creature_ptr->lev * 4);
     }
 
-    return (s16b)num;
+    return (int16_t)num;
 }
 
 /*!
@@ -1427,11 +1427,11 @@ static bool is_heavy_wield(player_type *creature_ptr, int i)
     return has_melee_weapon(creature_ptr, INVEN_MAIN_HAND + i) && (calc_weapon_weight_limit(creature_ptr) < o_ptr->weight / 10);
 }
 
-static s16b calc_num_blow(player_type *creature_ptr, int i)
+static int16_t calc_num_blow(player_type *creature_ptr, int i)
 {
     object_type *o_ptr;
     BIT_FLAGS flgs[TR_FLAG_SIZE];
-    s16b num_blow = 1;
+    int16_t num_blow = 1;
 
     o_ptr = &creature_ptr->inventory_list[INVEN_MAIN_HAND + i];
     object_flags(creature_ptr, o_ptr, flgs);
@@ -1472,9 +1472,9 @@ static s16b calc_num_blow(player_type *creature_ptr, int i)
 
             num_blow = blows_table[str_index][dex_index];
             if (num_blow > num)
-                num_blow = (s16b)num;
+                num_blow = (int16_t)num;
 
-            num_blow += (s16b)creature_ptr->extra_blows[i];
+            num_blow += (int16_t)creature_ptr->extra_blows[i];
             if (creature_ptr->pclass == CLASS_WARRIOR)
                 num_blow += (creature_ptr->lev / 40);
             else if (creature_ptr->pclass == CLASS_BERSERKER)
@@ -1562,9 +1562,9 @@ static s16b calc_num_blow(player_type *creature_ptr, int i)
  * * 性格チャージマンなら加算(+5)
  * * 装備品にTRC::HARD_SPELLがあるなら加算(軽い呪いなら+3/重い呪いなら+10)
  */
-static s16b calc_to_magic_chance(player_type *creature_ptr)
+static int16_t calc_to_magic_chance(player_type *creature_ptr)
 {
-    s16b chance = 0;
+    int16_t chance = 0;
 
     if (creature_ptr->pseikaku == PERSONALITY_LAZY)
         chance += 10;
@@ -1787,7 +1787,7 @@ static ARMOUR_CLASS calc_to_ac(player_type *creature_ptr, bool is_real_value)
  * * 武蔵セットによる免除
  * * 竿状武器による増加
  */
-s16b calc_double_weapon_penalty(player_type *creature_ptr, INVENTORY_IDX slot)
+int16_t calc_double_weapon_penalty(player_type *creature_ptr, INVENTORY_IDX slot)
 {
     int penalty = 0;
     BIT_FLAGS flags[TR_FLAG_SIZE];
@@ -1817,7 +1817,7 @@ s16b calc_double_weapon_penalty(player_type *creature_ptr, INVENTORY_IDX slot)
         if (creature_ptr->inventory_list[slot].tval == TV_POLEARM)
             penalty += 10;
     }
-    return (s16b)penalty;
+    return (int16_t)penalty;
 }
 
 static bool is_riding_two_hands(player_type *creature_ptr)
@@ -1845,13 +1845,13 @@ static bool is_riding_two_hands(player_type *creature_ptr)
     return false;
 }
 
-static s16b calc_riding_bow_penalty(player_type *creature_ptr)
+static int16_t calc_riding_bow_penalty(player_type *creature_ptr)
 {
     floor_type *floor_ptr = creature_ptr->current_floor_ptr;
     if (!creature_ptr->riding)
         return 0;
 
-    s16b penalty = 0;
+    int16_t penalty = 0;
 
     if ((creature_ptr->pclass == CLASS_BEASTMASTER) || (creature_ptr->pclass == CLASS_CAVALRY)) {
         if (creature_ptr->tval_ammo != TV_ARROW)
@@ -1960,7 +1960,7 @@ void put_equipment_warning(player_type *creature_ptr)
     }
 }
 
-static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value)
+static int16_t calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value)
 {
     object_type *o_ptr = &creature_ptr->inventory_list[slot];
     BIT_FLAGS flgs[TR_FLAG_SIZE];
@@ -1972,7 +1972,7 @@ static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool i
     if (slot == INVEN_SUB_HAND)
         calc_hand = PLAYER_HAND_SUB;
 
-    s16b damage = 0;
+    int16_t damage = 0;
     damage += ((int)(adj_str_td[creature_ptr->stat_index[A_STR]]) - 128);
 
     if (is_shero(creature_ptr)) {
@@ -2039,32 +2039,32 @@ static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool i
         case MELEE_TYPE_BAREHAND_TWO: /* fall through */
         case MELEE_TYPE_WEAPON_TWOHAND:
             if (calc_hand == main_attack_hand(creature_ptr))
-                damage += (s16b)bonus_to_d;
+                damage += (int16_t)bonus_to_d;
             break;
 
         case MELEE_TYPE_BAREHAND_MAIN: /* fall through */
         case MELEE_TYPE_WEAPON_MAIN:
             if ((calc_hand == PLAYER_HAND_MAIN) && (i != INVEN_SUB_RING))
-                damage += (s16b)bonus_to_d;
+                damage += (int16_t)bonus_to_d;
             break;
 
         case MELEE_TYPE_BAREHAND_SUB: /* fall through */
         case MELEE_TYPE_WEAPON_SUB:
             if ((calc_hand == PLAYER_HAND_SUB) && (i != INVEN_MAIN_RING))
-                damage += (s16b)bonus_to_d;
+                damage += (int16_t)bonus_to_d;
             break;
 
         case MELEE_TYPE_WEAPON_DOUBLE:
             if (calc_hand == PLAYER_HAND_MAIN) {
                 if (i == INVEN_MAIN_RING) {
-                    damage += (s16b)bonus_to_d;
+                    damage += (int16_t)bonus_to_d;
                 } else if (i != INVEN_SUB_RING) {
                     damage += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d;
                 }
             }
             if (calc_hand == PLAYER_HAND_SUB) {
                 if (i == INVEN_SUB_RING) {
-                    damage += (s16b)bonus_to_d;
+                    damage += (int16_t)bonus_to_d;
                 } else if (i != INVEN_MAIN_RING) {
                     damage += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d;
                 }
@@ -2107,9 +2107,9 @@ static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool i
  * @details
  * 'slot' MUST be INVEN_MAIN_HAND or INVEM_SUB_HAND.
  */
-static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value)
+static int16_t calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value)
 {
-    s16b hit = 0;
+    int16_t hit = 0;
 
     /* Base bonuses */
     hit += ((int)(adj_dex_th[creature_ptr->stat_index[A_DEX]]) - 128);
@@ -2211,7 +2211,7 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_r
                 if (penalty < 30)
                     penalty = 30;
             }
-            hit -= (s16b)penalty;
+            hit -= (int16_t)penalty;
         }
 
         /* Class penalties */
@@ -2276,32 +2276,32 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_r
         case MELEE_TYPE_BAREHAND_TWO: /* fall through */
         case MELEE_TYPE_WEAPON_TWOHAND:
             if (calc_hand == main_attack_hand(creature_ptr))
-                hit += (s16b)bonus_to_h;
+                hit += (int16_t)bonus_to_h;
             break;
 
         case MELEE_TYPE_BAREHAND_MAIN: /* fall through */
         case MELEE_TYPE_WEAPON_MAIN:
             if ((calc_hand == PLAYER_HAND_MAIN) && (i != INVEN_SUB_RING))
-                hit += (s16b)bonus_to_h;
+                hit += (int16_t)bonus_to_h;
             break;
 
         case MELEE_TYPE_BAREHAND_SUB: /* fall through */
         case MELEE_TYPE_WEAPON_SUB:
             if ((calc_hand == PLAYER_HAND_SUB) && (i != INVEN_MAIN_RING))
-                hit += (s16b)bonus_to_h;
+                hit += (int16_t)bonus_to_h;
             break;
 
         case MELEE_TYPE_WEAPON_DOUBLE:
             if (calc_hand == PLAYER_HAND_MAIN) {
                 if (i == INVEN_MAIN_RING) {
-                    hit += (s16b)bonus_to_h;
+                    hit += (int16_t)bonus_to_h;
                 } else if (i != INVEN_SUB_RING) {
                     hit += (bonus_to_h > 0) ? (bonus_to_h + 1) / 2 : bonus_to_h;
                 }
             }
             if (calc_hand == PLAYER_HAND_SUB) {
                 if (i == INVEN_SUB_RING) {
-                    hit += (s16b)bonus_to_h;
+                    hit += (int16_t)bonus_to_h;
                 } else if (i != INVEN_MAIN_RING) {
                     hit += (bonus_to_h > 0) ? bonus_to_h / 2 : bonus_to_h;
                 }
@@ -2334,9 +2334,9 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_r
     return hit;
 }
 
-static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_real_value)
+static int16_t calc_to_hit_bow(player_type *creature_ptr, bool is_real_value)
 {
-    s16b pow = 0;
+    int16_t pow = 0;
 
     pow += ((int)(adj_dex_th[creature_ptr->stat_index[A_DEX]]) - 128);
     pow += ((int)(adj_str_th[creature_ptr->stat_index[A_STR]]) - 128);
@@ -2406,7 +2406,7 @@ static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_real_value)
         }
 
         if (is_real_value || object_is_known(o_ptr))
-            pow += (s16b)bonus_to_h;
+            pow += (int16_t)bonus_to_h;
     }
 
     pow -= calc_riding_bow_penalty(creature_ptr);
@@ -2414,12 +2414,12 @@ static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_real_value)
     return pow;
 }
 
-static s16b calc_to_damage_misc(player_type *creature_ptr)
+static int16_t calc_to_damage_misc(player_type *creature_ptr)
 {
     object_type *o_ptr;
     BIT_FLAGS flgs[TR_FLAG_SIZE];
 
-    s16b to_dam = 0;
+    int16_t to_dam = 0;
 
     for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
         o_ptr = &creature_ptr->inventory_list[i];
@@ -2433,7 +2433,7 @@ static s16b calc_to_damage_misc(player_type *creature_ptr)
             if (o_ptr->to_d > 0)
                 bonus_to_d = (o_ptr->to_d + 1) / 2;
         }
-        to_dam += (s16b)bonus_to_d;
+        to_dam += (int16_t)bonus_to_d;
     }
 
     if (is_shero(creature_ptr)) {
@@ -2450,12 +2450,12 @@ static s16b calc_to_damage_misc(player_type *creature_ptr)
     return to_dam;
 }
 
-static s16b calc_to_hit_misc(player_type *creature_ptr)
+static int16_t calc_to_hit_misc(player_type *creature_ptr)
 {
     object_type *o_ptr;
     BIT_FLAGS flgs[TR_FLAG_SIZE];
 
-    s16b to_hit = 0;
+    int16_t to_hit = 0;
 
     for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
         o_ptr = &creature_ptr->inventory_list[i];
@@ -2469,7 +2469,7 @@ static s16b calc_to_hit_misc(player_type *creature_ptr)
             if (o_ptr->to_h > 0)
                 bonus_to_h = (o_ptr->to_h + 1) / 2;
         }
-        to_hit += (s16b)bonus_to_h;
+        to_hit += (int16_t)bonus_to_h;
     }
 
     if (is_blessed(creature_ptr)) {
@@ -2864,7 +2864,7 @@ void cnv_stat(int val, char *out_val)
  * Or even: 18/13, 18/03, 18, 17, ..., 3
  * </pre>
  */
-s16b modify_stat_value(int value, int amount)
+int16_t modify_stat_value(int value, int amount)
 {
     if (amount > 0) {
         for (int i = 0; i < amount; i++) {
@@ -2884,7 +2884,7 @@ s16b modify_stat_value(int value, int amount)
         }
     }
 
-    return (s16b)value;
+    return (int16_t)value;
 }
 
 /*!
index 8f6855c..cf37d20 100644 (file)
@@ -17,7 +17,7 @@ WEIGHT calc_weapon_weight_limit(player_type *creature_ptr);
 WEIGHT calc_bow_weight_limit(player_type *creature_ptr);
 WEIGHT calc_inventory_weight(player_type *creature_ptr);
 
-s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr);
+int16_t calc_num_fire(player_type *creature_ptr, object_type *o_ptr);
 WEIGHT calc_weight_limit(player_type *creature_ptr);
 void update_creature(player_type *creature_ptr);
 bool player_has_no_spellbooks(player_type *creature_ptr);
@@ -27,7 +27,7 @@ bool player_place(player_type *creature_ptr, POSITION y, POSITION x);
 void check_experience(player_type *creature_ptr);
 void wreck_the_pattern(player_type *creature_ptr);
 void cnv_stat(int val, char *out_val);
-s16b modify_stat_value(int value, int amount);
+int16_t modify_stat_value(int value, int amount);
 long calc_score(player_type *creature_ptr);
 
 bool is_blessed(player_type *creature_ptr);
index e29bb46..122a77b 100644 (file)
@@ -93,10 +93,10 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
         }
     }
 
-    floor_ptr->grid_array[fill_data.ymin][fill_data.xmin].feat = (s16b)maxsize;
-    floor_ptr->grid_array[fill_data.ymax][fill_data.xmin].feat = (s16b)maxsize;
-    floor_ptr->grid_array[fill_data.ymin][fill_data.xmax].feat = (s16b)maxsize;
-    floor_ptr->grid_array[fill_data.ymax][fill_data.xmax].feat = (s16b)maxsize;
+    floor_ptr->grid_array[fill_data.ymin][fill_data.xmin].feat = (int16_t)maxsize;
+    floor_ptr->grid_array[fill_data.ymax][fill_data.xmin].feat = (int16_t)maxsize;
+    floor_ptr->grid_array[fill_data.ymin][fill_data.xmax].feat = (int16_t)maxsize;
+    floor_ptr->grid_array[fill_data.ymax][fill_data.xmax].feat = (int16_t)maxsize;
     floor_ptr->grid_array[y0][x0].feat = 0;
     POSITION xstep = xsize * 256;
     POSITION xhstep = xsize * 256;
index f20b729..6e3c8ca 100644 (file)
@@ -94,7 +94,7 @@ bool generate_rooms(player_type *player_ptr, dun_data_type *dd_ptr)
     int rooms_built = 0;
     int area_size = 100 * (floor_ptr->height * floor_ptr->width) / (MAX_HGT * MAX_WID);
     int level_index = MIN(10, div_round(floor_ptr->dun_level, 10));
-    s16b room_num[ROOM_T_MAX];
+    int16_t room_num[ROOM_T_MAX];
     int dun_rooms = DUN_ROOMS_MAX * area_size / 100;
     room_info_type *room_info_ptr = room_info_normal;
     for (int i = 0; i < ROOM_T_MAX; i++) {
index a7ee3c8..da2cae4 100644 (file)
@@ -5,7 +5,7 @@
 
 /* Room type information */
 typedef struct room_info_type {
-    s16b prob[ROOM_T_MAX]; /* Allocation information. */
+    int16_t prob[ROOM_T_MAX]; /* Allocation information. */
     byte min_level; /* Minimum level on which room can appear. */
 } room_info_type;
 
index f15e657..f89229e 100644 (file)
@@ -272,7 +272,7 @@ bool build_type5(player_type *player_ptr, dun_data_type *dd_ptr)
         if (r_ptr->flags3 & RF3_GOOD)
             align.sub_align |= SUB_ALIGN_GOOD;
 
-        nest_mon_info[i].r_idx = (s16b)r_idx;
+        nest_mon_info[i].r_idx = (int16_t)r_idx;
         nest_mon_info[i].used = false;
     }
 
index 068cfc9..626a779 100644 (file)
@@ -26,7 +26,7 @@ bool build_type14(player_type *player_ptr, dun_data_type *dd_ptr)
     bool light;
 
     grid_type *g_ptr;
-    s16b trap;
+    int16_t trap;
 
     /* Pick a room size */
     y1 = randint1(4);
index 75a6c68..c69e23d 100644 (file)
@@ -27,11 +27,11 @@ void wr_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr)
 {
     floor_type *floor_ptr = player_ptr->current_floor_ptr;
     if (!sf_ptr) {
-        wr_s16b((s16b)floor_ptr->dun_level);
+        wr_s16b((int16_t)floor_ptr->dun_level);
     } else {
         wr_s16b(sf_ptr->floor_id);
         wr_byte((byte)sf_ptr->savefile_id);
-        wr_s16b((s16b)sf_ptr->dun_level);
+        wr_s16b((int16_t)sf_ptr->dun_level);
         wr_s32b(sf_ptr->last_visit);
         wr_u32b(sf_ptr->visit_mark);
         wr_s16b(sf_ptr->upper_floor_id);
@@ -39,7 +39,7 @@ void wr_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr)
     }
 
     wr_u16b((u16b)floor_ptr->base_level);
-    wr_u16b((s16b)player_ptr->current_floor_ptr->num_repro);
+    wr_u16b((int16_t)player_ptr->current_floor_ptr->num_repro);
     wr_u16b((u16b)player_ptr->y);
     wr_u16b((u16b)player_ptr->x);
     wr_u16b((u16b)floor_ptr->height);
@@ -193,7 +193,7 @@ bool wr_dungeon(player_type *player_ptr)
         saved_floor_type *sf_ptr = &saved_floors[i];
         wr_s16b(sf_ptr->floor_id);
         wr_byte((byte)sf_ptr->savefile_id);
-        wr_s16b((s16b)sf_ptr->dun_level);
+        wr_s16b((int16_t)sf_ptr->dun_level);
         wr_s32b(sf_ptr->last_visit);
         wr_u32b(sf_ptr->visit_mark);
         wr_s16b(sf_ptr->upper_floor_id);
index a23f9a4..1fb3953 100644 (file)
@@ -160,7 +160,7 @@ void save_quick_start(void)
         wr_s16b(previous_char.stat_max_max[i]);
 
     for (int i = 0; i < PY_MAX_LEVEL; i++)
-        wr_s16b((s16b)previous_char.player_hp[i]);
+        wr_s16b((int16_t)previous_char.player_hp[i]);
 
     wr_s16b(previous_char.chaos_patron);
     for (int i = 0; i < 8; i++)
index dc19a43..577ac89 100644 (file)
@@ -102,7 +102,7 @@ static void write_item_flags(object_type *o_ptr, BIT_FLAGS *flags)
 
 static void write_item_info(object_type *o_ptr, const BIT_FLAGS flags)
 {
-    wr_s16b((s16b)o_ptr->weight);
+    wr_s16b((int16_t)o_ptr->weight);
     if (flags & SAVE_ITEM_NAME1)
         wr_s16b(o_ptr->name1);
 
@@ -116,7 +116,7 @@ static void write_item_info(object_type *o_ptr, const BIT_FLAGS flags)
         wr_s16b(o_ptr->to_h);
 
     if (flags & SAVE_ITEM_TO_D)
-        wr_s16b((s16b)o_ptr->to_d);
+        wr_s16b((int16_t)o_ptr->to_d);
 
     if (flags & SAVE_ITEM_TO_A)
         wr_s16b(o_ptr->to_a);
index 5179eb2..ec6a836 100644 (file)
@@ -90,10 +90,10 @@ static void write_monster_info(monster_type *m_ptr, const BIT_FLAGS flags)
     }
 
     if (flags & SAVE_MON_TARGET_Y)
-        wr_s16b((s16b)m_ptr->target_y);
+        wr_s16b((int16_t)m_ptr->target_y);
 
     if (flags & SAVE_MON_TARGET_X)
-        wr_s16b((s16b)m_ptr->target_x);
+        wr_s16b((int16_t)m_ptr->target_x);
 
     if (flags & SAVE_MON_INVULNER) {
         tmp8u = (byte)m_ptr->mtimed[MTIMED_INVULNER];
@@ -128,9 +128,9 @@ void wr_monster(monster_type *m_ptr)
     wr_s16b(m_ptr->r_idx);
     wr_byte((byte)m_ptr->fy);
     wr_byte((byte)m_ptr->fx);
-    wr_s16b((s16b)m_ptr->hp);
-    wr_s16b((s16b)m_ptr->maxhp);
-    wr_s16b((s16b)m_ptr->max_maxhp);
+    wr_s16b((int16_t)m_ptr->hp);
+    wr_s16b((int16_t)m_ptr->maxhp);
+    wr_s16b((int16_t)m_ptr->max_maxhp);
     wr_u32b(m_ptr->dealt_damage);
 
     if (flags & SAVE_MON_AP_R_IDX)
@@ -154,11 +154,11 @@ void wr_monster(monster_type *m_ptr)
 void wr_lore(MONRACE_IDX r_idx)
 {
     monster_race *r_ptr = &r_info[r_idx];
-    wr_s16b((s16b)r_ptr->r_sights);
-    wr_s16b((s16b)r_ptr->r_deaths);
-    wr_s16b((s16b)r_ptr->r_pkills);
-    wr_s16b((s16b)r_ptr->r_akills);
-    wr_s16b((s16b)r_ptr->r_tkills);
+    wr_s16b((int16_t)r_ptr->r_sights);
+    wr_s16b((int16_t)r_ptr->r_deaths);
+    wr_s16b((int16_t)r_ptr->r_pkills);
+    wr_s16b((int16_t)r_ptr->r_akills);
+    wr_s16b((int16_t)r_ptr->r_tkills);
 
     wr_byte(r_ptr->r_wake);
     wr_byte(r_ptr->r_ignore);
index be89bfc..12eabce 100644 (file)
@@ -90,8 +90,8 @@ void wr_player(player_type *creature_ptr)
     wr_s32b(creature_ptr->old_race2);
     wr_s16b(creature_ptr->old_realm);
     for (int i = 0; i < MAX_MANE; i++) {
-        wr_s16b((s16b)creature_ptr->mane_spell[i]);
-        wr_s16b((s16b)creature_ptr->mane_dam[i]);
+        wr_s16b((int16_t)creature_ptr->mane_spell[i]);
+        wr_s16b((int16_t)creature_ptr->mane_dam[i]);
     }
 
     wr_s16b(creature_ptr->mane_num);
@@ -112,8 +112,8 @@ void wr_player(player_type *creature_ptr)
     wr_byte(creature_ptr->exit_bldg);
     wr_byte(0); /* Unused */
 
-    wr_s16b((s16b)creature_ptr->oldpx);
-    wr_s16b((s16b)creature_ptr->oldpy);
+    wr_s16b((int16_t)creature_ptr->oldpx);
+    wr_s16b((int16_t)creature_ptr->oldpy);
 
     wr_s16b(0);
     wr_s32b(creature_ptr->mhp);
@@ -127,7 +127,7 @@ void wr_player(player_type *creature_ptr)
     byte tmp8u = (byte)current_world_ptr->max_d_idx;
     wr_byte(tmp8u);
     for (int i = 0; i < tmp8u; i++)
-        wr_s16b((s16b)max_dlv[i]);
+        wr_s16b((int16_t)max_dlv[i]);
 
     wr_s16b(0);
     wr_s16b(0);
index 8c03583..174cbad 100644 (file)
@@ -40,7 +40,7 @@ void wr_u16b(u16b v)
  * @brief 符号あり16ビットをファイルに書き込む
  * @param v 書き込む符号あり16bit値
  */
-void wr_s16b(s16b v) { wr_u16b((u16b)v); }
+void wr_s16b(int16_t v) { wr_u16b((u16b)v); }
 
 /*!
  * @brief 符号なし32ビットをファイルに書き込む
index 08d92dd..95d5f86 100644 (file)
@@ -9,7 +9,7 @@ extern u32b x_stamp;
 
 void wr_byte(byte v);
 void wr_u16b(u16b v);
-void wr_s16b(s16b v);
+void wr_s16b(int16_t v);
 void wr_u32b(u32b v);
 void wr_s32b(s32b v);
 void wr_string(concptr str);
index b25e2f7..61bc425 100644 (file)
@@ -125,7 +125,7 @@ static bool wr_savefile_new(player_type *player_ptr, save_type type)
     for (int i = 0; i < max_q_idx; i++) {
         quest_type *const q_ptr = &quest[i];
         wr_s16b(q_ptr->status);
-        wr_s16b((s16b)q_ptr->level);
+        wr_s16b((int16_t)q_ptr->level);
         wr_byte((byte)q_ptr->complev);
         wr_u32b(q_ptr->comptime);
 
@@ -135,8 +135,8 @@ static bool wr_savefile_new(player_type *player_ptr, save_type type)
         if (!is_quest_running)
             continue;
 
-        wr_s16b((s16b)q_ptr->cur_num);
-        wr_s16b((s16b)q_ptr->max_num);
+        wr_s16b((int16_t)q_ptr->cur_num);
+        wr_s16b((int16_t)q_ptr->max_num);
         wr_s16b(q_ptr->type);
         wr_s16b(q_ptr->r_idx);
         wr_s16b(q_ptr->k_idx);
@@ -170,7 +170,7 @@ static bool wr_savefile_new(player_type *player_ptr, save_type type)
     tmp16u = PY_MAX_LEVEL;
     wr_u16b(tmp16u);
     for (int i = 0; i < tmp16u; i++)
-        wr_s16b((s16b)player_ptr->player_hp[i]);
+        wr_s16b((int16_t)player_ptr->player_hp[i]);
 
     wr_u32b(player_ptr->spell_learned1);
     wr_u32b(player_ptr->spell_learned2);
index 9eb899e..5b788da 100644 (file)
@@ -558,11 +558,11 @@ bool exe_dimension_door(player_type *caster_ptr, POSITION x, POSITION y)
 {
     PLAYER_LEVEL plev = caster_ptr->lev;
 
-    caster_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
+    caster_ptr->energy_need += (int16_t)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
 
     if (!cave_player_teleportable_bold(caster_ptr, y, x, TELEPORT_SPONTANEOUS) || (distance(y, x, caster_ptr->y, caster_ptr->x) > plev / 2 + 10)
         || (!randint0(plev / 10 + 10))) {
-        caster_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
+        caster_ptr->energy_need += (int16_t)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
         teleport_player(caster_ptr, (plev + 2) * 2, TELEPORT_PASSIVE);
         return false;
     }
index 527208a..56fbfde 100644 (file)
@@ -29,9 +29,9 @@
 
 void do_poly_wounds(player_type *creature_ptr)
 {
-    s16b wounds = creature_ptr->cut;
-    s16b hit_p = (creature_ptr->mhp - creature_ptr->chp);
-    s16b change = damroll(creature_ptr->lev, 5);
+    int16_t wounds = creature_ptr->cut;
+    int16_t hit_p = (creature_ptr->mhp - creature_ptr->chp);
+    int16_t change = damroll(creature_ptr->lev, 5);
     bool Nasty_effect = one_in_(5);
     if (!(wounds || hit_p || Nasty_effect))
         return;
index b61536c..769bcda 100644 (file)
@@ -29,15 +29,15 @@ struct store_type {
     byte type{};           //!< Store type
     byte owner{};          //!< Owner index
     byte extra{};          //!< Unused for now
-    s16b insult_cur{};     //!< Insult counter
-    s16b good_buy{};       //!< Number of "good" buys (3.0.0で廃止)
-    s16b bad_buy{};        //!< Number of "bad" buys (3.0.0で廃止)
+    int16_t insult_cur{};     //!< Insult counter
+    int16_t good_buy{};       //!< Number of "good" buys (3.0.0で廃止)
+    int16_t bad_buy{};        //!< Number of "bad" buys (3.0.0で廃止)
     s32b store_open{};     //!< Closed until this turn
     s32b last_visit{};     //!< Last visited on this turn
     store_k_idx regular{}; //!< Table -- Legal regular item kinds
     store_k_idx table{};   //!< Table -- Legal item kinds
-    s16b stock_num{};      //!< Stock -- Number of entries
-    s16b stock_size{};     //!< Stock -- Total Size of Array
+    int16_t stock_num{};      //!< Stock -- Number of entries
+    int16_t stock_size{};     //!< Stock -- Total Size of Array
     object_type *stock{};  //!< Stock -- Actual stock items
 };
 
index 46fd8b1..c2ec550 100644 (file)
@@ -40,8 +40,8 @@ int store_top = 0;
 int store_bottom = 0;
 int xtra_stock = 0;
 const owner_type *ot_ptr = NULL;
-s16b old_town_num = 0;
-s16b inner_town_num = 0;
+int16_t old_town_num = 0;
+int16_t inner_town_num = 0;
 
 /* We store the current "store feat" here so everyone can access it */
 int cur_store_feat;
@@ -54,7 +54,7 @@ bool allow_inc = false;
  * @param store_idx 店舗ID
  * @return 店舗の最大スロット数
  */
-s16b store_get_stock_max(STORE_TYPE_IDX store_idx, bool powerup)
+int16_t store_get_stock_max(STORE_TYPE_IDX store_idx, bool powerup)
 {
     switch (store_idx) {
     case STORE_HOME:
index 87b6d37..0c3c42b 100644 (file)
@@ -16,14 +16,14 @@ extern int store_top;
 extern int store_bottom;
 extern int xtra_stock;
 extern const owner_type *ot_ptr;
-extern s16b old_town_num;
-extern s16b inner_town_num;
+extern int16_t old_town_num;
+extern int16_t inner_town_num;
 
 extern int cur_store_feat;
 extern bool allow_inc;
 
 typedef struct player_type player_type;
-s16b store_get_stock_max(STORE_TYPE_IDX store_idx, bool powerup = true);
+int16_t store_get_stock_max(STORE_TYPE_IDX store_idx, bool powerup = true);
 void store_shuffle(player_type *player_ptr, int which);
 void store_maintenance(player_type *player_ptr, int town_num, int store_num, int chance);
 void store_init(int town_num, int store_num);
index 690046c..e4bf52e 100644 (file)
@@ -1,13 +1,13 @@
 #include "system/alloc-entries.h"
 
 /* The size of "alloc_race_table" (at most max_r_idx) */
-s16b alloc_race_size;
+int16_t alloc_race_size;
 
 /* The entries in the "race allocator table" */
 alloc_entry *alloc_race_table;
 
 /* The size of "alloc_kind_table" (at most max_k_idx * 4) */
-s16b alloc_kind_size;
+int16_t alloc_kind_size;
 
 /* The entries in the "kind allocator table" */
 alloc_entry *alloc_kind_table;
index edd6355..4b49e47 100644 (file)
@@ -3,8 +3,8 @@
 #include "system/angband.h"
 #include "system/alloc-entry-definition.h"
 
-extern s16b alloc_race_size;
+extern int16_t alloc_race_size;
 extern alloc_entry *alloc_race_table;
 
-extern s16b alloc_kind_size;
+extern int16_t alloc_kind_size;
 extern alloc_entry *alloc_kind_table;
index c4b0e8e..18462c0 100644 (file)
@@ -29,8 +29,8 @@ typedef struct floor_type {
     MONSTER_IDX m_max; /* Number of allocated monsters */
     MONSTER_IDX m_cnt; /* Number of live monsters */
 
-    s16b *mproc_list[MAX_MTIMED]; /*!< The array to process dungeon monsters[max_m_idx] */
-    s16b mproc_max[MAX_MTIMED]; /*!< Number of monsters to be processed */
+    int16_t *mproc_list[MAX_MTIMED]; /*!< The array to process dungeon monsters[max_m_idx] */
+    int16_t mproc_max[MAX_MTIMED]; /*!< Number of monsters to be processed */
 
     POSITION_IDX lite_n; //!< Array of grids lit by player lite
     POSITION lite_y[LITE_MAX];
index 366b805..abc7c08 100644 (file)
@@ -58,7 +58,7 @@ public:
      * 具体的な使用一覧はクエスト行き階段の移行先クエストID、
      * 各ダンジョン入口の移行先ダンジョンID、
      */
-    s16b special{};
+    int16_t special{};
 
     FEAT_IDX mimic{}; /* Feature to mimic */
 
index 31607ed..61ac97a 100644 (file)
@@ -48,13 +48,13 @@ typedef const char *concptr; /*!< 文字列定数用ポインタ定義 / A simpl
 typedef int errr;
 
 #define MAX_UCHAR 255 /*!< Maximum value storable in a "byte" (hard-coded) */
-#define MAX_SHORT 32767 /*!< Maximum value storable in a "s16b" (hard-coded) */
+#define MAX_SHORT 32767 /*!< Maximum value storable in a "int16_t" (hard-coded) */
 
 #define MAX_NLEN 160 /*!< Maximum length of object's name */
 #define MAX_MONSTER_NAME 160 /*!< モンスター名称の最大バイト数 / Max characters of monster's name */
 
 /* Note that "signed char" is not always "defined" */
-/* So always use "s16b" to hold small signed values */
+/* So always use "int16_t" to hold small signed values */
 /* A signed byte of memory */
 /* typedef signed char syte; */
 typedef unsigned char byte; /*!< byte型をunsighned charとして定義 / Note that unsigned values can cause math problems / An unsigned byte of memory */
@@ -67,44 +67,43 @@ static_assert(sizeof(short) == 2);
 static_assert(sizeof(int) == 4);
 // static_assert(sizeof(long) == 8); // 将来のための予約.
 
-typedef int16_t s16b;
 typedef uint16_t u16b;
 
 typedef int32_t s32b;
 typedef uint32_t u32b;
 
-typedef s16b IDX; /*!< ゲーム中のID型を定義 */
+typedef int16_t IDX; /*!< ゲーム中のID型を定義 */
 
-typedef s16b TOWN_IDX; /*!< ゲーム中の町ID型を定義 */
-typedef s16b FEAT_IDX; /*!< ゲーム中の地形ID型を定義 */
-typedef s16b FLOOR_IDX; /*!< ゲーム中のフロアID型を定義 */
+typedef int16_t TOWN_IDX; /*!< ゲーム中の町ID型を定義 */
+typedef int16_t FEAT_IDX; /*!< ゲーム中の地形ID型を定義 */
+typedef int16_t FLOOR_IDX; /*!< ゲーム中のフロアID型を定義 */
 
 typedef byte SEX_IDX; /*!< ゲーム中のプレイヤー性別ID型を定義 */
-typedef s16b MIMIC_RACE_IDX; /*!< ゲーム中のプレイヤー変身種族ID型を定義 */
-typedef s16b PATRON_IDX; /*!< ゲーム中のプレイヤーパトロンID型を定義 */
+typedef int16_t MIMIC_RACE_IDX; /*!< ゲーム中のプレイヤー変身種族ID型を定義 */
+typedef int16_t PATRON_IDX; /*!< ゲーム中のプレイヤーパトロンID型を定義 */
 typedef s32b ACTION_IDX; /*!< プレイヤーが現在取っている常時行動のID定義 */
-typedef s16b BACT_IDX; /*!< 町の施設処理のID定義 */
-typedef s16b BACT_RESTRICT_IDX; /*!< 町の施設処理の規制処理ID定義 */
-
-typedef s16b MONRACE_IDX; /*!< @todo monster_race_typeに差し替えて消滅させる ゲーム中のモンスター種族ID型を定義 */
-typedef s16b MONSTER_IDX; /*!< @todo monster_race_typeに差し替えて消滅させる ゲーム中のモンスター個体ID型を定義 */
-typedef s16b DUNGEON_IDX; /*!< ゲーム中のダンジョンID型を定義 */
-typedef s16b REALM_IDX; /*!< ゲーム中の魔法領域ID型を定義 */
-typedef s16b ARTIFACT_IDX; /*!< ゲーム中のアーティファクトID型を定義 */
-typedef s16b EGO_IDX; /*!< アイテムエゴのID型を定義 */
-typedef s16b ACTIVATION_IDX; /*!< アイテムの発動効果ID型を定義 */
-typedef s16b QUEST_IDX; /*!< ゲーム中のクエストID型を定義 */
+typedef int16_t BACT_IDX; /*!< 町の施設処理のID定義 */
+typedef int16_t BACT_RESTRICT_IDX; /*!< 町の施設処理の規制処理ID定義 */
+
+typedef int16_t MONRACE_IDX; /*!< @todo monster_race_typeに差し替えて消滅させる ゲーム中のモンスター種族ID型を定義 */
+typedef int16_t MONSTER_IDX; /*!< @todo monster_race_typeに差し替えて消滅させる ゲーム中のモンスター個体ID型を定義 */
+typedef int16_t DUNGEON_IDX; /*!< ゲーム中のダンジョンID型を定義 */
+typedef int16_t REALM_IDX; /*!< ゲーム中の魔法領域ID型を定義 */
+typedef int16_t ARTIFACT_IDX; /*!< ゲーム中のアーティファクトID型を定義 */
+typedef int16_t EGO_IDX; /*!< アイテムエゴのID型を定義 */
+typedef int16_t ACTIVATION_IDX; /*!< アイテムの発動効果ID型を定義 */
+typedef int16_t QUEST_IDX; /*!< ゲーム中のクエストID型を定義 */
 typedef byte ROOM_IDX; /*!< 部屋のID型を定義 */
 
-typedef s16b INVENTORY_IDX; /*!< ゲーム中の所持品ID型を定義 */
-typedef s16b OBJECT_IDX; /*!< ゲーム中のアイテムID型を定義 */
+typedef int16_t INVENTORY_IDX; /*!< ゲーム中の所持品ID型を定義 */
+typedef int16_t OBJECT_IDX; /*!< ゲーム中のアイテムID型を定義 */
 typedef s32b ESSENCE_IDX; /*!< 鍛冶エッセンスのID型 */
-typedef s16b KIND_OBJECT_IDX; /*!< ゲーム中のベースアイテムID型を定義 */
-typedef s16b VAULT_IDX; /*!< 固定部屋のID型を定義 */
+typedef int16_t KIND_OBJECT_IDX; /*!< ゲーム中のベースアイテムID型を定義 */
+typedef int16_t VAULT_IDX; /*!< 固定部屋のID型を定義 */
 typedef int MUTATION_IDX; /*!< 突然変異のID型を定義 */
 
 typedef s32b POSITION; /*!< ゲーム中の座標型を定義 */
-typedef s16b POSITION_IDX; /*!< ゲーム中の座標リストID型 */
+typedef int16_t POSITION_IDX; /*!< ゲーム中の座標リストID型 */
 
 typedef byte FEAT_SUBTYPE; /*!< 地形情報の副値 (トラップ種別/パターン種別/店舗種別)*/
 
@@ -126,41 +125,41 @@ typedef s32b HIT_POINT;
  */
 typedef s32b MANA_POINT; /*!< ゲーム中のMP型を定義 */
 
-typedef s16b HIT_PROB; /*!< ゲーム中の装備命中修正値を定義 */
-typedef s16b BASE_STATUS; /*!< ゲーム中の基礎能力値型を定義 */
+typedef int16_t HIT_PROB; /*!< ゲーム中の装備命中修正値を定義 */
+typedef int16_t BASE_STATUS; /*!< ゲーム中の基礎能力値型を定義 */
 
 typedef s32b MONSTER_NUMBER; /*!< ゲーム中のモンスター数型を定義 */
 typedef s32b ITEM_NUMBER; /*!< ゲーム中のアイテム数型を定義 */
 
-typedef s16b ACTION_ENERGY; /*!< ゲーム中の行動エネルギー型を定義 */
-typedef s16b ARMOUR_CLASS; /*!< ゲーム中の行動アーマークラス型を定義 */
-typedef s16b TIME_EFFECT; /*!< ゲーム中の時限期間の型を定義 */
+typedef int16_t ACTION_ENERGY; /*!< ゲーム中の行動エネルギー型を定義 */
+typedef int16_t ARMOUR_CLASS; /*!< ゲーム中の行動アーマークラス型を定義 */
+typedef int16_t TIME_EFFECT; /*!< ゲーム中の時限期間の型を定義 */
 typedef byte DISCOUNT_RATE; /*!< ゲーム中の値引き率の型を定義 */
-typedef s16b SPEED; /*!< ゲーム中の加速値の型定義 */
+typedef int16_t SPEED; /*!< ゲーム中の加速値の型定義 */
 
 /*!
- * @var typedef s16b ENEGRY
+ * @var typedef int16_t ENEGRY
  * @brief 行動エネルギーの型定義
  * @details
  * ENERGYはプレイヤーとモンスターの行動順を定める行動エネルギーを示す型定義である。
  */
-typedef s16b ENERGY; /*!< ゲーム中の行動エネルギーの型定義 */
+typedef int16_t ENERGY; /*!< ゲーム中の行動エネルギーの型定義 */
 
-typedef s16b SLEEP_DEGREE; /*!< モンスターの睡眠度の型定義 */
+typedef int16_t SLEEP_DEGREE; /*!< モンスターの睡眠度の型定義 */
 
-typedef s16b PLAYER_LEVEL; /*!< ゲーム中のプレイヤーレベルの型を定義 */
+typedef int16_t PLAYER_LEVEL; /*!< ゲーム中のプレイヤーレベルの型を定義 */
 typedef int DIRECTION; /*!< ゲーム中の方角の型定義 */
 typedef s32b EXP; /*!< ゲーム中の主経験値の型定義 */
-typedef s16b SUB_EXP; /*!< ゲーム中の副経験値の型定義 */
+typedef int16_t SUB_EXP; /*!< ゲーム中の副経験値の型定義 */
 
 typedef s32b OBJECT_SUBTYPE_VALUE; /*!< ゲーム中のアイテム副分類の型定義 */
-typedef s16b PARAMETER_VALUE; /*!< ゲーム中のアイテム能力値の型定義 */
+typedef int16_t PARAMETER_VALUE; /*!< ゲーム中のアイテム能力値の型定義 */
 typedef s32b WEIGHT; /*!< ゲーム中の重量の型定義(ポンド) */
 
 typedef int DICE_NUMBER; /*!< ゲーム中のダイス数の型定義 */
 typedef int DICE_SID; /*!< ゲーム中のダイス面の型定義 */
 typedef s32b PRICE; /*!< ゲーム中の金額価値の型定義 */
-typedef s16b FEED; /*!< ゲーム中の滋養度の型定義 */
+typedef int16_t FEED; /*!< ゲーム中の滋養度の型定義 */
 
 typedef u32b STR_OFFSET; /*!< テキストオフセットの型定義 */
 
@@ -173,40 +172,40 @@ typedef s32b GAME_TURN; /*!< ゲーム中のターンの型定義 */
 typedef u32b REAL_TIME; /*!< 実時刻の型定義 */
 
 typedef s32b PERCENTAGE; /*!< ゲーム中のパーセント表記の型定義(/100倍) */
-typedef s16b MULTIPLY; /*!< ゲーム中の倍率の型定義(/10倍) */
+typedef int16_t MULTIPLY; /*!< ゲーム中の倍率の型定義(/10倍) */
 
 typedef u32b BIT_FLAGS; /*!< 32ビットのフラグ配列の型定義 */
 typedef u16b BIT_FLAGS16; /*!< 16ビットのフラグ配列の型定義 */
 typedef byte BIT_FLAGS8; /*!< 8ビットのフラグ配列の型定義 */
 
-typedef s16b XTRA16; /*!< 汎用変数16ビットの型定義 */
+typedef int16_t XTRA16; /*!< 汎用変数16ビットの型定義 */
 typedef byte XTRA8; /*!< 汎用変数8ビットの型定義 */
 
-typedef s16b COMMAND_CODE; /*!< コマンド内容の型定義 */
-typedef s16b COMMAND_ARG; /*!< コマンド引数の型定義 */
-typedef s16b COMMAND_NUM; /*!< コマンド数の型定義 */
+typedef int16_t COMMAND_CODE; /*!< コマンド内容の型定義 */
+typedef int16_t COMMAND_ARG; /*!< コマンド引数の型定義 */
+typedef int16_t COMMAND_NUM; /*!< コマンド数の型定義 */
 
 typedef int TERM_LEN; /*!< コンソール表示座標の型定義 */
 typedef byte TERM_COLOR; /*!< テキスト表示色の型定義 */
 typedef char SYMBOL_CODE; /*!< キャラの文字の型定義 */
 
 typedef s32b SPELL_IDX; /*!< 各魔法領域/職業能力ごとの呪文ID型定義 */
-typedef s16b PROB; /*!< 確率の重みの型定義 */
+typedef int16_t PROB; /*!< 確率の重みの型定義 */
 typedef byte FEAT_POWER; /*!< 地形強度の型定義 */
 
 typedef int QUANTITY; /*!< インターフェース上の指定個数 */
 
 typedef int EFFECT_ID; /*!< 効果属性ID */
 
-typedef s16b QUEST_TYPE; /*!< クエストの種別ID */
-typedef s16b QUEST_STATUS; /*!< クエストの状態ID */
+typedef int16_t QUEST_TYPE; /*!< クエストの種別ID */
+typedef int16_t QUEST_STATUS; /*!< クエストの状態ID */
 
-typedef s16b ACTION_SKILL_POWER; /*!< 行動技能値 */
+typedef int16_t ACTION_SKILL_POWER; /*!< 行動技能値 */
 
 typedef int PET_COMMAND_IDX; /*!< ペットへの指示ID */
 typedef byte FF_FLAGS_IDX; /*!< 地形特性ID */
 
-typedef s16b FEAT_PRIORITY; /*!< 地形の縮小表示優先順位 */
+typedef int16_t FEAT_PRIORITY; /*!< 地形の縮小表示優先順位 */
 
 enum process_result {
     PROCESS_FALSE = 0,
index 2f53476..9ab968c 100644 (file)
@@ -41,10 +41,10 @@ typedef struct player_type {
                      * characters (such as Amberite Paladins)
                      */
 
-    s16b age{}; /* Characters age */
-    s16b ht{}; /* Height */
-    s16b wt{}; /* Weight */
-    s16b sc{}; /* Social Class */
+    int16_t age{}; /* Characters age */
+    int16_t ht{}; /* Height */
+    int16_t wt{}; /* Weight */
+    int16_t sc{}; /* Social Class */
 
     PRICE au{}; /* Current Gold */
 
@@ -56,7 +56,7 @@ typedef struct player_type {
     PLAYER_LEVEL lev{}; /* Level */
 
     TOWN_IDX town_num{}; /* Current town number */
-    s16b arena_number{}; /* monster number in on_defeat_arena_monster -KMW- */
+    int16_t arena_number{}; /* monster number in on_defeat_arena_monster -KMW- */
     bool phase_out{}; /*!< フェイズアウト状態(闘技場観戦状態などに利用、NPCの処理の対象にならず自身もほとんどの行動ができない) */
 
     DUNGEON_IDX dungeon_idx{}; /* current dungeon index */
@@ -73,14 +73,14 @@ typedef struct player_type {
     MANA_POINT csp{}; /* Cur mana pts */
     u32b csp_frac{}; /* Cur mana frac (times 2^16) */
 
-    s16b max_plv{}; /* Max Player Level */
+    int16_t max_plv{}; /* Max Player Level */
 
     BASE_STATUS stat_max[A_MAX]{}; /* Current "maximal" stat values */
     BASE_STATUS stat_max_max[A_MAX]{}; /* Maximal "maximal" stat values */
     BASE_STATUS stat_cur[A_MAX]{}; /* Current "natural" stat values */
 
-    s16b learned_spells{};
-    s16b add_spells{};
+    int16_t learned_spells{};
+    int16_t add_spells{};
 
     u32b count{};
 
@@ -149,8 +149,8 @@ typedef struct player_type {
 
     EnumClassFlagGroup<MUTA> muta{}; /*!< 突然変異 / mutations */
 
-    s16b virtues[8]{};
-    s16b vir_types[8]{};
+    int16_t virtues[8]{};
+    int16_t vir_types[8]{};
 
     TIME_EFFECT word_recall{}; /* Word of recall counter */
     TIME_EFFECT alter_reality{}; /* Alter reality counter */
@@ -190,12 +190,12 @@ typedef struct player_type {
 
     RF_ABILITY mane_spell[MAX_MANE]{};
     HIT_POINT mane_dam[MAX_MANE]{};
-    s16b mane_num{};
+    int16_t mane_num{};
     bool new_mane{};
 
 #define CONCENT_RADAR_THRESHOLD 2
 #define CONCENT_TELE_THRESHOLD 5
-    s16b concent{}; /* Sniper's concentration level */
+    int16_t concent{}; /* Sniper's concentration level */
 
     HIT_POINT player_hp[PY_MAX_LEVEL]{};
     char died_from[MAX_MONSTER_NAME]{}; /* What killed the player */
@@ -222,9 +222,9 @@ typedef struct player_type {
     player_race_type start_race{}; /* Race at birth */
     BIT_FLAGS old_race1{}; /* Record of race changes */
     BIT_FLAGS old_race2{}; /* Record of race changes */
-    s16b old_realm{}; /* Record of realm changes */
+    int16_t old_realm{}; /* Record of realm changes */
 
-    s16b pet_follow_distance{}; /* Length of the imaginary "leash" for pets */
+    int16_t pet_follow_distance{}; /* Length of the imaginary "leash" for pets */
     BIT_FLAGS16 pet_extra_flags{}; /* Various flags for controling pets */
 
     MONSTER_IDX today_mon{}; //!< 日替わり賞金首を知っていればそのモンスターID、知らなければ 0
@@ -238,8 +238,8 @@ typedef struct player_type {
     s32b feeling_turn{}; /* The turn of the last dungeon feeling */
 
     object_type *inventory_list{}; /* The player's inventory */
-    s16b inven_cnt{}; /* Number of items in inventory */
-    s16b equip_cnt{}; /* Number of items in equipment */
+    int16_t inven_cnt{}; /* Number of items in inventory */
+    int16_t equip_cnt{}; /* Number of items in equipment */
 
     /*** Temporary fields ***/
 
@@ -263,10 +263,10 @@ typedef struct player_type {
 
     KIND_OBJECT_IDX object_kind_idx{}; /* Object kind trackee */
 
-    s16b new_spells{}; /* Number of spells available */
-    s16b old_spells{};
+    int16_t new_spells{}; /* Number of spells available */
+    int16_t old_spells{};
 
-    s16b old_food_aux{}; /* Old value of food */
+    int16_t old_food_aux{}; /* Old value of food */
 
     bool old_cumber_armor{};
     bool old_cumber_glove{};
@@ -296,8 +296,8 @@ typedef struct player_type {
     BIT_FLAGS update{}; /* Pending Updates */
     BIT_FLAGS redraw{}; /* Normal Redraws */
     BIT_FLAGS window_flags{}; /* Window Redraws */
-    s16b stat_use[A_MAX]{}; /* Current modified stats */
-    s16b stat_top[A_MAX]{}; /* Maximal modified stats */
+    int16_t stat_use[A_MAX]{}; /* Current modified stats */
+    int16_t stat_top[A_MAX]{}; /* Maximal modified stats */
 
     bool sutemi{};
     bool counter{};
@@ -312,11 +312,11 @@ typedef struct player_type {
 
     /*** Extracted fields ***/
 
-    s16b running{}; /* Current counter for running, if any */
+    int16_t running{}; /* Current counter for running, if any */
     bool suppress_multi_reward{}; /*!< 複数レベルアップ時のパトロンからの報酬多重受け取りを防止 */
 
-    s16b stat_add[A_MAX]{}; /* Modifiers to stat values */
-    s16b stat_index[A_MAX]{}; /* Indexes into stat tables */
+    int16_t stat_add[A_MAX]{}; /* Modifiers to stat values */
+    int16_t stat_index[A_MAX]{}; /* Indexes into stat tables */
 
     bool hack_mutation{};
     bool is_fired{};
@@ -372,14 +372,14 @@ typedef struct player_type {
     ARMOUR_CLASS dis_to_a{}; /*!< 判明している現在の表記上の装備AC修正値 / Known bonus to ac */
     ARMOUR_CLASS dis_ac{}; /*!< 判明している現在の表記上の装備AC基礎値 / Known base ac */
 
-    s16b to_h[2]{}; /* Bonus to hit (wield) */
-    s16b to_h_b{}; /* Bonus to hit (bow) */
-    s16b to_h_m{}; /* Bonus to hit (misc) */
-    s16b to_d[2]{}; /* Bonus to dam (wield) */
-    s16b to_d_m{}; /* Bonus to dam (misc) */
+    int16_t to_h[2]{}; /* Bonus to hit (wield) */
+    int16_t to_h_b{}; /* Bonus to hit (bow) */
+    int16_t to_h_m{}; /* Bonus to hit (misc) */
+    int16_t to_d[2]{}; /* Bonus to dam (wield) */
+    int16_t to_d_m{}; /* Bonus to dam (misc) */
     ARMOUR_CLASS to_a{}; /* Bonus to ac */
 
-    s16b to_m_chance{}; /* Minusses to cast chance */
+    int16_t to_m_chance{}; /* Minusses to cast chance */
 
     bool no_flowed{};
 
@@ -405,13 +405,13 @@ typedef struct player_type {
     ACTION_SKILL_POWER skill_tht{}; /*!< 行動技能値:投射命中能力 / Skill: To hit (throwing) */
     ACTION_SKILL_POWER skill_dig{}; /*!< 行動技能値:掘削 / Skill: Digging */
 
-    s16b num_blow[2]{}; /* Number of blows */
-    s16b num_fire{}; /* Number of shots */
+    int16_t num_blow[2]{}; /* Number of blows */
+    int16_t num_fire{}; /* Number of shots */
 
     byte tval_xtra{}; /* (Unused)Correct xtra tval */
     byte tval_ammo{}; /* Correct ammo tval */
 
-    s16b pspeed{}; /*!< 現在の速度 / Current speed */
+    int16_t pspeed{}; /*!< 現在の速度 / Current speed */
 
     ENERGY energy_use{}; /*!< 直近のターンに消費したエネルギー / Energy use this turn */
 
index e2873e3..7e7f295 100644 (file)
@@ -45,7 +45,7 @@
 #include "locale/english.h"
 #endif
 
-static const s16b CONTINUOUS_DESCRIPTION = 256;
+static const int16_t CONTINUOUS_DESCRIPTION = 256;
 
 bool show_gold_on_floor = false;
 
@@ -264,12 +264,12 @@ static u16b describe_monster_item(player_type *subject_ptr, eg_type *eg_ptr)
     return CONTINUOUS_DESCRIPTION;
 }
 
-static bool within_char_util(s16b input)
+static bool within_char_util(int16_t input)
 {
     return (input > -127) && (input < 128);
 }
 
-static s16b describe_grid(player_type *subject_ptr, eg_type *eg_ptr)
+static int16_t describe_grid(player_type *subject_ptr, eg_type *eg_ptr)
 {
     if ((eg_ptr->g_ptr->m_idx == 0) || !subject_ptr->current_floor_ptr->m_list[eg_ptr->g_ptr->m_idx].ml)
         return CONTINUOUS_DESCRIPTION;
@@ -299,7 +299,7 @@ static s16b describe_grid(player_type *subject_ptr, eg_type *eg_ptr)
     return CONTINUOUS_DESCRIPTION;
 }
 
-static s16b describe_footing(player_type *subject_ptr, eg_type *eg_ptr)
+static int16_t describe_footing(player_type *subject_ptr, eg_type *eg_ptr)
 {
     if (eg_ptr->floor_num != 1)
         return CONTINUOUS_DESCRIPTION;
@@ -319,7 +319,7 @@ static s16b describe_footing(player_type *subject_ptr, eg_type *eg_ptr)
     return eg_ptr->query;
 }
 
-static s16b describe_footing_items(eg_type *eg_ptr)
+static int16_t describe_footing_items(eg_type *eg_ptr)
 {
     if (!eg_ptr->boring)
         return CONTINUOUS_DESCRIPTION;
@@ -366,18 +366,18 @@ static char describe_footing_many_items(player_type *subject_ptr, eg_type *eg_pt
     }
 }
 
-static s16b loop_describing_grid(player_type *subject_ptr, eg_type *eg_ptr)
+static int16_t loop_describing_grid(player_type *subject_ptr, eg_type *eg_ptr)
 {
     if (eg_ptr->floor_num == 0)
         return CONTINUOUS_DESCRIPTION;
 
     int min_width = 0;
     while (true) {
-        s16b footing_description = describe_footing(subject_ptr, eg_ptr);
+        int16_t footing_description = describe_footing(subject_ptr, eg_ptr);
         if (within_char_util(footing_description))
             return (char)footing_description;
 
-        s16b footing_descriptions = describe_footing_items(eg_ptr);
+        int16_t footing_descriptions = describe_footing_items(eg_ptr);
         if (within_char_util(footing_descriptions))
             return (char)footing_descriptions;
 
@@ -385,7 +385,7 @@ static s16b loop_describing_grid(player_type *subject_ptr, eg_type *eg_ptr)
     }
 }
 
-static s16b describe_footing_sight(player_type *subject_ptr, eg_type *eg_ptr, object_type *o_ptr)
+static int16_t describe_footing_sight(player_type *subject_ptr, eg_type *eg_ptr, object_type *o_ptr)
 {
     if ((o_ptr->marked & OM_FOUND) == 0)
         return CONTINUOUS_DESCRIPTION;
@@ -420,12 +420,12 @@ static s16b describe_footing_sight(player_type *subject_ptr, eg_type *eg_ptr, ob
     return CONTINUOUS_DESCRIPTION;
 }
 
-static s16b sweep_footing_items(player_type *subject_ptr, eg_type *eg_ptr)
+static int16_t sweep_footing_items(player_type *subject_ptr, eg_type *eg_ptr)
 {
     for (const auto this_o_idx : eg_ptr->g_ptr->o_idx_list) {
         object_type *o_ptr;
         o_ptr = &subject_ptr->current_floor_ptr->o_list[this_o_idx];
-        s16b ret = describe_footing_sight(subject_ptr, eg_ptr, o_ptr);
+        int16_t ret = describe_footing_sight(subject_ptr, eg_ptr, o_ptr);
         if (within_char_util(ret))
             return (char)ret;
     }
@@ -517,15 +517,15 @@ char examine_grid(player_type *subject_ptr, const POSITION y, const POSITION x,
         break;
     }
 
-    s16b description_grid = describe_grid(subject_ptr, eg_ptr);
+    int16_t description_grid = describe_grid(subject_ptr, eg_ptr);
     if (within_char_util(description_grid))
         return (char)description_grid;
 
-    s16b loop_description = loop_describing_grid(subject_ptr, eg_ptr);
+    int16_t loop_description = loop_describing_grid(subject_ptr, eg_ptr);
     if (within_char_util(loop_description))
         return (char)loop_description;
 
-    s16b footing_items_description = sweep_footing_items(subject_ptr, eg_ptr);
+    int16_t footing_items_description = sweep_footing_items(subject_ptr, eg_ptr);
     if (within_char_util(footing_items_description))
         return (char)footing_items_description;
 
index d3501c6..72b801e 100644 (file)
@@ -208,7 +208,7 @@ s32b Rand_div(s32b m) { return Rand_div_impl(m, Rand_state); }
 /*
  * The normal distribution table for the "randnor()" function (below)
  */
-static s16b randnor_table[RANDNOR_NUM] =
+static int16_t randnor_table[RANDNOR_NUM] =
 {
        206,     613,    1022,    1430,         1838,    2245,    2652,    3058,
        3463,    3867,    4271,    4673,        5075,    5475,    5874,    6271,
@@ -266,18 +266,18 @@ static s16b randnor_table[RANDNOR_NUM] =
  *
  * Note that the binary search takes up to 16 quick iterations.
  */
-s16b randnor(int mean, int stand)
+int16_t randnor(int mean, int stand)
 {
-    s16b tmp;
-    s16b offset;
+    int16_t tmp;
+    int16_t offset;
 
-    s16b low = 0;
-    s16b high = RANDNOR_NUM;
+    int16_t low = 0;
+    int16_t high = RANDNOR_NUM;
     if (stand < 1)
-        return (s16b)(mean);
+        return (int16_t)(mean);
 
     /* Roll for probability */
-    tmp = (s16b)randint0(32768);
+    tmp = (int16_t)randint0(32768);
 
     /* Binary Search */
     while (low < high) {
@@ -290,7 +290,7 @@ s16b randnor(int mean, int stand)
 
         /* Move left otherwise */
         else {
-            high = (s16b)mid;
+            high = (int16_t)mid;
         }
     }
 
@@ -308,18 +308,18 @@ s16b randnor(int mean, int stand)
 /*
  * Generates damage for "2d6" style dice rolls
  */
-s16b damroll(DICE_NUMBER num, DICE_SID sides)
+int16_t damroll(DICE_NUMBER num, DICE_SID sides)
 {
     int i, sum = 0;
     for (i = 0; i < num; i++)
         sum += randint1(sides);
-    return (s16b)(sum);
+    return (int16_t)(sum);
 }
 
 /*
  * Same as above, but always maximal
  */
-s16b maxroll(DICE_NUMBER num, DICE_SID sides) { return (num * sides); }
+int16_t maxroll(DICE_NUMBER num, DICE_SID sides) { return (num * sides); }
 
 /*
  * Given a numerator and a denominator, supply a properly rounded result,
index 33f595b..595e94b 100644 (file)
@@ -70,9 +70,9 @@ void Rand_state_set(u32b seed);
 void Rand_state_backup(u32b *backup_state);
 void Rand_state_restore(u32b *backup_state);
 s32b Rand_div(s32b m);
-s16b randnor(int mean, int stand);
-s16b damroll(DICE_NUMBER num, DICE_SID sides);
-s16b maxroll(DICE_NUMBER num, DICE_SID sides);
+int16_t randnor(int mean, int stand);
+int16_t damroll(DICE_NUMBER num, DICE_SID sides);
+int16_t maxroll(DICE_NUMBER num, DICE_SID sides);
 s32b div_round(s32b n, s32b d);
 s32b Rand_external(s32b m);
 bool next_bool();
index b9cd5a8..4a09daa 100644 (file)
@@ -21,7 +21,7 @@ void display_monster_hp_ac(lore_type *lore_ptr)
     hooked_roff(format(_("%^sは AC%d の防御力と", "%^s has an armor rating of %d"), Who::who(lore_ptr->msex), lore_ptr->r_ptr->ac));
     if ((lore_ptr->flags1 & RF1_FORCE_MAXHP) || (lore_ptr->r_ptr->hside == 1)) {
         u32b hp = lore_ptr->r_ptr->hdice * (lore_ptr->nightmare ? 2 : 1) * lore_ptr->r_ptr->hside;
-        hooked_roff(format(_(" %d の体力がある。", " and a life rating of %d.  "), (s16b)MIN(30000, hp)));
+        hooked_roff(format(_(" %d の体力がある。", " and a life rating of %d.  "), (int16_t)MIN(30000, hp)));
     } else {
         hooked_roff(format(
             _(" %dd%d の体力がある。", " and a life rating of %dd%d.  "), lore_ptr->r_ptr->hdice * (lore_ptr->nightmare ? 2 : 1), lore_ptr->r_ptr->hside));
index 7463ab3..229f2f8 100644 (file)
@@ -349,7 +349,7 @@ void fix_message(void)
         TERM_LEN w, h;
         term_get_size(&w, &h);
         for (int i = 0; i < h; i++) {
-            term_putstr(0, (h - 1) - i, -1, (byte)((i < now_message) ? TERM_WHITE : TERM_SLATE), message_str((s16b)i));
+            term_putstr(0, (h - 1) - i, -1, (byte)((i < now_message) ? TERM_WHITE : TERM_SLATE), message_str((int16_t)i));
             TERM_LEN x, y;
             term_locate(&x, &y);
             term_erase(x, y, 255);
index 716f3ed..bf91234 100644 (file)
@@ -290,7 +290,7 @@ void print_frame_basic(player_type *creature_ptr)
  */
 void health_redraw(player_type *creature_ptr, bool riding)
 {
-    s16b health_who;
+    int16_t health_who;
     int row, col;
 
     if (riding) {
index 8e4ec65..e58ef0e 100644 (file)
@@ -108,7 +108,7 @@ spoiler_output_status spoil_mon_desc(concptr fname, std::function<bool(const mon
     for (auto i = 1; i < max_r_idx; i++) {
         monster_race *r_ptr = &r_info[i];
         if (!r_ptr->name.empty())
-            who[n++] = (s16b)i;
+            who[n++] = (int16_t)i;
     }
 
     ang_sort(&dummy, who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
@@ -162,7 +162,7 @@ spoiler_output_status spoil_mon_desc(concptr fname, std::function<bool(const mon
     }
 
     fprintf(spoiler_file, "\n");
-    C_KILL(who, max_r_idx, s16b);
+    C_KILL(who, max_r_idx, int16_t);
     return ferror(spoiler_file) || angband_fclose(spoiler_file) ? spoiler_output_status::SPOILER_OUTPUT_FAIL_FCLOSE
                                                                 : spoiler_output_status::SPOILER_OUTPUT_SUCCESS;
 }
@@ -206,7 +206,7 @@ spoiler_output_status spoil_mon_info(concptr fname)
     for (int i = 1; i < max_r_idx; i++) {
         monster_race *r_ptr = &r_info[i];
         if (!r_ptr->name.empty())
-            who[n++] = (s16b)i;
+            who[n++] = (int16_t)i;
     }
 
     u16b why = 2;
@@ -255,7 +255,7 @@ spoiler_output_status spoil_mon_info(concptr fname)
         spoil_out(NULL);
     }
 
-    C_KILL(who, max_r_idx, s16b);
+    C_KILL(who, max_r_idx, int16_t);
     return ferror(spoiler_file) || angband_fclose(spoiler_file) ? spoiler_output_status::SPOILER_OUTPUT_FAIL_FCLOSE
                                                                 : spoiler_output_status::SPOILER_OUTPUT_SUCCESS;
 }
index f32a4ae..7152444 100644 (file)
@@ -586,28 +586,28 @@ static void wiz_tweak_item(player_type *player_ptr, object_type *o_ptr)
     if (!get_string(p, tmp_val, 5))
         return;
 
-    o_ptr->pval = clamp_cast<s16b>(atoi(tmp_val));
+    o_ptr->pval = clamp_cast<int16_t>(atoi(tmp_val));
     wiz_display_item(player_ptr, o_ptr);
     p = "Enter new 'to_a' setting: ";
     sprintf(tmp_val, "%d", o_ptr->to_a);
     if (!get_string(p, tmp_val, 5))
         return;
 
-    o_ptr->to_a = clamp_cast<s16b>(atoi(tmp_val));
+    o_ptr->to_a = clamp_cast<int16_t>(atoi(tmp_val));
     wiz_display_item(player_ptr, o_ptr);
     p = "Enter new 'to_h' setting: ";
     sprintf(tmp_val, "%d", o_ptr->to_h);
     if (!get_string(p, tmp_val, 5))
         return;
 
-    o_ptr->to_h = clamp_cast<s16b>(atoi(tmp_val));
+    o_ptr->to_h = clamp_cast<int16_t>(atoi(tmp_val));
     wiz_display_item(player_ptr, o_ptr);
     p = "Enter new 'to_d' setting: ";
     sprintf(tmp_val, "%d", (int)o_ptr->to_d);
     if (!get_string(p, tmp_val, 5))
         return;
 
-    o_ptr->to_d = clamp_cast<s16b>(atoi(tmp_val));
+    o_ptr->to_d = clamp_cast<int16_t>(atoi(tmp_val));
     wiz_display_item(player_ptr, o_ptr);
 }
 
index ae2fa11..063c320 100644 (file)
@@ -262,7 +262,7 @@ void wiz_change_status(player_type *creature_ptr)
     if (!get_string(_("熟練度: ", "Proficiency: "), tmp_val, 4))
         return;
 
-    s16b tmp_s16b = (s16b)atoi(tmp_val);
+    int16_t tmp_s16b = (int16_t)atoi(tmp_val);
     if (tmp_s16b < WEAPON_EXP_UNSKILLED)
         tmp_s16b = WEAPON_EXP_UNSKILLED;
 
@@ -355,7 +355,7 @@ void wiz_create_feature(player_type *creature_ptr)
         tmp_mimic = max_f_idx - 1;
 
     cave_set_feat(creature_ptr, y, x, tmp_feat);
-    g_ptr->mimic = (s16b)tmp_mimic;
+    g_ptr->mimic = (int16_t)tmp_mimic;
     feature_type *f_ptr;
     f_ptr = &f_info[g_ptr->get_feat_mimic()];