OSDN Git Service

[Refactor] #39068 display_inven(), display_equip() の item_tester_tval グローバル参照をローカル引数に収める.
authordeskull <deskull@users.sourceforge.jp>
Sat, 15 Jun 2019 01:16:37 +0000 (10:16 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 15 Jun 2019 07:27:41 +0000 (16:27 +0900)
src/object.h
src/player-inventory.c
src/view-mainwindow.c

index 29426fd..cdd4c69 100644 (file)
@@ -415,8 +415,8 @@ extern concptr mention_use(int i);
 extern concptr describe_use(int i);
 extern bool check_book_realm(const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUBTYPE_VALUE book_sval);
 extern bool item_tester_okay(object_type *o_ptr, OBJECT_TYPE_VALUE tval);
-extern void display_inven(void);
-extern void display_equip(void);
+extern void display_inven(OBJECT_TYPE_VALUE tval);
+extern void display_equip(OBJECT_TYPE_VALUE tval);
 extern COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
 extern COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
 extern void toggle_inven_equip(void);
index 98c1b77..cb34143 100644 (file)
@@ -55,7 +55,7 @@ INVENTORY_IDX label_to_equip(int c)
  * Choice window "shadow" of the "show_equip()" function
  * @return なし
  */
-void display_equip(void)
+void display_equip(OBJECT_TYPE_VALUE tval)
 {
        register int i, n;
        object_type *o_ptr;
@@ -70,7 +70,7 @@ void display_equip(void)
        {
                o_ptr = &p_ptr->inventory_list[i];
                tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
-               if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, item_tester_tval))
+               if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, tval))
                {
                        tmp_val[0] = index_to_label(i);
                        tmp_val[1] = ')';
@@ -2072,7 +2072,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode,
                        n2 = I2A(i2);
 
                        /* Redraw if needed */
-                       if (command_see) get_item_label = show_inven(menu_line, mode, item_tester_tval);
+                       if (command_see) get_item_label = show_inven(menu_line, mode, tval);
                }
 
                /* Equipment screen */
@@ -2083,7 +2083,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode,
                        n2 = I2A(e2 - INVEN_RARM);
 
                        /* Redraw if needed */
-                       if (command_see) get_item_label = show_equip(menu_line, mode, item_tester_tval);
+                       if (command_see) get_item_label = show_equip(menu_line, mode, tval);
                }
 
                /* Floor screen */
@@ -3158,7 +3158,7 @@ void py_pickup_floor(bool pickup)
  * Choice window "shadow" of the "show_inven()" function
  * @return なし
  */
-void display_inven(void)
+void display_inven(OBJECT_TYPE_VALUE tval)
 {
        register int i, n, z = 0;
        object_type *o_ptr;
@@ -3180,7 +3180,7 @@ void display_inven(void)
        {
                o_ptr = &p_ptr->inventory_list[i];
                tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
-               if (item_tester_okay(o_ptr, item_tester_tval))
+               if (item_tester_okay(o_ptr, tval))
                {
                        tmp_val[0] = index_to_label(i);
                        tmp_val[1] = ')';
index 0a2bd8b..ebee239 100644 (file)
@@ -1577,7 +1577,7 @@ static void fix_inven(void)
                Term_activate(angband_term[j]);
 
                /* Display p_ptr->inventory_list */
-               display_inven();
+               display_inven(item_tester_tval);
                Term_fresh();
                Term_activate(old);
        }
@@ -1764,7 +1764,7 @@ static void fix_equip(void)
                Term_activate(angband_term[j]);
 
                /* Display equipment */
-               display_equip();
+               display_equip(item_tester_tval);
                Term_fresh();
                Term_activate(old);
        }