OSDN Git Service

[Refactor] #define ALLOW_EASY_OPEN による分岐処理削除。 / Delete #define branch by ALLOW_EASY_OPEN.
[hengband/hengband.git] / src / files.c
index e18c39d..8c8d5a0 100644 (file)
@@ -603,7 +603,6 @@ errr process_pref_file_command(char *buf)
                        /* Find the colon */
                        char *t = my_strchr(buf + 2, ':');
 
-                       /* Oops */
                        if (!t) return 1;
 
                        /* Nuke the colon */
@@ -792,7 +791,6 @@ cptr process_pref_file_expr(char **sp, char *fp)
                /* First */
                t = process_pref_file_expr(&s, &f);
 
-               /* Oops */
                if (!*t)
                {
                        /* Nothing */
@@ -880,7 +878,6 @@ cptr process_pref_file_expr(char **sp, char *fp)
                        }
                }
 
-               /* Oops */
                else
                {
                        while (*s && (f != b2))
@@ -1472,7 +1469,6 @@ errr check_load_init(void)
                /* Use that value */
                check_load_value = value;
 
-               /* Done */
                break;
        }
 
@@ -2036,7 +2032,7 @@ static void display_player_various(void)
        int                     xdig;
        cptr            desc;
        int         muta_att = 0;
-       u32b flgs[TR_FLAG_SIZE];
+       BIT_FLAGS flgs[TR_FLAG_SIZE];
        int             shots, shot_frac;
        bool dokubari;
 
@@ -2222,7 +2218,7 @@ static void display_player_various(void)
  * @todo
  * xtra1.c周りと多重実装になっているのを何とかする
  */
-static void player_flags(u32b flgs[TR_FLAG_SIZE])
+static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
 {
        int i;
 
@@ -2669,7 +2665,7 @@ static void player_flags(u32b flgs[TR_FLAG_SIZE])
  * @todo
  * xtra1.c周りと多重実装になっているのを何とかする
  */
-static void tim_player_flags(u32b flgs[TR_FLAG_SIZE])
+static void tim_player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
 {
        int i;
 
@@ -2800,11 +2796,11 @@ static void tim_player_flags(u32b flgs[TR_FLAG_SIZE])
  * @param mode オプション
  * @return なし
  */
-static void display_player_equippy(TERM_LEN y, TERM_LEN x, u16b mode)
+static void display_player_equippy(TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
 {
        int i, max_i;
 
-       byte a;
+       TERM_COLOR a;
        char c;
 
        object_type *o_ptr;
@@ -2851,7 +2847,7 @@ void print_equippy(void)
  * @todo
  * xtra1.c周りと多重実装になっているのを何とかする
  */
-static void known_obj_immunity(u32b flgs[TR_FLAG_SIZE])
+static void known_obj_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
 {
        int i;
 
@@ -2888,7 +2884,7 @@ static void known_obj_immunity(u32b flgs[TR_FLAG_SIZE])
  * @todo
  * xtra1.c周りと多重実装になっているのを何とかする
  */
-static void player_immunity(u32b flgs[TR_FLAG_SIZE])
+static void player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
 {
        int i;
 
@@ -2913,7 +2909,7 @@ static void player_immunity(u32b flgs[TR_FLAG_SIZE])
  * @todo
  * xtra1.c周りと多重実装になっているのを何とかする
  */
-static void tim_player_immunity(u32b flgs[TR_FLAG_SIZE])
+static void tim_player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
 {
        int i;
 
@@ -2940,7 +2936,7 @@ static void tim_player_immunity(u32b flgs[TR_FLAG_SIZE])
  * @todo
  * xtra1.c周りと多重実装になっているのを何とかする
  */
-static void player_vuln_flags(u32b flgs[TR_FLAG_SIZE])
+static void player_vuln_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
 {
        int i;
 
@@ -2969,12 +2965,12 @@ static void player_vuln_flags(u32b flgs[TR_FLAG_SIZE])
  * A struct for storing misc. flags
  */
 typedef struct {
-       u32b player_flags[TR_FLAG_SIZE];
-       u32b tim_player_flags[TR_FLAG_SIZE];
-       u32b player_imm[TR_FLAG_SIZE];
-       u32b tim_player_imm[TR_FLAG_SIZE];
-       u32b player_vuln[TR_FLAG_SIZE];
-       u32b known_obj_imm[TR_FLAG_SIZE];
+       BIT_FLAGS player_flags[TR_FLAG_SIZE];
+       BIT_FLAGS tim_player_flags[TR_FLAG_SIZE];
+       BIT_FLAGS player_imm[TR_FLAG_SIZE];
+       BIT_FLAGS tim_player_imm[TR_FLAG_SIZE];
+       BIT_FLAGS player_vuln[TR_FLAG_SIZE];
+       BIT_FLAGS known_obj_imm[TR_FLAG_SIZE];
 } all_player_flags;
 
 
@@ -2989,7 +2985,7 @@ typedef struct {
  * @param mode 表示オプション
  * @return なし
  */
-static void display_flag_aux(int row, int col, cptr header,
+static void display_flag_aux(TERM_LEN row, TERM_LEN col, cptr header,
                                    int flag1, all_player_flags *f, u16b mode)
 {
        int     i;
@@ -3014,7 +3010,7 @@ static void display_flag_aux(int row, int col, cptr header,
        /* Check equipment */
        for (i = INVEN_RARM; i < max_i; i++)
        {
-               u32b flgs[TR_FLAG_SIZE];
+               BIT_FLAGS flgs[TR_FLAG_SIZE];
                object_type *o_ptr;
 
                /* Object */
@@ -3128,8 +3124,8 @@ static void display_flag_aux(int row, int col, cptr header,
  */
 static void display_player_flag_info(void)
 {
-       int row;
-       int col;
+       TERM_LEN row;
+       TERM_LEN col;
 
        all_player_flags f;
 
@@ -3150,20 +3146,20 @@ static void display_player_flag_info(void)
        c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+8);
 
 #ifdef JP
-display_flag_aux(row+0, col, "耐酸  :", TR_RES_ACID, &f, 0);
-display_flag_aux(row+0, col, "耐酸  :", TR_IM_ACID, &f, DP_IMM);
-display_flag_aux(row+1, col, "耐電撃:", TR_RES_ELEC, &f, 0);
-display_flag_aux(row+1, col, "耐電撃:", TR_IM_ELEC, &f, DP_IMM);
-display_flag_aux(row+2, col, "耐火炎:", TR_RES_FIRE, &f, 0);
-display_flag_aux(row+2, col, "耐火炎:", TR_IM_FIRE, &f, DP_IMM);
-display_flag_aux(row+3, col, "耐冷気:", TR_RES_COLD, &f, 0);
-display_flag_aux(row+3, col, "耐冷気:", TR_IM_COLD, &f, DP_IMM);
-display_flag_aux(row+4, col, "耐毒  :", TR_RES_POIS, &f, 0);
-display_flag_aux(row+5, col, "耐閃光:", TR_RES_LITE, &f, 0);
-display_flag_aux(row+6, col, "耐暗黒:", TR_RES_DARK, &f, 0);
-display_flag_aux(row+7, col, "耐破片:", TR_RES_SHARDS, &f, 0);
-display_flag_aux(row+8, col, "耐盲目:", TR_RES_BLIND, &f, 0);
-display_flag_aux(row+9, col, "耐混乱:", TR_RES_CONF, &f, 0);
+       display_flag_aux(row+0, col, "耐酸  :", TR_RES_ACID, &f, 0);
+       display_flag_aux(row+0, col, "耐酸  :", TR_IM_ACID, &f, DP_IMM);
+       display_flag_aux(row+1, col, "耐電撃:", TR_RES_ELEC, &f, 0);
+       display_flag_aux(row+1, col, "耐電撃:", TR_IM_ELEC, &f, DP_IMM);
+       display_flag_aux(row+2, col, "耐火炎:", TR_RES_FIRE, &f, 0);
+       display_flag_aux(row+2, col, "耐火炎:", TR_IM_FIRE, &f, DP_IMM);
+       display_flag_aux(row+3, col, "耐冷気:", TR_RES_COLD, &f, 0);
+       display_flag_aux(row+3, col, "耐冷気:", TR_IM_COLD, &f, DP_IMM);
+       display_flag_aux(row+4, col, "耐毒  :", TR_RES_POIS, &f, 0);
+       display_flag_aux(row+5, col, "耐閃光:", TR_RES_LITE, &f, 0);
+       display_flag_aux(row+6, col, "耐暗黒:", TR_RES_DARK, &f, 0);
+       display_flag_aux(row+7, col, "耐破片:", TR_RES_SHARDS, &f, 0);
+       display_flag_aux(row+8, col, "耐盲目:", TR_RES_BLIND, &f, 0);
+       display_flag_aux(row+9, col, "耐混乱:", TR_RES_CONF, &f, 0);
 #else
        display_flag_aux(row+0, col, "Acid  :", TR_RES_ACID, &f, 0);
        display_flag_aux(row+0, col, "Acid  :", TR_IM_ACID, &f, DP_IMM);
@@ -3192,16 +3188,16 @@ display_flag_aux(row+9, col, "耐混乱:", TR_RES_CONF, &f, 0);
        c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+8);
 
 #ifdef JP
-display_flag_aux(row+0, col, "耐轟音:", TR_RES_SOUND, &f, 0);
-display_flag_aux(row+1, col, "耐地獄:", TR_RES_NETHER, &f, 0);
-display_flag_aux(row+2, col, "耐因混:", TR_RES_NEXUS, &f, 0);
-display_flag_aux(row+3, col, "耐カオ:", TR_RES_CHAOS, &f, 0);
-display_flag_aux(row+4, col, "耐劣化:", TR_RES_DISEN, &f, 0);
-display_flag_aux(row+5, col, "耐恐怖:", TR_RES_FEAR, &f, 0);
-display_flag_aux(row+6, col, "反射  :", TR_REFLECT, &f, 0);
-display_flag_aux(row+7, col, "火炎オ:", TR_SH_FIRE, &f, 0);
-display_flag_aux(row+8, col, "電気オ:", TR_SH_ELEC, &f, 0);
-display_flag_aux(row+9, col, "冷気オ:", TR_SH_COLD, &f, 0);
+       display_flag_aux(row+0, col, "耐轟音:", TR_RES_SOUND, &f, 0);
+       display_flag_aux(row+1, col, "耐地獄:", TR_RES_NETHER, &f, 0);
+       display_flag_aux(row+2, col, "耐因混:", TR_RES_NEXUS, &f, 0);
+       display_flag_aux(row+3, col, "耐カオ:", TR_RES_CHAOS, &f, 0);
+       display_flag_aux(row+4, col, "耐劣化:", TR_RES_DISEN, &f, 0);
+       display_flag_aux(row+5, col, "耐恐怖:", TR_RES_FEAR, &f, 0);
+       display_flag_aux(row+6, col, "反射  :", TR_REFLECT, &f, 0);
+       display_flag_aux(row+7, col, "火炎オ:", TR_SH_FIRE, &f, 0);
+       display_flag_aux(row+8, col, "電気オ:", TR_SH_ELEC, &f, 0);
+       display_flag_aux(row+9, col, "冷気オ:", TR_SH_COLD, &f, 0);
 #else
        display_flag_aux(row+0, col, "Sound :", TR_RES_SOUND, &f, 0);
        display_flag_aux(row+1, col, "Nether:", TR_RES_NETHER, &f, 0);
@@ -3226,16 +3222,16 @@ display_flag_aux(row+9, col, "冷気オ:", TR_SH_COLD, &f, 0);
        c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+12);
 
 #ifdef JP
-display_flag_aux(row+0, col, "加速      :", TR_SPEED, &f, 0);
-display_flag_aux(row+1, col, "耐麻痺    :", TR_FREE_ACT, &f, 0);
-display_flag_aux(row+2, col, "透明体視認:", TR_SEE_INVIS, &f, 0);
-display_flag_aux(row+3, col, "経験値保持:", TR_HOLD_EXP, &f, 0);
-display_flag_aux(row+4, col, "警告      :", TR_WARNING, &f, 0);
-display_flag_aux(row+5, col, "遅消化    :", TR_SLOW_DIGEST, &f, 0);
-display_flag_aux(row+6, col, "急回復    :", TR_REGEN, &f, 0);
-display_flag_aux(row+7, col, "浮遊      :", TR_LEVITATION, &f, 0);
-display_flag_aux(row+8, col, "永遠光源  :", TR_LITE_1, &f, 0);
-display_flag_aux(row+9, col, "呪い      :", 0, &f, DP_CURSE);
+       display_flag_aux(row+0, col, "加速      :", TR_SPEED, &f, 0);
+       display_flag_aux(row+1, col, "耐麻痺    :", TR_FREE_ACT, &f, 0);
+       display_flag_aux(row+2, col, "透明体視認:", TR_SEE_INVIS, &f, 0);
+       display_flag_aux(row+3, col, "経験値保持:", TR_HOLD_EXP, &f, 0);
+       display_flag_aux(row+4, col, "警告      :", TR_WARNING, &f, 0);
+       display_flag_aux(row+5, col, "遅消化    :", TR_SLOW_DIGEST, &f, 0);
+       display_flag_aux(row+6, col, "急回復    :", TR_REGEN, &f, 0);
+       display_flag_aux(row+7, col, "浮遊      :", TR_LEVITATION, &f, 0);
+       display_flag_aux(row+8, col, "永遠光源  :", TR_LITE_1, &f, 0);
+       display_flag_aux(row+9, col, "呪い      :", 0, &f, DP_CURSE);
 #else
        display_flag_aux(row+0, col, "Speed     :", TR_SPEED, &f, 0);
        display_flag_aux(row+1, col, "FreeAction:", TR_FREE_ACT, &f, 0);
@@ -3259,8 +3255,8 @@ display_flag_aux(row+9, col, "呪い      :", 0, &f, DP_CURSE);
  */
 static void display_player_other_flag_info(void)
 {
-       int row;
-       int col;
+       TERM_LEN row;
+       TERM_LEN col;
 
        all_player_flags f;
 
@@ -3525,7 +3521,7 @@ static void display_player_stat_info(void)
        int row, col;
 
        object_type *o_ptr;
-       u32b flgs[TR_FLAG_SIZE];
+       BIT_FLAGS flgs[TR_FLAG_SIZE];
 
        byte a;
        char c;
@@ -3826,7 +3822,6 @@ void display_player(BIT_FLAGS mode)
        char    tmp[64];
 
 
-       /* XXX XXX XXX */
        if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && display_mutations)
                mode = (mode % 5);
        else
@@ -4366,7 +4361,7 @@ static void dump_aux_class_special(FILE *fff)
                char s[EATER_EXT][MAX_NLEN];
                OBJECT_TYPE_VALUE tval;
                int ext;
-               IDX k_idx;
+               KIND_OBJECT_IDX k_idx;
                OBJECT_SUBTYPE_VALUE i;
                int magic_num;
 
@@ -5021,7 +5016,7 @@ errr make_character_dump(FILE *fff)
  * @param name 出力ファイル名
  * @return エラーコード
  * @details
- * XXX XXX XXX Allow the "full" flag to dump additional info,
+ * Allow the "full" flag to dump additional info,
  * and trigger its usage from various places in the code.
  */
 errr file_character(cptr name)
@@ -5060,7 +5055,6 @@ errr file_character(cptr name)
        /* Invalid file */
        if (!fff)
        {
-               /* Message */
                prt(_("キャラクタ情報のファイルへの書き出しに失敗しました!", "Character dump failed!"), 0, 0);
 
                (void)inkey();
@@ -5075,7 +5069,6 @@ errr file_character(cptr name)
        my_fclose(fff);
 
 
-       /* Message */
        msg_print(_("キャラクタ情報のファイルへの書き出しに成功しました。", "Character dump successful."));
        msg_print(NULL);
 
@@ -5318,7 +5311,7 @@ bool show_file(bool show_version, cptr name, cptr what, int line, BIT_FLAGS mode
        /* Redirect the name */
        name = filename;
 
-       /* Hack XXX XXX XXX */
+       /* Hack */
        if (what)
        {
                /* Caption */
@@ -5374,14 +5367,11 @@ bool show_file(bool show_version, cptr name, cptr what, int line, BIT_FLAGS mode
                fff = my_fopen(path, "r");
        }
 
-       /* Oops */
        if (!fff)
        {
-               /* Message */
                msg_format(_("'%s'をオープンできません。", "Cannot open '%s'."), name);
                msg_print(NULL);
 
-               /* Oops */
                return (TRUE);
        }
 
@@ -5460,7 +5450,6 @@ bool show_file(bool show_version, cptr name, cptr what, int line, BIT_FLAGS mode
                        /* Hack -- Re-Open the file */
                        fff = my_fopen(path, "r");
 
-                       /* Oops */
                        if (!fff) return (FALSE);
 
                        /* File has been restarted */
@@ -5746,7 +5735,6 @@ bool show_file(bool show_version, cptr name, cptr what, int line, BIT_FLAGS mode
 
                        ffp = my_fopen(buff, "w");
 
-                       /* Oops */
                        if (!(fff && ffp))
                        {
                                msg_print(_("ファイルを開けません。", "Failed to open file."));
@@ -5976,7 +5964,7 @@ void process_player_name(bool sf)
  * Assumes that "display_player(0)" has just been called
  * Perhaps we should NOT ask for a name (at "birth()") on
  * Unix machines?  XXX XXX
- * What a horrible name for a global function.  XXX XXX XXX
+ * What a horrible name for a global function.  
  * </pre>
  */
 void get_name(void)
@@ -6128,7 +6116,6 @@ void do_cmd_save_game(int is_autosave)
        /* Handle stuff */
        handle_stuff();
 
-       /* Message */
        prt(_("ゲームをセーブしています...", "Saving game..."), 0, 0);
 
        /* Refresh */
@@ -6164,7 +6151,6 @@ void do_cmd_save_game(int is_autosave)
        /* HACK -- don't get sanity blast on updating view */
        is_loading_now = FALSE;
 
-       /* Update stuff */
        update_stuff();
 
        /* Initialize monster process */
@@ -6304,7 +6290,7 @@ static void make_bones(void)
                {
                        char tmp[128];
 
-                       /* XXX XXX XXX "Bones" name */
+                       /* "Bones" name */
                        sprintf(tmp, "bone.%03d", dun_level);
 
                        /* Build the filename */
@@ -6897,7 +6883,7 @@ void close_game(void)
                /* Save the game */
                do_cmd_save_game(FALSE);
 
-               /* Prompt for scores XXX XXX XXX */
+               /* Prompt for scores */
                prt(_("リターンキーか ESC キーを押して下さい。", "Press Return (or Escape)."), 0, 40);
                play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_EXIT);
 
@@ -7482,7 +7468,6 @@ static void handle_signal_abort(int sig)
        _("恐ろしいソフトのバグが飛びかかってきた!", "A gruesome software bug LEAPS out at you!"));
 
 
-       /* Message */
        Term_putstr(45, hgt - 1, -1, TERM_RED, _("緊急セーブ...", "Panic save..."));
 
        do_cmd_write_nikki(NIKKI_GAMESTART, 0, _("----ゲーム異常終了----", "---- Panic Save and Abort Game ----"));