OSDN Git Service

[Refactor] #37353 配列用ポインタ town を他の慣例に従い town_info に改名。 / Rename town pointer to town_...
authorDeskull <deskull@users.sourceforge.jp>
Sat, 9 Feb 2019 10:10:03 +0000 (19:10 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sat, 9 Feb 2019 10:10:03 +0000 (19:10 +0900)
15 files changed:
src/bldg.c
src/cmd4.c
src/dungeon.c
src/externs.h
src/files.c
src/init2.c
src/load.c
src/rumor.c
src/save.c
src/store.c
src/variable.c
src/view-mainwindow.c
src/wild.c
src/wizard1.c
src/xtra2.c

index 46e20b4..e701c87 100644 (file)
@@ -3671,7 +3671,7 @@ bool tele_town(void)
 
                if ((i == NO_TOWN) || (i == SECRET_TOWN) || (i == p_ptr->town_num) || !(p_ptr->visit & (1L << (i - 1)))) continue;
 
-               sprintf(buf, "%c) %-20s", I2A(i - 1), town[i].name);
+               sprintf(buf, "%c) %-20s", I2A(i - 1), town_info[i].name);
                prt(buf, 5 + i, 5);
                num++;
        }
index 511c264..dd8d92b 100644 (file)
@@ -3866,7 +3866,7 @@ void do_cmd_feeling(void)
        /* No useful feeling in town */
        else if (p_ptr->town_num && !dun_level)
        {
-               if (!strcmp(town[p_ptr->town_num].name, _("荒野", "wilderness")))
+               if (!strcmp(town_info[p_ptr->town_num].name, _("荒野", "wilderness")))
                {
                        msg_print(_("何かありそうな荒野のようだ。", "Looks like a strange wilderness."));
                        return;
@@ -4800,7 +4800,7 @@ static void do_cmd_knowledge_inven(void)
                        do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
                }
 
-               st_ptr = &town[1].store[STORE_HOME];
+               st_ptr = &town_info[1].store[STORE_HOME];
                strcpy(where, _("家", "H "));
                for (i = 0; i < st_ptr->stock_num; i++)
                {
@@ -8095,7 +8095,7 @@ static void do_cmd_knowledge_home(void)
        if (fff)
        {
                /* Print all homes in the different towns */
-               st_ptr = &town[1].store[STORE_HOME];
+               st_ptr = &town_info[1].store[STORE_HOME];
 
                /* Home -- if anything there */
                if (st_ptr->stock_num)
index eaf1c28..7d16c61 100644 (file)
@@ -6242,7 +6242,7 @@ void prevent_turn_overflow(void)
        {
                for (j = 0; j < MAX_STORES; j++)
                {
-                       store_type *st_ptr = &town[i].store[j];
+                       store_type *st_ptr = &town_info[i].store[j];
 
                        if (st_ptr->last_visit > -10L * TURNS_PER_TICK * STORE_TICKS)
                        {
index 57af6aa..dcb0d23 100644 (file)
@@ -273,7 +273,7 @@ extern monster_type *m_list;
 extern s16b *mproc_list[MAX_MTIMED];
 extern s16b mproc_max[MAX_MTIMED];
 extern u16b max_towns;
-extern town_type *town;
+extern town_type *town_info;
 extern object_type *inventory;
 extern s16b alloc_kind_size;
 extern alloc_entry *alloc_kind_table;
index f13c8d3..1d9bf6c 100644 (file)
@@ -4899,7 +4899,7 @@ static void dump_aux_home_museum(FILE *fff)
        /* process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x); */
 
        /* Print the home */
-       st_ptr = &town[1].store[STORE_HOME];
+       st_ptr = &town_info[1].store[STORE_HOME];
 
        /* Home -- if anything there */
        if (st_ptr->stock_num)
@@ -4924,7 +4924,7 @@ static void dump_aux_home_museum(FILE *fff)
 
 
        /* Print the home */
-       st_ptr = &town[1].store[STORE_MUSEUM];
+       st_ptr = &town_info[1].store[STORE_MUSEUM];
 
        /* Home -- if anything there */
        if (st_ptr->stock_num)
@@ -6546,7 +6546,7 @@ static void show_info(void)
 
        for (i = 1; i < max_towns; i++)
        {
-               st_ptr = &town[i].store[STORE_HOME];
+               st_ptr = &town_info[i].store[STORE_HOME];
 
                /* Hack -- Know everything in the home */
                for (j = 0; j < st_ptr->stock_num; j++)
@@ -6634,7 +6634,7 @@ static void show_info(void)
        /* Homes in the different towns */
        for (l = 1; l < max_towns; l++)
        {
-               st_ptr = &town[l].store[STORE_HOME];
+               st_ptr = &town_info[l].store[STORE_HOME];
 
                /* Home -- if anything there */
                if (st_ptr->stock_num)
index a672898..4350e13 100644 (file)
@@ -887,20 +887,20 @@ static errr init_towns(void)
        /*** Prepare the Towns ***/
 
        /* Allocate the towns */
-       C_MAKE(town, max_towns, town_type);
+       C_MAKE(town_info, max_towns, town_type);
 
        for (i = 1; i < max_towns; i++)
        {
                /*** Prepare the Stores ***/
 
                /* Allocate the stores */
-               C_MAKE(town[i].store, MAX_STORES, store_type);
+               C_MAKE(town_info[i].store, MAX_STORES, store_type);
 
                /* Fill in each store */
                for (j = 0; j < MAX_STORES; j++)
                {
                        /* Access the store */
-                       store_type *st_ptr = &town[i].store[j];
+                       store_type *st_ptr = &town_info[i].store[j];
 
                        if ((i > 1) && (j == STORE_MUSEUM || j == STORE_HOME)) continue;
 
index 3acf8a0..f97a04a 100644 (file)
@@ -1374,12 +1374,12 @@ static errr rd_store(int town_number, int store_number)
 
        if (z_older_than(10, 3, 3) && (store_number == STORE_HOME))
        {
-               st_ptr = &town[1].store[store_number];
+               st_ptr = &town_info[1].store[store_number];
                if (st_ptr->stock_num) sort = TRUE;
        }
        else
        {
-               st_ptr = &town[town_number].store[store_number];
+               st_ptr = &town_info[town_number].store[store_number];
        }
 
        /* Read the basic info */
index 4ca6c2a..a2f3c7b 100644 (file)
@@ -123,10 +123,10 @@ void display_rumor(bool ex)
                                while (1)
                                {
                                        t_idx = rumor_num(zz[1], NO_TOWN);
-                                       if (town[t_idx].name) break;
+                                       if (town_info[t_idx].name) break;
                                }
 
-                               strcpy(fullname, town[t_idx].name);
+                               strcpy(fullname, town_info[t_idx].name);
 
                                visit = (1L << (t_idx - 1));
                                if ((t_idx != SECRET_TOWN) && !(p_ptr->visit & visit))
index 5070eb6..62a9059 100644 (file)
@@ -1496,7 +1496,7 @@ static bool wr_savefile_new(void)
        {
                for (j = 0; j < MAX_STORES; j++)
                {
-                       wr_store(&town[i].store[j]);
+                       wr_store(&town_info[i].store[j]);
                }
        }
 
index fc0474e..7223197 100644 (file)
@@ -2844,7 +2844,7 @@ bool combine_and_reorder_home(int store_num)
        bool        old_stack_force_notes = stack_force_notes;
        bool        old_stack_force_costs = stack_force_costs;
 
-       st_ptr = &town[1].store[store_num];
+       st_ptr = &town_info[1].store[store_num];
        if (store_num != STORE_HOME)
        {
                stack_force_notes = FALSE;
@@ -3287,9 +3287,9 @@ static bool black_market_crap(object_type *o_ptr)
                if (i == STORE_MUSEUM) continue;
 
                /* Check every item in the store */
-               for (j = 0; j < town[p_ptr->town_num].store[i].stock_num; j++)
+               for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
                {
-                       object_type *j_ptr = &town[p_ptr->town_num].store[i].stock[j];
+                       object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
 
                        /* Duplicate item "type", assume crappy */
                        if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
@@ -5779,7 +5779,7 @@ void do_cmd_store(void)
        inner_town_num = p_ptr->town_num;
 
        /* Hack -- Check the "locked doors" */
-       if ((town[p_ptr->town_num].store[which].store_open >= turn) ||
+       if ((town_info[p_ptr->town_num].store[which].store_open >= turn) ||
            (ironman_shops))
        {
                msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
@@ -5788,7 +5788,7 @@ void do_cmd_store(void)
        }
 
        /* Calculate the number of store maintainances since the last visit */
-       maintain_num = (turn - town[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
+       maintain_num = (turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
 
        /* Maintain the store max. 10 times */
        if (maintain_num > 10) maintain_num = 10;
@@ -5800,7 +5800,7 @@ void do_cmd_store(void)
                        store_maint(p_ptr->town_num, which);
 
                /* Save the visit */
-               town[p_ptr->town_num].store[which].last_visit = turn;
+               town_info[p_ptr->town_num].store[which].last_visit = turn;
        }
 
        forget_lite();
@@ -5824,7 +5824,7 @@ void do_cmd_store(void)
        cur_store_feat = c_ptr->feat;
 
        /* Save the store and owner pointers */
-       st_ptr = &town[p_ptr->town_num].store[cur_store_num];
+       st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
        ot_ptr = &owners[cur_store_num][st_ptr->owner];
 
        /* Start at the beginning */
@@ -6037,7 +6037,7 @@ void store_shuffle(int which)
        cur_store_num = which;
 
        /* Activate that store */
-       st_ptr = &town[p_ptr->town_num].store[cur_store_num];
+       st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
 
        j = st_ptr->owner;
        /* Pick a new owner */
@@ -6048,7 +6048,7 @@ void store_shuffle(int which)
                for (i = 1;i < max_towns; i++)
                {
                        if (i == p_ptr->town_num) continue;
-                       if (st_ptr->owner == town[i].store[cur_store_num].owner) break;
+                       if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
                }
                if (i == max_towns) break;
        }
@@ -6104,7 +6104,7 @@ void store_maint(int town_num, int store_num)
        if (store_num == STORE_MUSEUM) return;
 
        /* Activate that store */
-       st_ptr = &town[town_num].store[store_num];
+       st_ptr = &town_info[town_num].store[store_num];
 
        /* Activate the owner */
        ot_ptr = &owners[store_num][st_ptr->owner];
@@ -6183,7 +6183,7 @@ void store_init(int town_num, int store_num)
        cur_store_num = store_num;
 
        /* Activate that store */
-       st_ptr = &town[town_num].store[store_num];
+       st_ptr = &town_info[town_num].store[store_num];
 
 
        /* Pick an owner */
@@ -6195,7 +6195,7 @@ void store_init(int town_num, int store_num)
                for (i = 1;i < max_towns; i++)
                {
                        if (i == town_num) continue;
-                       if (st_ptr->owner == town[i].store[store_num].owner) break;
+                       if (st_ptr->owner == town_info[i].store[store_num].owner) break;
                }
                if (i == max_towns) break;
        }
@@ -6237,7 +6237,7 @@ void move_to_black_market(object_type *o_ptr)
        /* Not in town */
        if (!p_ptr->town_num) return;
 
-       st_ptr = &town[p_ptr->town_num].store[STORE_BLACK];
+       st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
 
        o_ptr->ident |= IDENT_STORE;
 
index c8cfedf..5913986 100644 (file)
@@ -512,7 +512,7 @@ u16b max_towns;
 /*
  * The towns [max_towns]
  */
-town_type *town;
+town_type *town_info;
 
 
 /*
index 3e466e9..6dc026f 100644 (file)
@@ -160,7 +160,7 @@ concptr map_name(void)
        else if (p_ptr->inside_battle)
                return _("闘技場", "Monster Arena");
        else if (!dun_level && p_ptr->town_num)
-               return town[p_ptr->town_num].name;
+               return town_info[p_ptr->town_num].name;
        else
                return d_name+d_info[p_ptr->dungeon_idx].name;
 }
index d16af0d..26aa5a9 100644 (file)
@@ -853,7 +853,7 @@ errr parse_line_wilderness(char *buf, int ymin, int xmin, int ymax, int xmax, in
                        wilderness[*y][*x].level = w_letter[id].level;
                        wilderness[*y][*x].town = w_letter[id].town;
                        wilderness[*y][*x].road = w_letter[id].road;
-                       strcpy(town[w_letter[id].town].name, w_letter[id].name);
+                       strcpy(town_info[w_letter[id].town].name, w_letter[id].name);
                }
                
                (*y)++;
index e89c724..a720b38 100644 (file)
@@ -2643,7 +2643,7 @@ void spoil_random_artifact(concptr fname)
                }
 
                /* random artifacts in home */
-               st_ptr = &town[1].store[STORE_HOME];
+               st_ptr = &town_info[1].store[STORE_HOME];
                for (i = 0; i < st_ptr->stock_num; i++)
                {
                        q_ptr = &st_ptr->stock[i];
@@ -2651,7 +2651,7 @@ void spoil_random_artifact(concptr fname)
                }
 
                /* random artifacts in museum */
-               st_ptr = &town[1].store[STORE_MUSEUM];
+               st_ptr = &town_info[1].store[STORE_MUSEUM];
                for (i = 0; i < st_ptr->stock_num; i++)
                {
                        q_ptr = &st_ptr->stock[i];
index d6cf5c9..ab5e716 100644 (file)
@@ -1362,7 +1362,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
                }
                else if (have_flag(f_ptr->flags, FF_TOWN))
                {
-                       name = town[c_ptr->special].name;
+                       name = town_info[c_ptr->special].name;
                }
                else if (p_ptr->wild_mode && (feat == feat_floor))
                {