From 2ae9cead74e1430de3fde91f559021f37362c2f6 Mon Sep 17 00:00:00 2001 From: Deskull Date: Tue, 18 Dec 2018 22:28:27 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E3=82=B3=E3=83=A1?= =?utf8?q?=E3=83=B3=E3=83=88=E6=95=B4=E7=90=86=20/=20Refactor=20comments.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/autopick.c | 2 -- src/chuukei.c | 2 -- src/cmd4.c | 37 +++---------------------------------- src/files.c | 10 ---------- src/init1.c | 2 -- src/load.c | 4 ---- src/mutation.c | 2 -- src/report.c | 4 ---- src/save.c | 3 --- 9 files changed, 3 insertions(+), 63 deletions(-) diff --git a/src/autopick.c b/src/autopick.c index eb56fbc3a..a0e601e4b 100644 --- a/src/autopick.c +++ b/src/autopick.c @@ -2013,8 +2013,6 @@ bool autopick_autoregister(object_type *o_ptr) /* Add a line to the file */ /* Don't kill "entry" */ fprintf(pref_fff, "%s\n", autopick_line_from_entry(entry)); - - /* Close the file */ fclose(pref_fff); return TRUE; diff --git a/src/chuukei.c b/src/chuukei.c index f4a193463..e6b29e018 100644 --- a/src/chuukei.c +++ b/src/chuukei.c @@ -669,8 +669,6 @@ void prepare_movie_hooks(void) if (fd >= 0) { char out_val[160]; - - /* Close the file */ (void)fd_close(fd); /* Build query */ diff --git a/src/cmd4.c b/src/cmd4.c index 3bd9de8dd..531562187 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -4881,8 +4881,6 @@ static void do_cmd_knowledge_inven(void) do_cmd_knowledge_inven_aux(fff, &st_ptr->stock[i], &j, tval, where); } } - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -5462,8 +5460,6 @@ static void do_cmd_knowledge_artifacts(void) /* Free the "okay" array */ C_KILL(okay, max_a_idx, bool); - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -5589,8 +5585,6 @@ static void do_cmd_knowledge_uniques(void) /* Free the "who" array */ C_KILL(who, max_r_idx, s16b); - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -5647,8 +5641,6 @@ static void do_cmd_knowledge_weapon_exp(void) } } } - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -5737,8 +5729,6 @@ static void do_cmd_knowledge_spell_exp(void) fprintf(fff, "\n"); } } - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -5783,8 +5773,6 @@ static void do_cmd_knowledge_skill_exp(void) if (cheat_xtra) fprintf(fff, " %d", skill_exp); fprintf(fff, "\n"); } - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -5975,8 +5963,6 @@ static void do_cmd_knowledge_pets(void) #endif - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -6139,8 +6125,6 @@ static void do_cmd_knowledge_kill_count(void) /* Free the "who" array */ C_KILL(who, max_r_idx, s16b); - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -7700,9 +7684,7 @@ static void do_cmd_knowledge_kubi(void) fprintf(fff,"\n%s\n", _("賞金首はもう残っていません。", "There is no more wanted monster.")); } } - - /* Close the file */ - my_fclose(fff); + my_fclose(fff); /* Display the file contents */ show_file(TRUE, file_name, _("賞金首の一覧", "Wanted monsters"), 0, 0); @@ -7732,9 +7714,7 @@ static void do_cmd_knowledge_virtues(void) fprintf(fff, _("現在の属性 : %s\n\n", "Your alighnment : %s\n\n"), your_alignment()); dump_virtues(fff); } - - /* Close the file */ - my_fclose(fff); + my_fclose(fff); /* Display the file contents */ show_file(TRUE, file_name, _("八つの徳", "Virtues"), 0, 0); @@ -7779,9 +7759,7 @@ static void do_cmd_knowledge_dungeon(void) fprintf(fff, _("%c%-12s : %3d 階\n", "%c%-16s : level %3d\n"), seiha ? '!' : ' ', d_name + d_info[i].name, (int)max_dlv[i]); } } - - /* Close the file */ - my_fclose(fff); + my_fclose(fff); /* Display the file contents */ show_file(TRUE, file_name, _("今までに入ったダンジョン", "Dungeon"), 0, 0); @@ -7832,8 +7810,6 @@ static void do_cmd_knowledge_stat(void) } dump_yourself(fff); - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -8223,8 +8199,6 @@ static void do_cmd_knowledge_quests(void) fputc('\n', fff); do_cmd_knowledge_quests_wiz_random(fff); } - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -8307,8 +8281,6 @@ static void do_cmd_knowledge_home(void) fprintf(fff, "\n\n"); } } - - /* Close the file */ my_fclose(fff); /* Display the file contents */ @@ -8379,7 +8351,6 @@ static void do_cmd_knowledge_autopick(void) string_free(tmp); fprintf(fff, "\n"); } - /* Close the file */ my_fclose(fff); /* Display the file contents */ show_file(TRUE, file_name, _("自動拾い/破壊 設定リスト", "Auto-picker/Destroyer"), 0, 0); @@ -8674,7 +8645,5 @@ void do_cmd_time(void) } msg_print(desc); - - /* Close the file */ my_fclose(fff); } diff --git a/src/files.c b/src/files.c index 54c0bf5dc..418e8622a 100644 --- a/src/files.c +++ b/src/files.c @@ -1179,8 +1179,6 @@ static errr process_pref_file_aux(cptr name, int preftype) msg_format(_("('%s'を解析中)", "Parsing '%s'"), old); msg_print(NULL); } - - /* Close the file */ my_fclose(fp); return (err); } @@ -1463,8 +1461,6 @@ errr check_load_init(void) break; } - - /* Close the file */ my_fclose(fp); #endif @@ -5030,8 +5026,6 @@ errr file_character(cptr name) if (fd >= 0) { char out_val[160]; - - /* Close the file */ (void)fd_close(fd); /* Build query */ @@ -5758,8 +5752,6 @@ bool show_file(bool show_version, cptr name, cptr what, int line, BIT_FLAGS mode /* Exit on the q key */ if (skey == 'q') break; } - - /* Close the file */ my_fclose(fff); /* Escape */ @@ -7033,8 +7025,6 @@ errr get_rnd_line(cptr file_name, int entry, char *output) /* Copy the line */ if (one_in_(counter + 1)) strcpy(output, buf); } - - /* Close the file */ my_fclose(fp); /* Success */ diff --git a/src/init1.c b/src/init1.c index 525dc1631..8b4d290c3 100644 --- a/src/init1.c +++ b/src/init1.c @@ -4829,8 +4829,6 @@ errr process_dungeon_file(cptr name, int ymin, int xmin, int ymax, int xmax) msg_print(NULL); } - - /* Close the file */ my_fclose(fp); return (err); } diff --git a/src/load.c b/src/load.c index 6544cd379..0be7fb432 100644 --- a/src/load.c +++ b/src/load.c @@ -4015,8 +4015,6 @@ errr rd_savefile_new(void) /* Check for errors */ if (ferror(fff)) err = -1; - - /* Close the file */ my_fclose(fff); return (err); } @@ -4163,8 +4161,6 @@ bool load_floor(saved_floor_type *sf_ptr, BIT_FLAGS mode) /* Check for errors */ if (ferror(fff)) ok = FALSE; - - /* Close the file */ my_fclose(fff); /* Grab permissions */ diff --git a/src/mutation.c b/src/mutation.c index 73d46ddd6..0c7797bed 100644 --- a/src/mutation.c +++ b/src/mutation.c @@ -2008,8 +2008,6 @@ void do_cmd_knowledge_mutations(void) /* Dump the mutations to file */ if (fff) dump_mutations(fff); - - /* Close the file */ my_fclose(fff); /* Display the file contents */ diff --git a/src/report.c b/src/report.c index 016762e21..63bf77698 100644 --- a/src/report.c +++ b/src/report.c @@ -287,8 +287,6 @@ static errr make_dump(BUF* dumpbuf) /* 一旦一時ファイルを作る。通常のダンプ出力と共通化するため。 */ (void)make_character_dump(fff); - - /* Close the file */ my_fclose(fff); /* Open for read */ @@ -298,8 +296,6 @@ static errr make_dump(BUF* dumpbuf) { (void)buf_sprintf(dumpbuf, "%s", buf); } - - /* Close the file */ my_fclose(fff); /* Remove the file */ diff --git a/src/save.c b/src/save.c index b6280057f..d51aecef8 100644 --- a/src/save.c +++ b/src/save.c @@ -1824,7 +1824,6 @@ bool load_player(void) /* Oops, lock exists */ if (fkk) { - /* Close the file */ my_fclose(fkk); msg_print(_("セーブファイルは現在使用中です。", "Savefile is currently in use.")); @@ -1872,8 +1871,6 @@ bool load_player(void) /* What */ if (err) what = _("セーブファイルを読めません。", "Cannot read savefile"); - - /* Close the file */ (void)fd_close(fd); } -- 2.11.0