OSDN Git Service

[feature] ソースファイルをC++に対応
[hengbandforosx/hengbandosx.git] / src / inventory / item-getter.c
index 40f33c1..e251693 100644 (file)
@@ -61,7 +61,7 @@ static bool check_item_tag_aux(player_type *owner_ptr, item_selection_type *item
     if (!item_tester_okay(owner_ptr, o_ptr, item_selection_ptr->tval) && ((item_selection_ptr->mode & USE_FULL) == 0))
         return FALSE;
 
-    item_selection_ptr->tval = 0;
+    item_selection_ptr->tval = TV_NONE;
     item_tester_hook = NULL;
     command_cmd = 0;
     return TRUE;
@@ -81,7 +81,7 @@ static bool check_item_tag_inventory(player_type *owner_ptr, item_selection_type
         return FALSE;
 
     if (*prev_tag && command_cmd) {
-        
+
         bool flag = FALSE;
         item_use_flag use_flag = (*item_selection_ptr->cp >= INVEN_MAIN_HAND) ? USE_EQUIP : USE_INVEN;
 
@@ -99,7 +99,7 @@ static bool check_item_tag_inventory(player_type *owner_ptr, item_selection_type
         }
 
         *item_selection_ptr->cp = item_selection_ptr->k;
-        item_selection_ptr->tval = 0;
+        item_selection_ptr->tval = TV_NONE;
         item_tester_hook = NULL;
         command_cmd = 0;
         return TRUE;
@@ -108,7 +108,7 @@ static bool check_item_tag_inventory(player_type *owner_ptr, item_selection_type
     if (!get_item_okay(owner_ptr, *item_selection_ptr->cp, item_selection_ptr->tval))
         return FALSE;
 
-    item_selection_ptr->tval = 0;
+    item_selection_ptr->tval = TV_NONE;
     item_tester_hook = NULL;
     command_cmd = 0;
     return TRUE;
@@ -127,7 +127,7 @@ static bool check_item_tag(player_type *owner_ptr, item_selection_type *item_sel
         return FALSE;
 
     if (item_selection_ptr->mode & USE_FORCE && (*item_selection_ptr->cp == INVEN_FORCE)) {
-        item_selection_ptr->tval = 0;
+        item_selection_ptr->tval = TV_NONE;
         item_tester_hook = NULL;
         command_cmd = 0;
         return TRUE;
@@ -295,7 +295,7 @@ bool get_item(player_type *owner_ptr, OBJECT_IDX *cp, concptr pmt, concptr str,
             item_selection_ptr->toggle = !item_selection_ptr->toggle;
         }
 
-        owner_ptr->window |= (PW_INVEN | PW_EQUIP);
+        owner_ptr->window_flags |= (PW_INVEN | PW_EQUIP);
         handle_stuff(owner_ptr);
 
         if (!command_wrk) {
@@ -309,9 +309,10 @@ bool get_item(player_type *owner_ptr, OBJECT_IDX *cp, concptr pmt, concptr str,
         if (!command_wrk) {
             sprintf(item_selection_ptr->out_val, _("持ち物:", "Inven:"));
             if ((item_selection_ptr->i1 <= item_selection_ptr->i2) && !use_menu) {
-                sprintf(item_selection_ptr->tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(item_selection_ptr->i1),
+                char tmp_val[80];
+                sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(item_selection_ptr->i1),
                     index_to_label(item_selection_ptr->i2));
-                strcat(item_selection_ptr->out_val, item_selection_ptr->tmp_val);
+                strcat(item_selection_ptr->out_val, tmp_val);
             }
 
             if (!command_see && !use_menu)
@@ -322,9 +323,10 @@ bool get_item(player_type *owner_ptr, OBJECT_IDX *cp, concptr pmt, concptr str,
         } else {
             sprintf(item_selection_ptr->out_val, _("装備品:", "Equip:"));
             if ((item_selection_ptr->e1 <= item_selection_ptr->e2) && !use_menu) {
-                sprintf(item_selection_ptr->tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(item_selection_ptr->e1),
+                char tmp_val[80];
+                sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(item_selection_ptr->e1),
                     index_to_label(item_selection_ptr->e2));
-                strcat(item_selection_ptr->out_val, item_selection_ptr->tmp_val);
+                strcat(item_selection_ptr->out_val, tmp_val);
             }
 
             if (!command_see && !use_menu)
@@ -603,12 +605,12 @@ bool get_item(player_type *owner_ptr, OBJECT_IDX *cp, concptr pmt, concptr str,
         command_see = FALSE;
     }
 
-    item_selection_ptr->tval = 0;
+    item_selection_ptr->tval = TV_NONE;
     item_tester_hook = NULL;
     if (item_selection_ptr->toggle)
         toggle_inventory_equipment(owner_ptr);
 
-    owner_ptr->window |= (PW_INVEN | PW_EQUIP);
+    owner_ptr->window_flags |= (PW_INVEN | PW_EQUIP);
     handle_stuff(owner_ptr);
     prt("", 0, 0);
     if (item_selection_ptr->oops && str)