diff --git a/src/common/easing.h b/src/common/easing.h index 204b31a7d..051fed469 100644 --- a/src/common/easing.h +++ b/src/common/easing.h @@ -8,7 +8,7 @@ // From https://github.com/nicolausYes/easing-functions/blob/master/src/easing.cpp namespace Easing { -static constexpr float pi = 3.1415926545f; +inline constexpr float pi = 3.1415926545f; template ALWAYS_INLINE_RELEASE static T InSine(T t) diff --git a/src/common/intrin.h b/src/common/intrin.h index d4ef62a7c..25c013226 100644 --- a/src/common/intrin.h +++ b/src/common/intrin.h @@ -56,7 +56,7 @@ #endif /// Only currently using 128-bit vectors at max. -static constexpr u32 VECTOR_ALIGNMENT = 16; +inline constexpr u32 VECTOR_ALIGNMENT = 16; /// Aligns allocation/pitch size to preferred host size. template diff --git a/src/common/string_util.h b/src/common/string_util.h index 66322eb1d..d27e5fde7 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -444,7 +444,7 @@ ALWAYS_INLINE std::optional GetNextToken(std::string_view& car } /// Unicode replacement character. -static constexpr char32_t UNICODE_REPLACEMENT_CHARACTER = 0xFFFD; +inline constexpr char32_t UNICODE_REPLACEMENT_CHARACTER = 0xFFFD; /// Appends a UTF-16/UTF-32 codepoint to a UTF-8 string. void EncodeAndAppendUTF8(std::string& s, char32_t ch); diff --git a/src/common/thirdparty/aes.h b/src/common/thirdparty/aes.h index ab24e0aee..ccf92dc7e 100644 --- a/src/common/thirdparty/aes.h +++ b/src/common/thirdparty/aes.h @@ -13,8 +13,8 @@ #include /****************************** MACROS ******************************/ -static constexpr uint32_t AES_BLOCK_SIZE = 16; // AES operates on 16 bytes at a time -static constexpr uint32_t AES_KEY_SCHEDULE_SIZE = 60; +inline constexpr uint32_t AES_BLOCK_SIZE = 16; // AES operates on 16 bytes at a time +inline constexpr uint32_t AES_KEY_SCHEDULE_SIZE = 60; /*********************** FUNCTION DECLARATIONS **********************/ /////////////////// @@ -119,4 +119,4 @@ bool aes_decrypt_ccm( // authentication. const uint8_t key[], // IN - The AES key for decryption. int keysize); // IN - The length of the key in BITS. Valid values are 128, 192, 256. -#endif \ No newline at end of file +#endif diff --git a/src/common/types.h b/src/common/types.h index 7f40d2f28..b0d88349c 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -212,29 +212,29 @@ extern const u32 HOST_PAGE_MASK; extern const u32 HOST_PAGE_SHIFT; #else #if defined(OVERRIDE_HOST_PAGE_SIZE) -static constexpr u32 HOST_PAGE_SIZE = OVERRIDE_HOST_PAGE_SIZE; -static constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1; -static constexpr u32 HOST_PAGE_SHIFT = std::bit_width(HOST_PAGE_MASK); +inline constexpr u32 HOST_PAGE_SIZE = OVERRIDE_HOST_PAGE_SIZE; +inline constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1; +inline constexpr u32 HOST_PAGE_SHIFT = std::bit_width(HOST_PAGE_MASK); #elif defined(__APPLE__) && defined(__aarch64__) -static constexpr u32 HOST_PAGE_SIZE = 0x4000; -static constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1; -static constexpr u32 HOST_PAGE_SHIFT = 14; +inline constexpr u32 HOST_PAGE_SIZE = 0x4000; +inline constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1; +inline constexpr u32 HOST_PAGE_SHIFT = 14; #else -static constexpr u32 HOST_PAGE_SIZE = 0x1000; -static constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1; -static constexpr u32 HOST_PAGE_SHIFT = 12; +inline constexpr u32 HOST_PAGE_SIZE = 0x1000; +inline constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1; +inline constexpr u32 HOST_PAGE_SHIFT = 12; #endif -static constexpr u32 MIN_HOST_PAGE_SIZE = HOST_PAGE_SIZE; -static constexpr u32 MAX_HOST_PAGE_SIZE = HOST_PAGE_SIZE; +inline constexpr u32 MIN_HOST_PAGE_SIZE = HOST_PAGE_SIZE; +inline constexpr u32 MAX_HOST_PAGE_SIZE = HOST_PAGE_SIZE; #endif // Host cache line sizes. #if defined(OVERRIDE_HOST_CACHE_LINE_SIZE) -static constexpr u32 HOST_CACHE_LINE_SIZE = OVERRIDE_HOST_CACHE_LINE_SIZE; +inline constexpr u32 HOST_CACHE_LINE_SIZE = OVERRIDE_HOST_CACHE_LINE_SIZE; #elif defined(__APPLE__) && defined(__aarch64__) -static constexpr u32 HOST_CACHE_LINE_SIZE = 128; // Apple Silicon uses 128b cache lines. +inline constexpr u32 HOST_CACHE_LINE_SIZE = 128; // Apple Silicon uses 128b cache lines. #else -static constexpr u32 HOST_CACHE_LINE_SIZE = 64; // Everything else is 64b. +inline constexpr u32 HOST_CACHE_LINE_SIZE = 64; // Everything else is 64b. #endif #define ALIGN_TO_CACHE_LINE alignas(HOST_CACHE_LINE_SIZE) diff --git a/src/core/achievements.h b/src/core/achievements.h index d6102736e..eb91e9931 100644 --- a/src/core/achievements.h +++ b/src/core/achievements.h @@ -29,7 +29,7 @@ enum class LoginRequestReason TokenInvalid, }; -static constexpr size_t GAME_HASH_LENGTH = 16; +inline constexpr size_t GAME_HASH_LENGTH = 16; using GameHash = std::array; struct HashDatabaseEntry diff --git a/src/core/bios.h b/src/core/bios.h index adea58aa5..1fa2a009f 100644 --- a/src/core/bios.h +++ b/src/core/bios.h @@ -80,7 +80,7 @@ static_assert(sizeof(PSEXEHeader) == 0x800); #pragma pack(pop) // .cpe files -static constexpr u32 CPE_MAGIC = 0x01455043; +inline constexpr u32 CPE_MAGIC = 0x01455043; std::optional LoadImageFromFile(const char* filename, Error* error); @@ -105,4 +105,4 @@ std::vector> FindBIOSImagesInDire /// Returns true if any BIOS images are found in the configured BIOS directory. bool HasAnyBIOSImages(); -} // namespace BIOS \ No newline at end of file +} // namespace BIOS diff --git a/src/core/bus.h b/src/core/bus.h index 917849bbc..b3386e9de 100644 --- a/src/core/bus.h +++ b/src/core/bus.h @@ -109,7 +109,7 @@ enum : u32 #ifdef ENABLE_MMAP_FASTMEM // Fastmem region size is 4GB to cover the entire 32-bit address space. -static constexpr size_t FASTMEM_ARENA_SIZE = UINT64_C(0x100000000); +inline constexpr size_t FASTMEM_ARENA_SIZE = UINT64_C(0x100000000); #endif bool AllocateMemory(bool export_shared_memory, Error* error); diff --git a/src/core/cpu_core.h b/src/core/cpu_core.h index 8078c6b93..a4565878d 100644 --- a/src/core/cpu_core.h +++ b/src/core/cpu_core.h @@ -253,7 +253,7 @@ struct DebuggerRegisterListEntry u32* value_ptr; }; -static constexpr u32 NUM_DEBUGGER_REGISTER_LIST_ENTRIES = 103; +inline constexpr u32 NUM_DEBUGGER_REGISTER_LIST_ENTRIES = 103; extern const std::array g_debugger_register_list; } // namespace CPU diff --git a/src/core/fullscreen_ui.h b/src/core/fullscreen_ui.h index 7769aa638..18574a9a2 100644 --- a/src/core/fullscreen_ui.h +++ b/src/core/fullscreen_ui.h @@ -48,9 +48,9 @@ void SetTheme(); void UpdateRunIdleState(); void UpdateTransitionState(); -static constexpr float SHORT_TRANSITION_TIME = 0.08f; -static constexpr float DEFAULT_TRANSITION_TIME = 0.15f; -static constexpr float LONG_TRANSITION_TIME = 0.3f; +inline constexpr float SHORT_TRANSITION_TIME = 0.08f; +inline constexpr float DEFAULT_TRANSITION_TIME = 0.15f; +inline constexpr float LONG_TRANSITION_TIME = 0.3f; enum class TransitionState : u8 { diff --git a/src/core/gpu_dump.h b/src/core/gpu_dump.h index dfb26b5a1..c2a0a8359 100644 --- a/src/core/gpu_dump.h +++ b/src/core/gpu_dump.h @@ -37,7 +37,7 @@ enum class PacketType : u8 Comment = 0x12, }; -static constexpr u32 MAX_PACKET_LENGTH = ((1u << 24) - 1); // 3 bytes for packet size +inline constexpr u32 MAX_PACKET_LENGTH = ((1u << 24) - 1); // 3 bytes for packet size union PacketHeader { diff --git a/src/core/gpu_hw_texture_cache.h b/src/core/gpu_hw_texture_cache.h index 23d11fb22..bc84782a5 100644 --- a/src/core/gpu_hw_texture_cache.h +++ b/src/core/gpu_hw_texture_cache.h @@ -19,9 +19,9 @@ class GPU_HW; namespace GPUTextureCache { /// 4 pages in C16 mode, 2+4 pages in P8 mode, 1+1 pages in P4 mode. -static constexpr u32 MAX_PAGE_REFS_PER_SOURCE = 6; +inline constexpr u32 MAX_PAGE_REFS_PER_SOURCE = 6; -static constexpr u32 MAX_PAGE_REFS_PER_WRITE = 32; +inline constexpr u32 MAX_PAGE_REFS_PER_WRITE = 32; enum class PaletteRecordFlags : u32 { diff --git a/src/core/gpu_sw_rasterizer.h b/src/core/gpu_sw_rasterizer.h index 4e46dcc25..d4cc5c95d 100644 --- a/src/core/gpu_sw_rasterizer.h +++ b/src/core/gpu_sw_rasterizer.h @@ -15,7 +15,7 @@ namespace GPU_SW_Rasterizer { // this is actually (31 * 255) >> 4) == 494, but to simplify addressing we use the next power of two (512) -static constexpr u32 DITHER_LUT_SIZE = 512; +inline constexpr u32 DITHER_LUT_SIZE = 512; using DitherLUT = std::array, DITHER_MATRIX_SIZE>, DITHER_MATRIX_SIZE>; extern const DitherLUT g_dither_lut; diff --git a/src/core/gpu_types.h b/src/core/gpu_types.h index e0982b990..5a8d211dd 100644 --- a/src/core/gpu_types.h +++ b/src/core/gpu_types.h @@ -550,7 +550,7 @@ ALWAYS_INLINE static constexpr GSVector4i GetPaletteRect(GPUTexturePaletteReg pa } // 4x4 dither matrix. -static constexpr s32 DITHER_MATRIX[DITHER_MATRIX_SIZE][DITHER_MATRIX_SIZE] = {{-4, +0, -3, +1}, // row 0 +inline constexpr s32 DITHER_MATRIX[DITHER_MATRIX_SIZE][DITHER_MATRIX_SIZE] = {{-4, +0, -3, +1}, // row 0 {+2, -2, +3, -1}, // row 1 {-3, +1, -4, +0}, // row 2 {+3, -1, +2, -2}}; // row 3 diff --git a/src/core/imgui_overlays.h b/src/core/imgui_overlays.h index 13aa45c11..030f8690d 100644 --- a/src/core/imgui_overlays.h +++ b/src/core/imgui_overlays.h @@ -13,7 +13,7 @@ class GPUBackend; namespace ImGuiManager { -static constexpr const char* LOGO_IMAGE_NAME = "images/duck.png"; +inline constexpr const char* LOGO_IMAGE_NAME = "images/duck.png"; void UpdateInputOverlay(); void RenderTextOverlays(const GPUBackend* gpu); @@ -30,7 +30,7 @@ void DestroyOverlayTextures(); namespace SaveStateSelectorUI { -static constexpr float DEFAULT_OPEN_TIME = 7.5f; +inline constexpr float DEFAULT_OPEN_TIME = 7.5f; bool IsOpen(); void Open(float open_time = DEFAULT_OPEN_TIME); diff --git a/src/core/interrupt_controller.h b/src/core/interrupt_controller.h index 8851c5b7f..2a7f58590 100644 --- a/src/core/interrupt_controller.h +++ b/src/core/interrupt_controller.h @@ -8,7 +8,7 @@ class StateWrapper; namespace InterruptController { -static constexpr u32 NUM_IRQS = 11; +inline constexpr u32 NUM_IRQS = 11; enum class IRQ : u32 { diff --git a/src/core/performance_counters.h b/src/core/performance_counters.h index fbdfc86cc..f122db0c2 100644 --- a/src/core/performance_counters.h +++ b/src/core/performance_counters.h @@ -9,7 +9,7 @@ class GPUBackend; namespace PerformanceCounters { -static constexpr u32 NUM_FRAME_TIME_SAMPLES = 150; +inline constexpr u32 NUM_FRAME_TIME_SAMPLES = 150; using FrameTimeHistory = std::array; float GetFPS(); diff --git a/src/core/save_state_version.h b/src/core/save_state_version.h index 36ed7393b..ab061aee3 100644 --- a/src/core/save_state_version.h +++ b/src/core/save_state_version.h @@ -5,9 +5,9 @@ #include "common/types.h" -static constexpr u32 SAVE_STATE_MAGIC = 0x43435544; -static constexpr u32 SAVE_STATE_VERSION = 82; -static constexpr u32 SAVE_STATE_MINIMUM_VERSION = 42; +inline constexpr u32 SAVE_STATE_MAGIC = 0x43435544; +inline constexpr u32 SAVE_STATE_VERSION = 82; +inline constexpr u32 SAVE_STATE_MINIMUM_VERSION = 42; static_assert(SAVE_STATE_VERSION >= SAVE_STATE_MINIMUM_VERSION); @@ -36,7 +36,7 @@ struct SAVE_STATE_HEADER u32 media_path_length; u32 offset_to_media_path; u32 media_subimage_index; - + // Screenshot compression added in version 69. // Uncompressed size not stored, it can be inferred from width/height. u32 screenshot_compression_type; diff --git a/src/core/shader_cache_version.h b/src/core/shader_cache_version.h index 2190c747f..e0f0a880e 100644 --- a/src/core/shader_cache_version.h +++ b/src/core/shader_cache_version.h @@ -5,4 +5,4 @@ #include "common/types.h" -static constexpr u32 SHADER_CACHE_VERSION = 33; +inline constexpr u32 SHADER_CACHE_VERSION = 33; diff --git a/src/duckstation-mini/sdl_key_names.h b/src/duckstation-mini/sdl_key_names.h index 7e7898708..a55dd2462 100644 --- a/src/duckstation-mini/sdl_key_names.h +++ b/src/duckstation-mini/sdl_key_names.h @@ -5,7 +5,6 @@ #include "common/types.h" -#include #include #include #include @@ -15,7 +14,7 @@ namespace SDLKeyNames { -static const std::map s_sdl_key_names = { +inline const std::map s_sdl_key_names = { {SDLK_RETURN, "Return"}, {SDLK_ESCAPE, "Escape"}, {SDLK_BACKSPACE, "Backspace"}, @@ -246,13 +245,13 @@ static const std::map s_sdl_key_names = { {SDLK_SLEEP, "Sleep"}, }; -static const char* GetKeyName(u32 key) +inline const char* GetKeyName(u32 key) { const auto it = s_sdl_key_names.find(key); return it == s_sdl_key_names.end() ? nullptr : it->second; } -static std::optional GetKeyCodeForName(const std::string_view& key_name) +inline std::optional GetKeyCodeForName(const std::string_view key_name) { for (const auto& it : s_sdl_key_names) { diff --git a/src/duckstation-qt/settingwidgetbinder.h b/src/duckstation-qt/settingwidgetbinder.h index 911f6a900..3fd118fa0 100644 --- a/src/duckstation-qt/settingwidgetbinder.h +++ b/src/duckstation-qt/settingwidgetbinder.h @@ -35,9 +35,9 @@ #include namespace SettingWidgetBinder { -static constexpr const char* NULLABLE_PROPERTY = "SettingWidgetBinder_isNullable"; -static constexpr const char* IS_NULL_PROPERTY = "SettingWidgetBinder_isNull"; -static constexpr const char* GLOBAL_VALUE_PROPERTY = "SettingWidgetBinder_globalValue"; +inline constexpr const char* NULLABLE_PROPERTY = "SettingWidgetBinder_isNullable"; +inline constexpr const char* IS_NULL_PROPERTY = "SettingWidgetBinder_isNull"; +inline constexpr const char* GLOBAL_VALUE_PROPERTY = "SettingWidgetBinder_globalValue"; template struct SettingAccessor diff --git a/src/util/imgui_fullscreen.h b/src/util/imgui_fullscreen.h index b7b584140..11ca33d4c 100644 --- a/src/util/imgui_fullscreen.h +++ b/src/util/imgui_fullscreen.h @@ -36,31 +36,31 @@ namespace ImGuiFullscreen { // end_ptr() for string_view #define IMSTR_START_END(sv) (sv).data(), (sv).data() + (sv).length() -static constexpr float LAYOUT_SCREEN_WIDTH = 1280.0f; -static constexpr float LAYOUT_SCREEN_HEIGHT = 720.0f; -static constexpr float LAYOUT_LARGE_FONT_SIZE = 26.0f; -static constexpr float LAYOUT_MEDIUM_FONT_SIZE = 16.0f; -static constexpr float LAYOUT_MEDIUM_LARGE_FONT_SIZE = 21.0f; -static constexpr float LAYOUT_SMALL_FONT_SIZE = 10.0f; -static constexpr float LAYOUT_MENU_BUTTON_X_PADDING = 15.0f; -static constexpr float LAYOUT_MENU_BUTTON_Y_PADDING = 10.0f; -static constexpr float LAYOUT_MENU_BUTTON_SPACING = 6.0f; -static constexpr float LAYOUT_MENU_WINDOW_X_PADDING = 12.0f; -static constexpr float LAYOUT_MENU_WINDOW_Y_PADDING = 12.0f; -static constexpr float LAYOUT_MENU_ITEM_TITLE_SUMMARY_SPACING = 6.0f; -static constexpr float LAYOUT_MENU_ITEM_EXTRA_HEIGHT = 2.0f; -static constexpr float LAYOUT_FOOTER_PADDING = 10.0f; -static constexpr float LAYOUT_FOOTER_HEIGHT = LAYOUT_MEDIUM_FONT_SIZE + LAYOUT_FOOTER_PADDING * 2.0f; -static constexpr float LAYOUT_HORIZONTAL_MENU_HEIGHT = 320.0f; -static constexpr float LAYOUT_HORIZONTAL_MENU_PADDING = 30.0f; -static constexpr float LAYOUT_HORIZONTAL_MENU_ITEM_WIDTH = 250.0f; -static constexpr float LAYOUT_HORIZONTAL_MENU_ITEM_IMAGE_SIZE = 150.0f; -static constexpr float LAYOUT_SHADOW_OFFSET = 1.0f; -static constexpr float LAYOUT_SMALL_POPUP_PADDING = 20.0f; -static constexpr float LAYOUT_LARGE_POPUP_PADDING = 30.0f; -static constexpr float LAYOUT_LARGE_POPUP_ROUNDING = 40.0f; -static constexpr float LAYOUT_WIDGET_FRAME_ROUNDING = 20.0f; -static constexpr ImVec2 LAYOUT_CENTER_ALIGN_TEXT = ImVec2(0.5f, 0.0f); +inline constexpr float LAYOUT_SCREEN_WIDTH = 1280.0f; +inline constexpr float LAYOUT_SCREEN_HEIGHT = 720.0f; +inline constexpr float LAYOUT_LARGE_FONT_SIZE = 26.0f; +inline constexpr float LAYOUT_MEDIUM_FONT_SIZE = 16.0f; +inline constexpr float LAYOUT_MEDIUM_LARGE_FONT_SIZE = 21.0f; +inline constexpr float LAYOUT_SMALL_FONT_SIZE = 10.0f; +inline constexpr float LAYOUT_MENU_BUTTON_X_PADDING = 15.0f; +inline constexpr float LAYOUT_MENU_BUTTON_Y_PADDING = 10.0f; +inline constexpr float LAYOUT_MENU_BUTTON_SPACING = 6.0f; +inline constexpr float LAYOUT_MENU_WINDOW_X_PADDING = 12.0f; +inline constexpr float LAYOUT_MENU_WINDOW_Y_PADDING = 12.0f; +inline constexpr float LAYOUT_MENU_ITEM_TITLE_SUMMARY_SPACING = 6.0f; +inline constexpr float LAYOUT_MENU_ITEM_EXTRA_HEIGHT = 2.0f; +inline constexpr float LAYOUT_FOOTER_PADDING = 10.0f; +inline constexpr float LAYOUT_FOOTER_HEIGHT = LAYOUT_MEDIUM_FONT_SIZE + LAYOUT_FOOTER_PADDING * 2.0f; +inline constexpr float LAYOUT_HORIZONTAL_MENU_HEIGHT = 320.0f; +inline constexpr float LAYOUT_HORIZONTAL_MENU_PADDING = 30.0f; +inline constexpr float LAYOUT_HORIZONTAL_MENU_ITEM_WIDTH = 250.0f; +inline constexpr float LAYOUT_HORIZONTAL_MENU_ITEM_IMAGE_SIZE = 150.0f; +inline constexpr float LAYOUT_SHADOW_OFFSET = 1.0f; +inline constexpr float LAYOUT_SMALL_POPUP_PADDING = 20.0f; +inline constexpr float LAYOUT_LARGE_POPUP_PADDING = 30.0f; +inline constexpr float LAYOUT_LARGE_POPUP_ROUNDING = 40.0f; +inline constexpr float LAYOUT_WIDGET_FRAME_ROUNDING = 20.0f; +inline constexpr ImVec2 LAYOUT_CENTER_ALIGN_TEXT = ImVec2(0.5f, 0.0f); struct ALIGN_TO_CACHE_LINE UIStyles { diff --git a/src/util/imgui_manager.h b/src/util/imgui_manager.h index d227ee487..fc88738e3 100644 --- a/src/util/imgui_manager.h +++ b/src/util/imgui_manager.h @@ -71,9 +71,9 @@ using TextFontOrder = std::array(TextFont::MaxCoun /// Default size for screen margins. #ifndef __ANDROID__ -static constexpr float DEFAULT_SCREEN_MARGIN = 10.0f; +inline constexpr float DEFAULT_SCREEN_MARGIN = 10.0f; #else -static constexpr float DEFAULT_SCREEN_MARGIN = 16.0f; +inline constexpr float DEFAULT_SCREEN_MARGIN = 16.0f; #endif /// Sets the order for text fonts. @@ -223,11 +223,11 @@ void ProcessAuxiliaryRenderWindowInputEvent(Host::AuxiliaryRenderWindowUserData namespace Host { /// Typical durations for OSD messages. -static constexpr float OSD_CRITICAL_ERROR_DURATION = 20.0f; -static constexpr float OSD_ERROR_DURATION = 15.0f; -static constexpr float OSD_WARNING_DURATION = 10.0f; -static constexpr float OSD_INFO_DURATION = 5.0f; -static constexpr float OSD_QUICK_DURATION = 2.5f; +inline constexpr float OSD_CRITICAL_ERROR_DURATION = 20.0f; +inline constexpr float OSD_ERROR_DURATION = 15.0f; +inline constexpr float OSD_WARNING_DURATION = 10.0f; +inline constexpr float OSD_INFO_DURATION = 5.0f; +inline constexpr float OSD_QUICK_DURATION = 2.5f; /// Adds OSD messages, duration is in seconds. void AddOSDMessage(std::string message, float duration = 2.0f); diff --git a/src/util/input_manager.h b/src/util/input_manager.h index 35a35aede..7154d9c7a 100644 --- a/src/util/input_manager.h +++ b/src/util/input_manager.h @@ -191,24 +191,24 @@ public: namespace InputManager { /// Maximum number of buttons that can be part of a chord. -static constexpr u32 MAX_KEYS_PER_BINDING = 4; +inline constexpr u32 MAX_KEYS_PER_BINDING = 4; /// Maximum number of output vibration motors per pad. -static constexpr u32 MAX_MOTORS_PER_PAD = 2; +inline constexpr u32 MAX_MOTORS_PER_PAD = 2; /// Minimum interval between vibration updates when the effect is continuous. -static constexpr double VIBRATION_UPDATE_INTERVAL_SECONDS = 0.5; // 500ms +inline constexpr double VIBRATION_UPDATE_INTERVAL_SECONDS = 0.5; // 500ms /// Maximum number of host mouse devices. -static constexpr u32 MAX_POINTER_DEVICES = 8; -static constexpr u32 MAX_POINTER_BUTTONS = 3; +inline constexpr u32 MAX_POINTER_DEVICES = 8; +inline constexpr u32 MAX_POINTER_BUTTONS = 3; /// Maximum number of software cursors. We allocate an extra two for controllers with /// positioning data from the controller instead of a mouse. -static constexpr u32 MAX_SOFTWARE_CURSORS = MAX_POINTER_DEVICES + 2; +inline constexpr u32 MAX_SOFTWARE_CURSORS = MAX_POINTER_DEVICES + 2; /// Number of macro buttons per controller. -static constexpr u32 NUM_MACRO_BUTTONS_PER_CONTROLLER = 4; +inline constexpr u32 NUM_MACRO_BUTTONS_PER_CONTROLLER = 4; /// Returns a pointer to the external input source class, if present. InputSource* GetInputSourceInterface(InputSourceType type); diff --git a/src/util/postprocessing.h b/src/util/postprocessing.h index 05e4696fc..917aaa741 100644 --- a/src/util/postprocessing.h +++ b/src/util/postprocessing.h @@ -93,8 +93,8 @@ struct ShaderOption }; namespace Config { -static constexpr const char* DISPLAY_CHAIN_SECTION = "PostProcessing"; -static constexpr const char* INTERNAL_CHAIN_SECTION = "InternalPostProcessing"; +inline constexpr const char* DISPLAY_CHAIN_SECTION = "PostProcessing"; +inline constexpr const char* INTERNAL_CHAIN_SECTION = "InternalPostProcessing"; bool IsEnabled(const SettingsInterface& si, const char* section); u32 GetStageCount(const SettingsInterface& si, const char* section);