OSDN Git Service

[Fix] #2531 VS2022環境でstd::array<T, N> 型の変数宣言でコンパイル警告が出ていたのを解消した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sun, 24 Jul 2022 12:56:40 +0000 (21:56 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sun, 24 Jul 2022 12:56:40 +0000 (21:56 +0900)
src/mind/mind-blue-mage.h
src/mind/mind-elementalist.cpp
src/object-enchant/tr-types.h
src/player/player-skill.cpp
src/util/rng-xoshiro.cpp
src/wizard/wizard-spoiler.cpp

index 732ab09..f7bd9e0 100644 (file)
@@ -13,10 +13,10 @@ enum class BlueMagicType {
 class PlayerType;
 bool do_cmd_cast_learned(PlayerType *player_ptr);
 
-inline constexpr std::array BLUE_MAGIC_TYPE_LIST = {
+inline constexpr std::array<BlueMagicType, 5> BLUE_MAGIC_TYPE_LIST = { {
     BlueMagicType::BOLT,
     BlueMagicType::BALL,
     BlueMagicType::BREATH,
     BlueMagicType::SUMMON,
     BlueMagicType::OTHER,
-};
+} };
index 550df49..c4e3331 100644 (file)
@@ -132,64 +132,64 @@ static element_type_list element_types = {
     {
         ElementRealmType::FIRE, {
             _("炎", "Fire"),
-            { AttributeType::FIRE, AttributeType::HELL_FIRE, AttributeType::PLASMA },
-            { _("火炎", "Fire"), _("業火", "Hell Fire"), _("プラズマ", "Plasma") },
+            { { AttributeType::FIRE, AttributeType::HELL_FIRE, AttributeType::PLASMA } },
+            { { _("火炎", "Fire"), _("業火", "Hell Fire"), _("プラズマ", "Plasma") } },
             { },
         }
     },
     {
         ElementRealmType::ICE, {
             _("氷", "Ice"),
-            { AttributeType::COLD, AttributeType::INERTIAL, AttributeType::TIME },
-            { _("冷気", "Ice"), _("遅鈍", "Inertia"), _("時間逆転", "Time Stream") },
+            { { AttributeType::COLD, AttributeType::INERTIAL, AttributeType::TIME } },
+            { { _("冷気", "Ice"), _("遅鈍", "Inertia"), _("時間逆転", "Time Stream") } },
             { { AttributeType::COLD, AttributeType::ICE} },
         }
     },
     {
         ElementRealmType::SKY, {
             _("空", "Sky"),
-            { AttributeType::ELEC, AttributeType::LITE, AttributeType::MANA },
-            { _("電撃", "Lightning"), _("光", "Light"), _("魔力", "Mana") },
+            { { AttributeType::ELEC, AttributeType::LITE, AttributeType::MANA } },
+            { { _("電撃", "Lightning"), _("光", "Light"), _("魔力", "Mana") } },
             { },
         }
     },
     {
         ElementRealmType::SEA, {
             _("海", "Sea"),
-            { AttributeType::ACID, AttributeType::WATER, AttributeType::DISINTEGRATE },
-            { _("酸", "Acid"), _("水", "Water"), _("分解", "Disintegration") },
+            { { AttributeType::ACID, AttributeType::WATER, AttributeType::DISINTEGRATE } },
+            { { _("酸", "Acid"), _("水", "Water"), _("分解", "Disintegration") } },
             { },
         }
     },
     {
         ElementRealmType::DARKNESS, {
             _("闇", "Darkness"),
-            { AttributeType::DARK, AttributeType::NETHER, AttributeType::VOID_MAGIC },
-            { _("暗黒", "Darkness"), _("地獄", "Nether"), _("虚無", "void") },
+            { { AttributeType::DARK, AttributeType::NETHER, AttributeType::VOID_MAGIC } },
+            { { _("暗黒", "Darkness"), _("地獄", "Nether"), _("虚無", "void") } },
             { { AttributeType::DARK, AttributeType::ABYSS } },
         }
     },
     {
         ElementRealmType::CHAOS, {
             _("混沌", "Chaos"),
-            { AttributeType::CONFUSION, AttributeType::CHAOS, AttributeType::NEXUS },
-            { _("混乱", "Confusion"), _("カオス", "Chaos"), _("因果混乱", "Nexus") },
+            { { AttributeType::CONFUSION, AttributeType::CHAOS, AttributeType::NEXUS } },
+            { { _("混乱", "Confusion"), _("カオス", "Chaos"), _("因果混乱", "Nexus") } },
             { },
         }
     },
     {
         ElementRealmType::EARTH, {
             _("地", "Earth"),
-            { AttributeType::SHARDS, AttributeType::FORCE, AttributeType::METEOR },
-            { _("破片", "Shards"), _("フォース", "Force"), _("隕石", "Meteor") },
+            { { AttributeType::SHARDS, AttributeType::FORCE, AttributeType::METEOR } },
+            { { _("破片", "Shards"), _("フォース", "Force"), _("隕石", "Meteor") } },
             { },
         }
     },
     {
         ElementRealmType::DEATH, {
             _("瘴気", "Death"),
-            { AttributeType::POIS, AttributeType::HYPODYNAMIA, AttributeType::DISENCHANT },
-            { _("毒", "Poison"), _("吸血", "Drain Life"), _("劣化", "Disenchantment") },
+            { { AttributeType::POIS, AttributeType::HYPODYNAMIA, AttributeType::DISENCHANT } },
+            { { _("毒", "Poison"), _("吸血", "Drain Life"), _("劣化", "Disenchantment") } },
             { },
         }
     },
index 1a8729d..bff1cb1 100644 (file)
@@ -182,21 +182,21 @@ enum tr_type : int32_t {
 };
 
 /** 能力値(STR,INT,WIS,DEX,CON,CHR)のpvalを増減させるフラグのリスト */
-inline constexpr std::array<tr_type, 6> TR_STATUS_LIST = {
+inline constexpr std::array<tr_type, 6> TR_STATUS_LIST = { {
     TR_STR,
     TR_INT,
     TR_WIS,
     TR_DEX,
     TR_CON,
     TR_CHR,
-};
+} };
 
 /** 能力値(STR,INT,WIS,DEX,CON,CHR)を維持するフラグのリスト */
-inline constexpr std::array<tr_type, 6> TR_SUST_STATUS_LIST = {
+inline constexpr std::array<tr_type, 6> TR_SUST_STATUS_LIST = { {
     TR_SUST_STR,
     TR_SUST_INT,
     TR_SUST_WIS,
     TR_SUST_DEX,
     TR_SUST_CON,
     TR_SUST_CHR,
-};
+} };
index f5f318f..454f09e 100644 (file)
@@ -239,8 +239,8 @@ concptr PlayerSkill::skill_rank_str(PlayerSkillRank rank)
 
 void PlayerSkill::gain_melee_weapon_exp(const ObjectType *o_ptr)
 {
-    const GainAmountList gain_amount_list{ 80, 10, 1, (one_in_(2) ? 1 : 0) };
-    constexpr GainAmountList others_gain_amount_list{ 8, 1, 0, 0 };
+    const GainAmountList gain_amount_list{ { 80, 10, 1, (one_in_(2) ? 1 : 0) } };
+    constexpr GainAmountList others_gain_amount_list{ { 8, 1, 0, 0 } };
 
     for (auto sval = 0U; sval < this->player_ptr->weapon_exp[o_ptr->tval].size(); ++sval) {
         auto &now_exp = this->player_ptr->weapon_exp[o_ptr->tval][sval];
@@ -253,8 +253,8 @@ void PlayerSkill::gain_melee_weapon_exp(const ObjectType *o_ptr)
 
 void PlayerSkill::gain_range_weapon_exp(const ObjectType *o_ptr)
 {
-    constexpr GainAmountList gain_amount_list{ 80, 25, 10, 2 };
-    constexpr GainAmountList others_gain_amount_list{ 8, 2, 0, 0 };
+    constexpr GainAmountList gain_amount_list{ { 80, 25, 10, 2 } };
+    constexpr GainAmountList others_gain_amount_list{ { 8, 2, 0, 0 } };
 
     for (auto sval = 0U; sval < this->player_ptr->weapon_exp[o_ptr->tval].size(); ++sval) {
         auto &now_exp = this->player_ptr->weapon_exp[o_ptr->tval][sval];
@@ -358,8 +358,8 @@ void PlayerSkill::gain_spell_skill_exp(int realm, int spell_idx)
         return;
     }
 
-    constexpr GainAmountList gain_amount_list_first{ 60, 8, 2, 1 };
-    constexpr GainAmountList gain_amount_list_second{ 60, 8, 2, 0 };
+    constexpr GainAmountList gain_amount_list_first{ { 60, 8, 2, 1 } };
+    constexpr GainAmountList gain_amount_list_second{ { 60, 8, 2, 0 } };
 
     const auto is_first_realm = (realm == this->player_ptr->realm1);
     const auto *s_ptr = &mp_ptr->info[realm - 1][spell_idx];
index 2cd5ede..da438e9 100644 (file)
@@ -20,13 +20,13 @@ uint32_t u32b_rotl(uint32_t x, int k)
  * @brief デフォルトシードで乱数の内部状態を初期化したXoshiro128StarStarクラスのオブジェクトを生成する
  */
 Xoshiro128StarStar::Xoshiro128StarStar()
-    : rng_state{
-        // default seeds
-        123456789,
-        362436069,
-        521288629,
-        88675123,
-    }
+    : rng_state{ {
+          // default seeds
+          123456789,
+          362436069,
+          521288629,
+          88675123,
+      } }
 {
 }
 
index 69cf201..0d12e77 100644 (file)
@@ -167,14 +167,14 @@ SpoilerOutputResultType spoil_categorized_mon_desc()
     return status;
 }
 
-const std::array<const std::string_view, 6> wiz_spell_stat = {
+const std::array<const std::string_view, 6> wiz_spell_stat = { {
     _("腕力", "STR"),
     _("知能", "INT"),
     _("賢さ", "WIS"),
     _("器用さ", "DEX"),
     _("耐久力", "CON"),
     _("魅力", "CHR"),
-};
+} };
 
 static SpoilerOutputResultType spoil_player_spell(concptr fname)
 {