OSDN Git Service

#37287 #37353 (2.2.0.89) ACTION_IDX 型を定義し、型の置換を継続中。 / Define ACTION_IDX, ongoing...
authorDeskull <desull@users.sourceforge.jp>
Sun, 10 Dec 2017 03:23:17 +0000 (12:23 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sun, 10 Dec 2017 03:23:17 +0000 (12:23 +0900)
25 files changed:
src/autopick.c
src/birth.c
src/cmd1.c
src/cmd4.c
src/cmd5.c
src/do-spell.c
src/dungeon.c
src/effects.c
src/externs.h
src/files.c
src/floors.c
src/h-type.h
src/hissatsu.c
src/init1.c
src/init2.c
src/load.c
src/monster1.c
src/monster2.c
src/mspells3.c
src/object1.c
src/object2.c
src/spells3.c
src/types.h
src/util.c
src/xtra2.c

index 39c5912..9277fd7 100644 (file)
@@ -4929,7 +4929,7 @@ static bool insert_keymap_line(text_body_type *tb)
 {
        char tmp[1024];
        char buf[2];
-       int mode;
+       BIT_FLAGS mode;
        cptr act;
 
        /* Roguelike */
index ac5ee04..747a486 100644 (file)
@@ -5728,7 +5728,7 @@ static bool player_birth_aux(void)
 {
        int i, k, n, cs, os;
 
-       int mode = 0;
+       BIT_FLAGS mode = 0;
 
        bool flag = FALSE;
        bool prev = FALSE;
index 3cc9c44..c0852d9 100644 (file)
@@ -311,7 +311,7 @@ HIT_POINT critical_shot(int weight, int plus_ammo, int plus_bow, HIT_POINT dam)
  * @param mode オプションフラグ
  * @return クリティカル修正が入ったダメージ値
  */
-HIT_POINT critical_norm(int weight, int plus, HIT_POINT dam, s16b meichuu, int mode)
+HIT_POINT critical_norm(int weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode)
 {
        int i, k;
        
@@ -492,7 +492,7 @@ static MULTIPLY mult_brand(MULTIPLY mult, const BIT_FLAGS* flgs, const monster_t
  * Note that most brands and slays are x3, except Slay Animal (x2),\n
  * Slay Evil (x2), and Kill dragon (x5).\n
  */
-s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, int mode, bool thrown)
+s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown)
 {
        MULTIPLY mult = 10;
 
@@ -1559,7 +1559,7 @@ static void natural_attack(s16b m_idx, int attack, bool *fear, bool *mdeath)
  * @details
  * If no "weapon" is available, then "punch" the monster one time.
  */
-static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int mode)
+static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, BIT_FLAGS mode)
 {
        int             num = 0, bonus, chance, vir;
        HIT_POINT k;
@@ -2467,7 +2467,7 @@ static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int
  * @details
  * If no "weapon" is available, then "punch" the monster one time.
  */
-bool py_attack(int y, int x, int mode)
+bool py_attack(int y, int x, BIT_FLAGS mode)
 {
        bool            fear = FALSE;
        bool            mdeath = FALSE;
index e4984ac..1ba5d6d 100644 (file)
@@ -2593,7 +2593,7 @@ static errr keymap_dump(cptr fname)
        char key[1024];
        char buf[1024];
 
-       int mode;
+       BIT_FLAGS mode;
 
        /* Roguelike */
        if (rogue_like_commands)
@@ -2671,7 +2671,7 @@ void do_cmd_macros(void)
 
        char buf[1024];
 
-       int mode;
+       BIT_FLAGS mode;
 
 
        /* Roguelike */
@@ -6179,7 +6179,7 @@ static void do_cmd_knowledge_kill_count(void)
                        }
                        else
                        {
-                               s16b This = r_ptr->r_pkills;
+                               MONSTER_NUMBER This = r_ptr->r_pkills;
 
                                if (This > 0)
                                {
@@ -6235,16 +6235,16 @@ static void do_cmd_knowledge_kill_count(void)
                }
                else
                {
-                       s16b This = r_ptr->r_pkills;
+                       MONSTER_NUMBER This = r_ptr->r_pkills;
 
                        if (This > 0)
                        {
 #ifdef JP
                                /* p,tは人と数える by ita */
                                if (my_strchr("pt", r_ptr->d_char))
-                                       fprintf(fff, "     %3d 人の %s\n", This, r_name + r_ptr->name);
+                                       fprintf(fff, "     %3d 人の %s\n", (int)This, r_name + r_ptr->name);
                                else
-                                       fprintf(fff, "     %3d 体の %s\n", This, r_name + r_ptr->name);
+                                       fprintf(fff, "     %3d 体の %s\n", (int)This, r_name + r_ptr->name);
 #else
                                if (This < 2)
                                {
@@ -8310,7 +8310,7 @@ static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
 }
 
 
-bool ang_sort_comp_quest_num(vptr u, vptr v, QUEST_IDX a, QUEST_IDX b)
+bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b)
 {
        QUEST_IDX *q_num = (QUEST_IDX *)u;
        quest_type *qa = &quest[q_num[a]];
@@ -8322,7 +8322,7 @@ bool ang_sort_comp_quest_num(vptr u, vptr v, QUEST_IDX a, QUEST_IDX b)
        return (qa->comptime <= qb->comptime);
 }
 
-void ang_sort_swap_quest_num(vptr u, vptr v, QUEST_IDX a, QUEST_IDX b)
+void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b)
 {
        QUEST_IDX *q_num = (QUEST_IDX *)u;
        QUEST_IDX tmp;
index e9b8e39..2565241 100644 (file)
@@ -2220,7 +2220,7 @@ void do_cmd_pet(void)
        int                     pet_ctr;
        monster_type    *m_ptr;
 
-       int mode = 0;
+       BIT_FLAGS mode = 0;
 
        char buf[160];
        char target_buf[160];
index 4ab9f0b..53625aa 100644 (file)
@@ -1048,7 +1048,7 @@ void stop_singing(void)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_life_spell(int spell, int mode)
+static cptr do_life_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -1575,7 +1575,7 @@ static cptr do_life_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_sorcery_spell(int spell, int mode)
+static cptr do_sorcery_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -2123,7 +2123,7 @@ static cptr do_sorcery_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_nature_spell(int spell, int mode)
+static cptr do_nature_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -2728,7 +2728,7 @@ static cptr do_nature_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_chaos_spell(int spell, int mode)
+static cptr do_chaos_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -3341,7 +3341,7 @@ static cptr do_chaos_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_death_spell(int spell, int mode)
+static cptr do_death_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -4014,7 +4014,7 @@ static cptr do_death_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_trump_spell(int spell, int mode)
+static cptr do_trump_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -4660,7 +4660,7 @@ static cptr do_trump_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_arcane_spell(int spell, int mode)
+static cptr do_arcane_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -5221,7 +5221,7 @@ static cptr do_arcane_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_craft_spell(int spell, int mode)
+static cptr do_craft_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -5754,7 +5754,7 @@ static cptr do_craft_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_daemon_spell(int spell, int mode)
+static cptr do_daemon_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -6370,7 +6370,7 @@ static cptr do_daemon_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_crusade_spell(int spell, int mode)
+static cptr do_crusade_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -6983,7 +6983,7 @@ static cptr do_crusade_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
  */
-static cptr do_music_spell(MAGIC_NUM2 spell, int mode)
+static cptr do_music_spell(MAGIC_NUM2 spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -7900,7 +7900,7 @@ static cptr do_music_spell(MAGIC_NUM2 spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_hissatsu_spell(int spell, int mode)
+static cptr do_hissatsu_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -8873,7 +8873,7 @@ static bool item_tester_hook_cursed(object_type *o_ptr)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_CONT / SPELL_STOP)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
  */
-static cptr do_hex_spell(int spell, int mode)
+static cptr do_hex_spell(int spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -9696,7 +9696,7 @@ static cptr do_hex_spell(int spell, int mode)
  * @param mode 求める処理
  * @return 各領域魔法に各種テキストを求めた場合は文字列参照ポインタ、そうでない場合はNULLポインタを返す。
  */
-cptr do_spell(REALM_IDX realm, SPELL_IDX spell, int mode)
+cptr do_spell(REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode)
 {
        switch (realm)
        {
index 91c3560..e191788 100644 (file)
@@ -2635,7 +2635,7 @@ static void process_world_aux_mutation(void)
        }
        if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
        {
-               int slot = 0;
+               INVENTORY_IDX slot = 0;
                object_type *o_ptr = NULL;
 
                disturb(0, 1);
index bf01018..e7892a2 100644 (file)
@@ -21,7 +21,7 @@
  * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。
  * @return なし
  */
-void set_action(int typ)
+void set_action(ACTION_IDX typ)
 {
        int prev_typ = p_ptr->action;
 
index 917dc21..8398d71 100644 (file)
@@ -688,7 +688,7 @@ extern bool is_glyph_grid(cave_type *c_ptr);
 extern bool is_explosive_rune_grid(cave_type *c_ptr);
 extern void mmove2(int *y, int *x, int y1, int x1, int y2, int x2);
 extern bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
-extern void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, int mode);
+extern void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
 extern void health_track(MONSTER_IDX m_idx);
 extern void monster_race_track(MONRACE_IDX r_idx);
 extern void object_kind_track(IDX k_idx);
@@ -699,12 +699,12 @@ extern void glow_deep_lava_and_bldg(void);
 extern bool test_hit_fire(int chance, monster_type *m_ptr, int vis, char* o_name);
 extern bool test_hit_norm(int chance, int ac, int vis);
 extern HIT_POINT critical_shot(int weight, int plus_ammo, int plus_bow, HIT_POINT dam);
-extern HIT_POINT critical_norm(int weight, int plus, HIT_POINT dam, s16b meichuu, int mode);
-extern s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, int mode, bool thrown);
+extern HIT_POINT critical_norm(int weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode);
+extern s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown);
 extern void search(void);
 extern void py_pickup_aux(int o_idx);
 extern void carry(bool pickup);
-extern bool py_attack(int y, int x, int mode);
+extern bool py_attack(int y, int x, BIT_FLAGS mode);
 extern bool pattern_seq(int c_y, int c_x, int n_y, int n_x);
 extern bool player_can_enter(s16b feature, u16b mode);
 extern bool move_player_effect(POSITION ny, POSITION nx, u32b mpe_mode);
@@ -784,8 +784,8 @@ extern void do_cmd_save_screen_html_aux(char *filename, int message);
 extern void do_cmd_save_screen(void);
 extern void do_cmd_knowledge_quests_completed(FILE *fff, IDX quest_num[]);
 extern void do_cmd_knowledge_quests_failed(FILE *fff, IDX quest_num[]);
-extern bool ang_sort_comp_quest_num(vptr u, vptr v, QUEST_IDX a, QUEST_IDX b);
-extern void ang_sort_swap_quest_num(vptr u, vptr v, QUEST_IDX a, QUEST_IDX b);
+extern bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b);
+extern void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b);
 extern void do_cmd_knowledge(void);
 extern void plural_aux(char * Name);
 extern void do_cmd_checkquest(void);
@@ -819,7 +819,7 @@ extern bool do_cmd_magic_eater(bool only_browse, bool powerful);
 
 /* do-spell.c */
 extern void stop_singing(void);
-extern cptr do_spell(REALM_IDX realm, SPELL_IDX spell, int mode);
+extern cptr do_spell(REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode);
 
 /* dungeon.c */
 extern void leave_quest_check(void);
@@ -838,8 +838,8 @@ extern void prevent_turn_overflow(void);
 /* files.c */
 extern void safe_setuid_drop(void);
 extern void safe_setuid_grab(void);
-extern s16b tokenize(char *buf, s16b num, char **tokens, int mode);
-extern void display_player(int mode);
+extern s16b tokenize(char *buf, s16b num, char **tokens, BIT_FLAGS mode);
+extern void display_player(BIT_FLAGS mode);
 extern errr make_character_dump(FILE *fff);
 extern errr file_character(cptr name);
 extern errr process_pref_file_command(char *buf);
@@ -852,7 +852,7 @@ extern errr check_time_init(void);
 extern errr check_load_init(void);
 extern errr check_time(void);
 extern errr check_load(void);
-extern bool show_file(bool show_version, cptr name, cptr what, int line, int mode);
+extern bool show_file(bool show_version, cptr name, cptr what, int line, BIT_FLAGS mode);
 extern void do_cmd_help(void);
 extern void process_player_name(bool sf);
 extern void get_name(void);
@@ -941,7 +941,7 @@ extern void monster_gain_exp(MONSTER_IDX m_idx, IDX s_idx);
 
 /* monster1.c */
 extern void roff_top(MONRACE_IDX r_idx);
-extern void screen_roff(MONRACE_IDX r_idx, int mode);
+extern void screen_roff(MONRACE_IDX r_idx, BIT_FLAGS mode);
 extern void display_roff(MONRACE_IDX r_idx);
 extern void output_monster_spoiler(MONRACE_IDX r_idx, void (*roff_func)(byte attr, cptr str));
 extern void create_name(int type, char *name);
@@ -976,7 +976,7 @@ extern void wipe_m_list(void);
 extern MONSTER_IDX m_pop(void);
 extern errr get_mon_num_prep(monster_hook_type monster_hook, monster_hook_type monster_hook2);
 extern MONRACE_IDX get_mon_num(DEPTH level);
-extern void monster_desc(char *desc, monster_type *m_ptr, int mode);
+extern void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode);
 extern int lore_do_probe(MONRACE_IDX r_idx);
 extern void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold);
 extern void sanity_blast(monster_type *m_ptr, bool necro);
@@ -1018,7 +1018,7 @@ extern COMMAND_CODE show_inven(int target_item);
 extern COMMAND_CODE show_equip(int target_item);
 extern void toggle_inven_equip(void);
 extern bool can_get_item(void);
-extern bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, int mode);
+extern bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode);
 
 /* object2.c */
 extern void excise_object_idx(int o_idx);
@@ -1226,13 +1226,13 @@ extern DUNGEON_IDX choose_dungeon(cptr note, POSITION y, POSITION x);
 extern bool recall_player(TIME_EFFECT turns);
 extern bool word_of_recall(void);
 extern bool reset_recall(void);
-extern bool apply_disenchant(int mode);
+extern bool apply_disenchant(BIT_FLAGS mode);
 extern void mutate_player(void);
 extern void apply_nexus(monster_type *m_ptr);
 extern void phlogiston(void);
 extern void brand_weapon(int brand_type);
 extern void call_the_(void);
-extern void fetch(int dir, int wgt, bool require_los);
+extern void fetch(DIRECTION dir, WEIGHT wgt, bool require_los);
 extern void alter_reality(void);
 extern bool warding_glyph(void);
 extern bool place_mirror(void);
@@ -1242,7 +1242,7 @@ extern int remove_curse(void);
 extern int remove_all_curse(void);
 extern bool alchemy(void);
 extern bool enchant(object_type *o_ptr, int n, int eflag);
-extern bool enchant_spell(int num_hit, int num_dam, int num_ac);
+extern bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac);
 extern bool artifact_scroll(void);
 extern bool ident_spell(bool only_equip);
 extern bool mundane_spell(bool only_equip);
@@ -1316,7 +1316,7 @@ extern errr my_fclose(FILE *fff);
 extern errr fd_kill(cptr file);
 extern errr fd_move(cptr file, cptr what);
 extern errr fd_copy(cptr file, cptr what);
-extern int fd_make(cptr file, int mode);
+extern int fd_make(cptr file, BIT_FLAGS mode);
 extern int fd_open(cptr file, int flags);
 extern errr fd_lock(int fd, int what);
 extern errr fd_seek(int fd, huge n);
@@ -1360,7 +1360,7 @@ extern bool askfor_aux(char *buf, int len, bool numpad_cursor);
 extern bool askfor(char *buf, int len);
 extern bool get_string(cptr prompt, char *buf, int len);
 extern bool get_check(cptr prompt);
-extern bool get_check_strict(cptr prompt, int mode);
+extern bool get_check_strict(cptr prompt, BIT_FLAGS mode);
 extern bool get_com(cptr prompt, char *command, bool z_escape);
 extern QUANTITY get_quantity(cptr prompt, QUANTITY max);
 extern void pause_line(int row);
@@ -1412,7 +1412,7 @@ extern void update_playtime(void);
 
 
 /* effects.c */
-extern void set_action(int typ);
+extern void set_action(ACTION_IDX typ);
 extern void reset_tim_flags(void);
 extern void dispel_player(void);
 extern bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec);
@@ -1501,7 +1501,7 @@ extern void ang_sort_aux(vptr u, vptr v, int p, int q);
 extern void ang_sort(vptr u, vptr v, int n);
 extern bool target_able(MONSTER_IDX m_idx);
 extern bool target_okay(void);
-extern bool target_set(int mode);
+extern bool target_set(BIT_FLAGS mode);
 extern void target_set_prepare_look(void);
 extern bool get_aim_dir(DIRECTION *dp);
 extern bool get_hack_dir(DIRECTION *dp);
@@ -1576,7 +1576,7 @@ extern bool monst_spell_monst(MONSTER_IDX m_idx);
 /* mspells3.c */
 extern bool do_cmd_cast_learned(void);
 extern void learn_spell(int monspell);
-extern void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, int mode);
+extern void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, BIT_FLAGS mode);
 
 /* mspells4.c */
 extern bool spell_learnable(MONSTER_IDX m_idx);
@@ -1591,7 +1591,7 @@ extern void hissatsu_info(char *p, int power);
 extern void do_cmd_hissatsu(void);
 extern void do_cmd_hissatsu_browse(void);
 extern void do_cmd_gain_hissatsu(void);
-extern MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_ptr, int mode);
+extern MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_ptr, BIT_FLAGS mode);
 
 /* mutation.c */
 extern int count_bits(BIT_FLAGS x);
@@ -1682,9 +1682,9 @@ extern bool do_cmd_disarm_aux(int y, int x, int dir);
 #ifdef ALLOW_EASY_FLOOR /* TNB */
 
 /* object1.c */
-extern int scan_floor(int *items, POSITION y, POSITION x, int mode);
+extern ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode);
 extern COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_POSITION *min_width);
-extern bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, int mode);
+extern bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode);
 extern void py_pickup_floor(bool pickup);
 
 /* variable.c */
index e74df2b..450ac35 100644 (file)
@@ -122,7 +122,7 @@ void safe_setuid_grab(void)
  * Hack -- We will always extract at least one token
  * </pre>
  */
-s16b tokenize(char *buf, s16b num, char **tokens, int mode)
+s16b tokenize(char *buf, s16b num, char **tokens, BIT_FLAGS mode)
 {
        int i = 0;
 
@@ -523,7 +523,7 @@ errr process_pref_file_command(char *buf)
                /* Process "C:<str>" -- create keymap */
                case 'C':
                {
-                       int mode;
+                       BIT_FLAGS mode;
                        char tmp[1024];
 
                        if (tokenize(buf+2, 2, zz, TOKENIZE_CHECKQUOTE) != 2) return 1;
@@ -3783,7 +3783,7 @@ c_put_str(TERM_YELLOW, "現在", row, stat_col+35);
  * Mode 4 = mutations
  * </pre>
  */
-void display_player(int mode)
+void display_player(BIT_FLAGS mode)
 {
        int i;
 
@@ -5194,7 +5194,7 @@ static void show_file_aux_line(cptr str, int cy, cptr shower)
  * Return FALSE on 'q' to exit from a deep, otherwise TRUE.
  * </pre>
  */
-bool show_file(bool show_version, cptr name, cptr what, int line, int mode)
+bool show_file(bool show_version, cptr name, cptr what, int line, BIT_FLAGS mode)
 {
        int i, n, skey;
 
index cfc010f..0391fd8 100644 (file)
@@ -30,7 +30,7 @@ void init_saved_floors(bool force)
        char floor_savefile[1024];
        int i;
        int fd = -1;
-       int mode = 0644;
+       BIT_FLAGS mode = 0644;
 
 #ifdef SET_UID
 # ifdef SECURE
index ce3b681..9127531 100644 (file)
@@ -112,6 +112,7 @@ typedef s16b RACE_IDX;                      /*!< ゲーム中のプレイヤー種族ID型を定義
 typedef s16b CLASS_IDX;                        /*!< ゲーム中のプレイヤー職業ID型を定義 */
 typedef s16b MIMIC_RACE_IDX;   /*!< ゲーム中のプレイヤー変身種族ID型を定義 */
 typedef s16b PATRON_IDX;               /*!< ゲーム中のプレイヤーパトロンID型を定義 */
+typedef s32b ACTION_IDX;               /*!< プレイヤーが現在取っている常時行動のID定義 */
 
 typedef s16b MONRACE_IDX;              /*!< ゲーム中のモンスター種族ID型を定義 */
 typedef s16b MONSTER_IDX;              /*!< ゲーム中のモンスター個体ID型を定義 */
index 292d768..e8ebacd 100644 (file)
@@ -496,7 +496,7 @@ void do_cmd_gain_hissatsu(void)
  * @param mode 剣術のスレイ型ID
  * @return スレイの倍率(/10倍)
  */
-MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_ptr, int mode)
+MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_ptr, BIT_FLAGS mode)
 {
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
index 8aa0838..79dd1bf 100644 (file)
@@ -4910,7 +4910,7 @@ void write_r_info_txt(void)
 
        cptr desc;
 
-       int mode = -1;
+       BIT_FLAGS mode = -1;
 
        if (!fff) return;
 
index 1a182ee..00e01b4 100644 (file)
@@ -441,7 +441,7 @@ static errr init_info(cptr filename, header *head,
 {
        int fd;
 
-       int mode = 0644;
+       BIT_FLAGS mode = 0644;
 
        errr err = 1;
 
@@ -2266,7 +2266,7 @@ void init_angband(void)
 {
        int fd = -1;
 
-       int mode = 0664;
+       BIT_FLAGS mode = 0664;
 
        FILE *fp;
 
index 62dbd3a..7384020 100644 (file)
@@ -1191,8 +1191,10 @@ static void rd_lore(MONRACE_IDX r_idx)
        rd_byte(&r_ptr->r_xtra2);
 
        /* Count drops */
-       rd_byte(&r_ptr->r_drop_gold);
-       rd_byte(&r_ptr->r_drop_item);
+       rd_byte(&tmp8u);
+       r_ptr->r_drop_gold = (ITEM_NUMBER)tmp8u;
+       rd_byte(&tmp8u);
+       r_ptr->r_drop_item = (ITEM_NUMBER)tmp8u;
 
        /* Count spells */
        rd_byte(&tmp8u);
@@ -1253,7 +1255,8 @@ static void rd_lore(MONRACE_IDX r_idx)
        }
 
        /* Read the "Racial" monster limit per level */
-       rd_byte(&r_ptr->max_num);
+       rd_byte(&tmp8u);
+       r_ptr->max_num = (MONSTER_NUMBER)tmp8u;
 
        /* Location in saved floor */
        rd_s16b(&r_ptr->floor_id);
@@ -2205,7 +2208,8 @@ static void rd_extra(void)
        p_ptr->autopick_autoregister = tmp8u ? TRUE : FALSE;
 
        rd_byte(&tmp8u); /* oops */
-       rd_byte(&p_ptr->action);
+       rd_byte(&tmp8u);
+       p_ptr->action = (ACTION_IDX)tmp8u;
        if (!z_older_than(10, 4, 3))
        {
                rd_byte(&tmp8u);
index c48d939..d6ca6ea 100644 (file)
@@ -205,7 +205,7 @@ void set_damage(MONRACE_IDX r_idx, int SPELL_NUM, char* msg, char* tmp)
  * left edge of the screen, on a cleared line, in which the recall is
  * to take place.  One extra blank line is left after the recall.
  */
-static void roff_aux(MONRACE_IDX r_idx, int mode)
+static void roff_aux(MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        monster_race    *r_ptr = &r_info[r_idx];
 
@@ -229,16 +229,16 @@ static void roff_aux(MONRACE_IDX r_idx, int mode)
        bool            magic = FALSE;
        bool            reinforce = FALSE;
 
-       u32b            flags1;
-       u32b            flags2;
-       u32b            flags3;
-       u32b            flags4;
-       u32b            a_ability_flags1;
-       u32b            a_ability_flags2;
-       u32b            flags7;
-       u32b            flagsr;
+       BIT_FLAGS flags1;
+       BIT_FLAGS flags2;
+       BIT_FLAGS flags3;
+       BIT_FLAGS flags4;
+       BIT_FLAGS a_ability_flags1;
+       BIT_FLAGS a_ability_flags2;
+       BIT_FLAGS flags7;
+       BIT_FLAGS flagsr;
 
-       byte drop_gold, drop_item;
+       ITEM_NUMBER drop_gold, drop_item;
 
        int             vn = 0;
        byte            color[96];
@@ -2067,7 +2067,7 @@ void roff_top(MONRACE_IDX r_idx)
  * @param mode 表示オプション
  * @return なし
  */
-void screen_roff(MONRACE_IDX r_idx, int mode)
+void screen_roff(MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        /* Flush messages */
        msg_print(NULL);
index bb445e1..0d3692a 100644 (file)
@@ -1513,7 +1513,7 @@ MONRACE_IDX get_mon_num(DEPTH level)
  *  MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE
  *    --> Reflexive, genderized if visable ("himself") or "itself"
  */
-void monster_desc(char *desc, monster_type *m_ptr, int mode)
+void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode)
 {
        cptr            res;
        monster_race    *r_ptr;
index 6eebf3b..d48a77e 100644 (file)
@@ -1636,7 +1636,7 @@ void learn_spell(int monspell)
  */
 /*
  */
-void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, int mode)
+void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, BIT_FLAGS mode)
 {
        switch (mode)
        {
index 80e0439..ac8176b 100644 (file)
@@ -1856,7 +1856,7 @@ void display_equip(void)
  * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
  * and "x" is the "current" command_cmd code.\n
  */
-static bool get_tag(COMMAND_CODE *cp, char tag, int mode)
+static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
 {
        COMMAND_CODE i;
        COMMAND_CODE start, end;
@@ -1982,7 +1982,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, int mode)
  * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
  * and "x" is the "current" command_cmd code.\n
  */
-static bool get_tag_floor(COMMAND_CODE *cp, char tag, int floor_list[], int floor_num)
+static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], FLOOR_IDX floor_num)
 {
        COMMAND_CODE i;
        cptr s;
@@ -2069,7 +2069,7 @@ static bool get_tag_floor(COMMAND_CODE *cp, char tag, int floor_list[], int floo
  * @param mode 所持品リストか装備品リストかの切り替え
  * @return なし
  */
-static void prepare_label_string(char *label, int mode)
+static void prepare_label_string(char *label, BIT_FLAGS mode)
 {
        cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int  offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
@@ -2107,7 +2107,7 @@ static void prepare_label_string(char *label, int mode)
  */
 /*
  */
-static void prepare_label_string_floor(char *label, int floor_list[], int floor_num)
+static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], FLOOR_IDX floor_num)
 {
        cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int  i;
@@ -2721,7 +2721,7 @@ bool can_get_item(void)
  * We always erase the prompt when we are done, leaving a blank line,\n
  * or a warning message, if appropriate, if no items are available.\n
  */
-bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, int mode)
+bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 {
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
@@ -3578,11 +3578,11 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, int mode)
  *             mode & 0x02 -- Marked items only
  *             mode & 0x04 -- Stop after first
  */
-int scan_floor(int *items, POSITION y, POSITION x, int mode)
+ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode)
 {
-       int this_o_idx, next_o_idx;
+       OBJECT_IDX this_o_idx, next_o_idx;
 
-       int num = 0;
+       ITEM_NUMBER num = 0;
 
        /* Sanity */
        if (!in_bounds(y, x)) return 0;
@@ -3638,7 +3638,6 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_POSITION *
        object_type *o_ptr;
 
        char o_name[MAX_NLEN];
-
        char tmp_val[80];
 
        COMMAND_CODE out_index[23];
@@ -3646,8 +3645,8 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_POSITION *
        char out_desc[23][MAX_NLEN];
        COMMAND_CODE target_item_label = 0;
 
-       int floor_list[23];
-       int floor_num;
+       OBJECT_IDX floor_list[23];
+       ITEM_NUMBER floor_num;
        TERM_POSITION wid, hgt;
        char floor_label[52 + 1];
 
@@ -3767,7 +3766,7 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_POSITION *
  * @param mode オプションフラグ
  * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/
  */
-bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, int mode)
+bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 {
        char n1 = ' ', n2 = ' ', which = ' ';
 
@@ -3794,7 +3793,9 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, int mode)
        char tmp_val[160];
        char out_val[160];
 
-       int floor_num, floor_list[23], floor_top = 0;
+       ITEM_NUMBER floor_num;
+       OBJECT_IDX floor_list[23];
+       int floor_top = 0;
        TERM_POSITION min_width = 0;
 
        extern bool select_the_force;
index 5c82dce..ff1d834 100644 (file)
@@ -8095,7 +8095,7 @@ static COMMAND_CODE choose_essence(void)
  * @param mode エッセンスの大別ID
  * @return なし
  */
-static void add_essence(int mode)
+static void add_essence(BIT_FLAGS mode)
 {
        OBJECT_IDX item;
        int max_num = 0;
index 68ca0fa..3a22045 100644 (file)
@@ -842,8 +842,9 @@ void teleport_level(MONSTER_IDX m_idx)
 DUNGEON_IDX choose_dungeon(cptr note, POSITION y, POSITION x)
 {
        DUNGEON_IDX select_dungeon;
-       int i, num = 0;
-       s16b *dun;
+       DUNGEON_IDX i;
+       int num = 0;
+       DUNGEON_IDX *dun;
 
        /* Hack -- No need to choose dungeon in some case */
        if (lite_town || vanilla_town || ironman_downward)
@@ -1041,7 +1042,7 @@ msg_format("%sの帰還レベルを %d 階にセット。", d_name+d_info[select
  * @return 劣化処理に関するメッセージが発せられた場合はTRUEを返す /
  * Return "TRUE" if the player notices anything
  */
-bool apply_disenchant(int mode)
+bool apply_disenchant(BIT_FLAGS mode)
 {
        int             t = 0;
        object_type     *o_ptr;
@@ -1676,13 +1677,13 @@ void call_the_(void)
  * @param require_los 射線の通りを要求するならばTRUE
  * @return なし
  */
-void fetch(int dir, int wgt, bool require_los)
+void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
 {
-       int             ty, tx;
+       POSITION ty, tx;
        OBJECT_IDX i;
-       cave_type       *c_ptr;
-       object_type     *o_ptr;
-       char            o_name[MAX_NLEN];
+       cave_type *c_ptr;
+       object_type *o_ptr;
+       char o_name[MAX_NLEN];
 
        /* Check to see if an object is already there */
        if (cave[p_ptr->y][p_ptr->x].o_idx)
@@ -2298,7 +2299,7 @@ bool enchant(object_type *o_ptr, int n, int eflag)
  * Note that "num_ac" requires armour, else weapon
  * Returns TRUE if attempted, FALSE if cancelled
  */
-bool enchant_spell(int num_hit, int num_dam, int num_ac)
+bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
 {
        OBJECT_IDX item;
        bool        okay = FALSE;
index 7bf69ef..639d43b 100644 (file)
@@ -1096,7 +1096,7 @@ struct player_type
 
        BIT_FLAGS special_attack;         /* Special attack capacity -LM- */
        BIT_FLAGS special_defense;        /* Special block capacity -LM- */
-       byte action;              /* Currently action */
+       ACTION_IDX action;                /* Currently action */
 
        BIT_FLAGS spell_learned1;         /* bit mask of spells learned */
        BIT_FLAGS spell_learned2;         /* bit mask of spells learned */
index dc11877..1682ea8 100644 (file)
@@ -696,7 +696,7 @@ errr fd_copy(cptr file, cptr what)
  * of "O_RDONLY", "O_WRONLY", and "O_RDWR" in "A-win-h", and then
  * we must simulate the effect of the proper "open()" call below.
  */
-int fd_make(cptr file, int mode)
+int fd_make(cptr file, BIT_FLAGS mode)
 {
        char buf[1024];
 
@@ -3658,7 +3658,7 @@ bool get_check(cptr prompt)
  * mode & CHECK_NO_HISTORY  : no message_add
  * mode & CHECK_DEFAULT_Y   : accept any key as y, except n and Esc.
  */
-bool get_check_strict(cptr prompt, int mode)
+bool get_check_strict(cptr prompt, BIT_FLAGS mode)
 {
        int i;
        char buf[80];
@@ -4405,7 +4405,7 @@ void request_command(int shopping)
        int i;
 
        char cmd;
-       int mode;
+       BIT_FLAGS mode;
 
        cptr act;
 
@@ -4813,7 +4813,7 @@ int get_keymap_dir(char ch)
        }
        else
        {
-               int mode;
+               BIT_FLAGS mode;
                cptr act, s;
 
                /* Roguelike */
@@ -5453,7 +5453,7 @@ void str_tolower(char *str)
                        continue;
                }
 #endif
-               *str = tolower(*str);
+               *str = (char)tolower(*str);
        }
 }
 
index ed73a2e..b19131c 100644 (file)
@@ -2836,7 +2836,7 @@ static bool target_set_accept(int y, int x)
  *
  * Return the number of target_able monsters in the set.
  */
-static void target_set_prepare(int mode)
+static void target_set_prepare(BIT_FLAGS mode)
 {
        int y, x;
        int min_hgt, max_hgt, min_wid, max_wid;
@@ -2998,7 +2998,7 @@ bool show_gold_on_floor = FALSE;
  *
  * This function must handle blindness/hallucination.
  */
-static int target_set_aux(int y, int x, int mode, cptr info)
+static int target_set_aux(int y, int x, BIT_FLAGS mode, cptr info)
 {
        cave_type *c_ptr = &cave[y][x];
        s16b this_o_idx, next_o_idx = 0;
@@ -3580,7 +3580,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
  * This command will cancel any old target, even if used from
  * inside the "look" command.
  */
-bool target_set(int mode)
+bool target_set(BIT_FLAGS mode)
 {
        int             i, d, m, t, bd;
        POSITION y = p_ptr->y;