From 2c2b9690bbb9e4cd5c6a27550adab53b95c3cac5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 3 Jun 2019 19:25:01 -0400 Subject: [PATCH] Core/Analytics: Simplify static_assert We can just use a std::array here to simplify the size calculation. --- Source/Core/Core/Analytics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Analytics.cpp b/Source/Core/Core/Analytics.cpp index d83fb4762b..2b23d55c7a 100644 --- a/Source/Core/Core/Analytics.cpp +++ b/Source/Core/Core/Analytics.cpp @@ -1,5 +1,6 @@ #include "Core/Analytics.h" +#include #include #include #include @@ -138,12 +139,11 @@ void DolphinAnalytics::ReportGameStart() } // Keep in sync with enum class GameQuirk definition. -static const char* GAME_QUIRKS_NAMES[] = { +constexpr std::array GAME_QUIRKS_NAMES{ "icache-matters", "directly-reads-wiimote-input", }; -static_assert(sizeof(GAME_QUIRKS_NAMES) / sizeof(GAME_QUIRKS_NAMES[0]) == - static_cast(GameQuirk::COUNT), +static_assert(GAME_QUIRKS_NAMES.size() == static_cast(GameQuirk::COUNT), "Game quirks names and enum definition are out of sync."); void DolphinAnalytics::ReportGameQuirk(GameQuirk quirk)