OSDN Git Service

[Refactor] #37353 メッセージ整理。
[hengband/hengband.git] / src / init2.c
index 1a182ee..bfc80aa 100644 (file)
@@ -35,6 +35,7 @@
 #include "angband.h"
 
 #include "init.h"
+#include "trap.h"
 
 #ifndef MACINTOSH
 #ifdef CHECK_MODIFICATION_TIME
@@ -404,7 +405,7 @@ static errr init_info_raw(int fd, header *head)
  * @param len データの長さ
  * @return エラーコード
  */
-static void init_header(header *head, int num, int len)
+static void init_header(header *head, IDX num, int len)
 {
        /* Save the "version" */
        head->v_major = FAKE_VER_MAJOR;
@@ -413,7 +414,7 @@ static void init_header(header *head, int num, int len)
        head->v_extra = 0;
 
        /* Save the "record" information */
-       head->info_num = num;
+       head->info_num = (IDX)num;
        head->info_len = len;
 
        /* Save the size of "*_head" and "*_info" */
@@ -441,7 +442,7 @@ static errr init_info(cptr filename, header *head,
 {
        int fd;
 
-       int mode = 0644;
+       BIT_FLAGS mode = 0644;
 
        errr err = 1;
 
@@ -525,7 +526,6 @@ static errr init_info(cptr filename, header *head,
                        /* Error string */
                        oops = (((err > 0) && (err < PARSE_ERROR_MAX)) ? err_str[err] : "未知の");
 
-                       /* Oops */
                        msg_format("'%s.txt'ファイルの %d 行目にエラー。", filename, error_line);
                        msg_format("レコード %d は '%s' エラーがあります。", error_idx, oops);
                        msg_format("構文 '%s'。", buf);
@@ -537,7 +537,6 @@ static errr init_info(cptr filename, header *head,
                        /* Error string */
                        oops = (((err > 0) && (err < PARSE_ERROR_MAX)) ? err_str[err] : "unknown");
 
-                       /* Oops */
                        msg_format("Error %d at line %d of '%s.txt'.", err, error_line, filename);
                        msg_format("Record %d contains a '%s' error.", error_idx, oops);
                        msg_format("Parsing '%s'.", buf);
@@ -1579,10 +1578,10 @@ static errr init_quests(void)
        /*** Prepare the quests ***/
 
        /* Allocate the quests */
-       C_MAKE(quest, max_quests, quest_type);
+       C_MAKE(quest, max_q_idx, quest_type);
 
        /* Set all quest to "untaken" */
-       for (i = 0; i < max_quests; i++)
+       for (i = 0; i < max_q_idx; i++)
        {
                quest[i].status = QUEST_STATUS_UNTAKEN;
        }
@@ -1600,7 +1599,7 @@ static bool feat_tag_is_not_found = FALSE;
  */
 s16b f_tag_to_index_in_init(cptr str)
 {
-       s16b feat = f_tag_to_index(str);
+       FEAT_IDX feat = f_tag_to_index(str);
 
        if (feat < 0) feat_tag_is_not_found = TRUE;
 
@@ -2177,7 +2176,7 @@ static void note(cptr str)
  * @return なし
  * @note
  * <pre>
- * XXX XXX XXX This function is "messy" because various things
+ * This function is "messy" because various things
  * may or may not be initialized, but the "plog()" and "quit()"
  * functions are "supposed" to work under any conditions.
  * </pre>
@@ -2222,7 +2221,7 @@ static void init_angband_aux(cptr why)
  * @return なし
  * @note
  * <pre>
- * XXX XXX XXX This function is "messy" because various things
+ * This function is "messy" because various things
  * may or may not be initialized, but the "plog()" and "quit()"
  * functions are "supposed" to work under any conditions.
  * Verify some files, display the "news.txt" file, create
@@ -2266,7 +2265,7 @@ void init_angband(void)
 {
        int fd = -1;
 
-       int mode = 0664;
+       BIT_FLAGS mode = 0664;
 
        FILE *fp;
 
@@ -2286,7 +2285,6 @@ void init_angband(void)
        {
                char why[1024];
 
-               /* Message */
                sprintf(why, _("'%s'ファイルにアクセスできません!", "Cannot access the '%s' file!"), buf);
 
                /* Crash and burn */
@@ -2356,7 +2354,6 @@ void init_angband(void)
                {
                        char why[1024];
 
-                       /* Message */
                        sprintf(why, _("'%s'ファイルを作成できません!", "Cannot create the '%s' file!"), buf);
 
                        /* Crash and burn */
@@ -2476,7 +2473,6 @@ void init_angband(void)
        /* Process that file */
        process_pref_file(buf);
 
-       /* Done */
        note(_("[初期化終了]", "[Initialization complete]"));
 }