• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision3ef4a5e71ac786870914da5ef3c8f4e9dd74ca4f (tree)
Time2019-06-17 23:11:03
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #39076 冗長なコメントを削除 (/* Build the filename */)

Change Summary

Incremental Difference

--- a/src/autopick.c
+++ b/src/autopick.c
@@ -2903,8 +2903,6 @@ static bool write_text_lines(concptr filename, concptr *lines_list)
29032903
29042904 int lines = 0;
29052905 char buf[1024];
2906-
2907- /* Build the filename */
29082906 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, filename);
29092907
29102908 /* Open the file */
--- a/src/cmd-dump.c
+++ b/src/cmd-dump.c
@@ -438,8 +438,6 @@ errr do_cmd_write_nikki(int type, int num, concptr note)
438438
439439 /* different filne name to avoid mixing */
440440 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
441-
442- /* Build the filename */
443441 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
444442
445443 /* File type is "TEXT" */
@@ -831,8 +829,6 @@ static void do_cmd_disp_nikki(void)
831829 "Quest of The World's Greatest Brain"};
832830 #endif
833831 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
834-
835- /* Build the filename */
836832 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
837833
838834 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
@@ -901,8 +897,6 @@ static void do_cmd_erase_nikki(void)
901897
902898 if (!get_check(_("本当に記録を消去しますか?", "Do you really want to delete all your record? "))) return;
903899 sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
904-
905- /* Build the filename */
906900 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
907901 fd_kill(buf);
908902
@@ -1400,8 +1394,6 @@ static errr macro_dump(concptr fname)
14001394 int i;
14011395
14021396 char buf[1024];
1403-
1404- /* Build the filename */
14051397 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
14061398
14071399 /* File type is "TEXT" */
@@ -1556,8 +1548,6 @@ static errr keymap_dump(concptr fname)
15561548 mode = KEYMAP_MODE_ORIG;
15571549 }
15581550
1559-
1560- /* Build the filename */
15611551 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
15621552
15631553 /* File type is "TEXT" */
@@ -2154,8 +2144,6 @@ void do_cmd_visuals(void)
21542144
21552145 /* Get a filename */
21562146 if (!askfor(tmp, 70)) continue;
2157-
2158- /* Build the filename */
21592147 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
21602148
21612149 /* Append to the file */
@@ -2205,8 +2193,6 @@ void do_cmd_visuals(void)
22052193
22062194 /* Get a filename */
22072195 if (!askfor(tmp, 70)) continue;
2208-
2209- /* Build the filename */
22102196 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
22112197
22122198 /* Append to the file */
@@ -2272,8 +2258,6 @@ void do_cmd_visuals(void)
22722258
22732259 /* Get a filename */
22742260 if (!askfor(tmp, 70)) continue;
2275-
2276- /* Build the filename */
22772261 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
22782262
22792263 /* Append to the file */
@@ -2728,8 +2712,6 @@ void do_cmd_colors(void)
27282712
27292713 /* Get a filename */
27302714 if (!askfor(tmp, 70)) continue;
2731-
2732- /* Build the filename */
27332715 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
27342716
27352717 /* Append to the file */
@@ -3619,8 +3601,6 @@ void do_cmd_load_screen(void)
36193601 TERM_LEN wid, hgt;
36203602
36213603 Term_get_size(&wid, &hgt);
3622-
3623- /* Build the filename */
36243604 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
36253605
36263606 /* Append to the file */
@@ -3924,8 +3904,6 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
39243904 return;
39253905 }
39263906 if (message) screen_save();
3927-
3928- /* Build the filename */
39293907 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
39303908 tmpfff = my_fopen(buf, "r");
39313909 if (!tmpfff) {
@@ -4032,8 +4010,6 @@ static void do_cmd_save_screen_html(void)
40324010
40334011 if (!get_string(_("ファイル名: ", "File name: "), tmp, 80))
40344012 return;
4035-
4036- /* Build the filename */
40374013 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
40384014
40394015 msg_print(NULL);
@@ -4105,8 +4081,6 @@ void do_cmd_save_screen(void)
41054081 SYMBOL_CODE c = ' ';
41064082 FILE *fff;
41074083 char buf[1024];
4108-
4109- /* Build the filename */
41104084 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
41114085
41124086 /* File type is "TEXT" */
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -556,8 +556,6 @@ void exe_read(INVENTORY_IDX item, bool known)
556556
557557 /* Display object description */
558558 object_desc(o_name, o_ptr, OD_NAME_ONLY);
559-
560- /* Build the filename */
561559 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
562560
563561 /* Peruse the help file */
--- a/src/core.c
+++ b/src/core.c
@@ -5314,8 +5314,6 @@ void play_game(bool new_game)
53145314
53155315 /* Hack -- Character is now "icky" */
53165316 current_world_ptr->character_icky = TRUE;
5317-
5318- /* Build the filename */
53195317 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
53205318
53215319 /* Open the high score file, for reading/writing */
@@ -5783,8 +5781,6 @@ void close_game(void)
57835781 /* Hack -- Character is now "icky" */
57845782 current_world_ptr->character_icky = TRUE;
57855783
5786-
5787- /* Build the filename */
57885784 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
57895785
57905786 /* Grab permissions */
--- a/src/dungeon-file.c
+++ b/src/dungeon-file.c
@@ -4917,8 +4917,6 @@ errr process_dungeon_file(concptr name, int ymin, int xmin, int ymax, int xmax)
49174917 bool bypass = FALSE;
49184918 int x = xmin, y = ymin;
49194919
4920-
4921- /* Build the filename */
49224920 path_build(buf, sizeof(buf), ANGBAND_DIR_EDIT, name);
49234921
49244922 /* Open the file */
--- a/src/files.c
+++ b/src/files.c
@@ -1274,8 +1274,6 @@ errr process_pref_file(concptr name)
12741274 char buf[1024];
12751275
12761276 errr err1, err2;
1277-
1278- /* Build the filename */
12791277 path_build(buf, sizeof(buf), ANGBAND_DIR_PREF, name);
12801278
12811279 /* Process the system pref file */
@@ -1284,8 +1282,6 @@ errr process_pref_file(concptr name)
12841282 /* Stop at parser errors, but not at non-existing file */
12851283 if (err1 > 0) return err1;
12861284
1287-
1288- /* Build the filename */
12891285 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
12901286
12911287 /* Process the user pref file */
@@ -1370,8 +1366,6 @@ errr check_time_init(void)
13701366
13711367 char buf[1024];
13721368
1373-
1374- /* Build the filename */
13751369 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "time.txt");
13761370
13771371 /* Open the file */
@@ -1496,8 +1490,6 @@ errr check_load_init(void)
14961490 char temphost[MAXHOSTNAMELEN+1];
14971491 char thishost[MAXHOSTNAMELEN+1];
14981492
1499-
1500- /* Build the filename */
15011493 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "load.txt");
15021494
15031495 /* Open the "load" file */
@@ -5051,8 +5043,6 @@ errr file_character(concptr name)
50515043 int fd = -1;
50525044 FILE *fff = NULL;
50535045 char buf[1024];
5054-
5055- /* Build the filename */
50565046 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
50575047
50585048 /* File type is "TEXT" */
@@ -5352,8 +5342,6 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG
53525342 {
53535343 /* Caption */
53545344 sprintf(caption, _("ヘルプ・ファイル'%s'", "Help file '%s'"), name);
5355-
5356- /* Build the filename */
53575345 path_build(path, sizeof(path), ANGBAND_DIR_HELP, name);
53585346
53595347 /* Open the file */
@@ -5365,8 +5353,6 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG
53655353 {
53665354 /* Caption */
53675355 sprintf(caption, _("スポイラー・ファイル'%s'", "Info file '%s'"), name);
5368-
5369- /* Build the filename */
53705356 path_build(path, sizeof(path), ANGBAND_DIR_INFO, name);
53715357
53725358 /* Open the file */
@@ -5376,7 +5362,6 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG
53765362 /* Look in "info" */
53775363 if (!fff)
53785364 {
5379- /* Build the filename */
53805365 path_build(path, sizeof(path), ANGBAND_DIR, name);
53815366
53825367 for (i = 0; path[i]; i++)
@@ -5744,8 +5729,6 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG
57445729
57455730 if (!get_string(_("ファイル名: ", "File name: "), xtmp, 80)) continue;
57465731 my_fclose(fff);
5747-
5748- /* Build the filename */
57495732 path_build(buff, sizeof(buff), ANGBAND_DIR_USER, xtmp);
57505733
57515734 /* Hack -- Re-Open the file */
@@ -5953,8 +5936,6 @@ void process_player_name(bool sf)
59535936 /* Rename the savefile, using the p_ptr->base_name */
59545937 (void)sprintf(temp, "%s", p_ptr->base_name);
59555938 #endif
5956-
5957- /* Build the filename */
59585939 path_build(savefile, sizeof(savefile), ANGBAND_DIR_SAVE, temp);
59595940 }
59605941
@@ -6148,8 +6129,6 @@ static void make_bones(void)
61486129
61496130 /* "Bones" name */
61506131 sprintf(tmp, "bone.%03d", current_floor_ptr->dun_level);
6151-
6152- /* Build the filename */
61536132 path_build(str, sizeof(str), ANGBAND_DIR_BONE, tmp);
61546133
61556134 /* Attempt to open the bones file */
@@ -6226,8 +6205,6 @@ void print_tomb(void)
62266205 int extra_line = 0;
62276206 #endif
62286207 Term_clear();
6229-
6230- /* Build the filename */
62316208 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("dead_j.txt", "dead.txt"));
62326209
62336210 /* Open the News file */
@@ -6620,8 +6597,6 @@ errr get_rnd_line(concptr file_name, int entry, char *output)
66206597 int counter, test;
66216598 int line_num = 0;
66226599
6623-
6624- /* Build the filename */
66256600 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, file_name);
66266601
66276602 /* Open the file */
@@ -6749,8 +6724,6 @@ errr process_autopick_file(concptr name)
67496724 char buf[1024];
67506725
67516726 errr err = 0;
6752-
6753- /* Build the filename */
67546727 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
67556728
67566729 err = process_pref_file_aux(buf, PREF_TYPE_AUTOPICK);
@@ -6770,8 +6743,6 @@ errr process_histpref_file(concptr name)
67706743 char buf[1024];
67716744 errr err = 0;
67726745 bool old_character_xtra = current_world_ptr->character_xtra;
6773-
6774- /* Build the filename */
67756746 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
67766747
67776748 /* Hack -- prevent modification birth options in this file */
--- a/src/init.c
+++ b/src/init.c
@@ -312,8 +312,6 @@ static errr check_modification_date(int fd, concptr template_file)
312312 char buf[1024];
313313
314314 struct stat txt_stat, raw_stat;
315-
316- /* Build the filename */
317315 path_build(buf, sizeof(buf), ANGBAND_DIR_EDIT, template_file);
318316
319317 /* Access stats on text file */
@@ -477,8 +475,6 @@ static errr init_info(concptr filename, header *head,
477475 #ifdef ALLOW_TEMPLATES
478476
479477 /*** Load the binary image file ***/
480-
481- /* Build the filename */
482478 path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format(_("%s_j.raw", "%s.raw"), filename));
483479
484480
@@ -521,8 +517,6 @@ static errr init_info(concptr filename, header *head,
521517
522518 /*** Load the ascii template file ***/
523519
524- /* Build the filename */
525-
526520 path_build(buf, sizeof(buf), ANGBAND_DIR_EDIT, format("%s.txt", filename));
527521
528522 /* Open the file */
@@ -579,8 +573,6 @@ static errr init_info(concptr filename, header *head,
579573
580574 /* File type is "DATA" */
581575 FILE_TYPE(FILE_TYPE_DATA);
582-
583- /* Build the filename */
584576 path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format(_("%s_j.raw", "%s.raw"), filename));
585577
586578
@@ -633,8 +625,6 @@ static errr init_info(concptr filename, header *head,
633625
634626
635627 /*** Load the binary image file ***/
636-
637- /* Build the filename */
638628 path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format(_("%s_j.raw", "%s.raw"), filename));
639629
640630 /* Attempt to open the "raw" file */
@@ -1728,8 +1718,6 @@ void init_angband(void)
17281718
17291719
17301720 /*** Verify the "news" file ***/
1731-
1732- /* Build the filename */
17331721 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
17341722
17351723 /* Attempt to open the file */
@@ -1750,8 +1738,6 @@ void init_angband(void)
17501738
17511739 /*** Display the "news" file ***/
17521740 Term_clear();
1753-
1754- /* Build the filename */
17551741 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
17561742
17571743 /* Open the News file */
@@ -1778,8 +1764,6 @@ void init_angband(void)
17781764
17791765
17801766 /*** Verify (or create) the "high score" file ***/
1781-
1782- /* Build the filename */
17831767 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
17841768
17851769 /* Attempt to open the high score file */
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -3982,8 +3982,6 @@ static void process_menus(WORD wCmd)
39823982 case IDM_FILE_SCORE:
39833983 {
39843984 char buf[1024];
3985-
3986- /* Build the filename */
39873985 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
39883986
39893987 /* Open the binary high score file, for reading */
@@ -5590,8 +5588,6 @@ static void init_stuff(void)
55905588 validate_dir(ANGBAND_DIR_SAVE, FALSE);
55915589 validate_dir(ANGBAND_DIR_USER, TRUE);
55925590 validate_dir(ANGBAND_DIR_XTRA, TRUE);
5593-
5594- /* Build the filename */
55955591 path_build(path, sizeof(path), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
55965592
55975593 /* Hack -- Validate the "news.txt" file */
@@ -5607,8 +5603,6 @@ static void init_stuff(void)
56075603
56085604 /* Validate the "font" directory */
56095605 validate_dir(ANGBAND_DIR_XTRA_FONT, TRUE);
5610-
5611- /* Build the filename */
56125606 path_build(path, sizeof(path), ANGBAND_DIR_XTRA_FONT, "8X13.FON");
56135607
56145608 /* Hack -- Validate the basic font */
--- a/src/scores.c
+++ b/src/scores.c
@@ -407,8 +407,6 @@ void display_scores_aux(int from, int to, int note, high_score *score)
407407 void display_scores(int from, int to)
408408 {
409409 char buf[1024];
410-
411- /* Build the filename */
412410 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
413411
414412 /* Open the binary high score file, for reading */
@@ -688,8 +686,6 @@ void show_highclass(void)
688686 char buf[1024], out_val[256];
689687
690688 screen_save();
691-
692- /* Build the filename */
693689 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
694690
695691 highscore_fd = fd_open(buf, O_RDONLY);
@@ -769,8 +765,6 @@ void race_score(int race_num)
769765 sprintf(tmp_str,_("最高の%s", "The Greatest of all the %s"), race_info[race_num].title);
770766
771767 prt(tmp_str, 5, 15);
772-
773- /* Build the filename */
774768 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
775769
776770 highscore_fd = fd_open(buf, O_RDONLY);
--- a/src/wizard1.c
+++ b/src/wizard1.c
@@ -311,8 +311,6 @@ static void spoil_obj_desc(concptr fname)
311311 char chance[80];
312312 char dam[80];
313313
314-
315- /* Build the filename */
316314 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
317315
318316 /* File type is "TEXT" */
@@ -1606,8 +1604,6 @@ static void spoil_artifact(concptr fname)
16061604 object_type *q_ptr;
16071605 obj_desc_list artifact;
16081606 char buf[1024];
1609-
1610- /* Build the filename */
16111607 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
16121608
16131609 /* File type is "TEXT" */
@@ -1690,8 +1686,6 @@ static void spoil_mon_desc(concptr fname)
16901686 char ac[80];
16911687 char hp[80];
16921688 char exp[80];
1693-
1694- /* Build the filename */
16951689 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
16961690
16971691 /* File type is "TEXT" */
@@ -2024,8 +2018,6 @@ static void spoil_mon_info(concptr fname)
20242018
20252019 u16b why = 2;
20262020 MONRACE_IDX *who;
2027-
2028- /* Build the filename */
20292021 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
20302022
20312023 /* File type is "TEXT" */
@@ -2232,8 +2224,6 @@ static void spoil_mon_evol(concptr fname)
22322224 monster_race *r_ptr;
22332225 int **evol_tree, i, j, n, r_idx;
22342226 int *evol_tree_zero; /* For C_KILL() */
2235-
2236- /* Build the filename */
22372227 path_build(buf, sizeof buf, ANGBAND_DIR_USER, fname);
22382228
22392229 /* File type is "TEXT" */
@@ -2530,8 +2520,6 @@ void spoil_random_artifact(concptr fname)
25302520 object_type *q_ptr;
25312521
25322522 char buf[1024];
2533-
2534- /* Build the filename */
25352523 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
25362524
25372525 /* File type is "TEXT" */
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -1590,8 +1590,6 @@ static void do_cmd_dump_options(void)
15901590 FILE *fff;
15911591 char buf[1024];
15921592 int **exist;
1593-
1594- /* Build the filename */
15951593 path_build(buf, sizeof buf, ANGBAND_DIR_USER, "opt_info.txt");
15961594
15971595 /* File type is "TEXT" */
Show on old repository browser