OSDN Git Service

[Refactor] #3358 destroy_type に初期値を追加し、もって構造体未初期化警告に対応した
authorHourier <66951241+Hourier@users.noreply.github.com>
Tue, 6 Jun 2023 14:53:46 +0000 (23:53 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Thu, 8 Jun 2023 11:26:46 +0000 (20:26 +0900)
src/cmd-item/cmd-destroy.cpp

index 99fa8b8..3474c04 100644 (file)
 #include "view/display-messages.h"
 
 struct destroy_type {
-    OBJECT_IDX item;
-    QUANTITY amt;
-    QUANTITY old_number;
-    bool force;
-    ItemEntity *o_ptr;
-    ItemEntity *q_ptr;
-    std::string item_name;
-    char out_val[MAX_NLEN + 40];
+    OBJECT_IDX item = 0;
+    QUANTITY amt = 0;
+    QUANTITY old_number = 0;
+    bool force = false;
+    ItemEntity *o_ptr = nullptr;
+    ItemEntity *q_ptr = nullptr;
+    std::string item_name = "";
+    char out_val[MAX_NLEN + 40]{};
 };
 
 static destroy_type *initialize_destroy_type(destroy_type *destroy_ptr, ItemEntity *o_ptr)