diff --git a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp index 36a00c9c6c..001a5d2b5c 100644 --- a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp +++ b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp @@ -115,7 +115,7 @@ void ControllerBindingWidget::onTypeChanged() if (has_settings) { - const gsl::span settings(cinfo->settings, cinfo->num_settings); + const std::span settings(cinfo->settings, cinfo->num_settings); m_settings_widget = new ControllerCustomSettingsWidget( settings, m_config_section, std::string(), "Pad", getDialog(), m_ui.stackedWidget); m_ui.stackedWidget->addWidget(m_settings_widget); @@ -471,7 +471,7 @@ void ControllerMacroEditWidget::updateBinds() ////////////////////////////////////////////////////////////////////////// -ControllerCustomSettingsWidget::ControllerCustomSettingsWidget(gsl::span settings, std::string config_section, +ControllerCustomSettingsWidget::ControllerCustomSettingsWidget(std::span settings, std::string config_section, std::string config_prefix, const char* translation_ctx, ControllerSettingsDialog* dialog, QWidget* parent_widget) : QWidget(parent_widget) , m_settings(settings) @@ -932,8 +932,8 @@ void USBDeviceWidget::populatePages() m_settings_widget = nullptr; } - const gsl::span bindings(USB::GetDeviceBindings(m_device_type, m_device_subtype)); - const gsl::span settings(USB::GetDeviceSettings(m_device_type, m_device_subtype)); + const std::span bindings(USB::GetDeviceBindings(m_device_type, m_device_subtype)); + const std::span settings(USB::GetDeviceSettings(m_device_type, m_device_subtype)); m_ui.bindings->setEnabled(!bindings.empty()); m_ui.settings->setEnabled(!settings.empty()); @@ -1110,7 +1110,7 @@ std::string USBBindingWidget::getBindingKey(const char* binding_name) const return USB::GetConfigSubKey(getDeviceType(), binding_name); } -void USBBindingWidget::createWidgets(gsl::span bindings) +void USBBindingWidget::createWidgets(std::span bindings) { QGroupBox* axis_gbox = nullptr; QGridLayout* axis_layout = nullptr; @@ -1199,7 +1199,7 @@ void USBBindingWidget::createWidgets(gsl::span bindings) } -void USBBindingWidget::bindWidgets(gsl::span bindings) +void USBBindingWidget::bindWidgets(std::span bindings) { SettingsInterface* sif = getDialog()->getProfileSettingsInterface(); @@ -1222,7 +1222,7 @@ void USBBindingWidget::bindWidgets(gsl::span bindings) } USBBindingWidget* USBBindingWidget::createInstance( - const std::string& type, u32 subtype, gsl::span bindings, USBDeviceWidget* parent) + const std::string& type, u32 subtype, std::span bindings, USBDeviceWidget* parent) { USBBindingWidget* widget = new USBBindingWidget(parent); bool has_template = false; diff --git a/pcsx2-qt/Settings/ControllerBindingWidgets.h b/pcsx2-qt/Settings/ControllerBindingWidgets.h index 41758f0616..3cbf508e61 100644 --- a/pcsx2-qt/Settings/ControllerBindingWidgets.h +++ b/pcsx2-qt/Settings/ControllerBindingWidgets.h @@ -19,7 +19,7 @@ #include -#include "gsl/span" +#include #include "ui_ControllerBindingWidget.h" #include "ui_ControllerBindingWidget_DualShock2.h" @@ -139,7 +139,7 @@ class ControllerCustomSettingsWidget : public QWidget Q_OBJECT public: - ControllerCustomSettingsWidget(gsl::span settings, std::string config_section, std::string config_prefix, + ControllerCustomSettingsWidget(std::span settings, std::string config_section, std::string config_prefix, const char* translation_ctx, ControllerSettingsDialog* dialog, QWidget* parent_widget); ~ControllerCustomSettingsWidget(); @@ -149,7 +149,7 @@ private Q_SLOTS: private: void createSettingWidgets(const char* translation_ctx, QWidget* widget_parent, QGridLayout* layout); - gsl::span m_settings; + std::span m_settings; std::string m_config_section; std::string m_config_prefix; ControllerSettingsDialog* m_dialog; @@ -252,11 +252,11 @@ public: QIcon getIcon() const; - static USBBindingWidget* createInstance(const std::string& type, u32 subtype, gsl::span bindings, USBDeviceWidget* parent); + static USBBindingWidget* createInstance(const std::string& type, u32 subtype, std::span bindings, USBDeviceWidget* parent); protected: std::string getBindingKey(const char* binding_name) const; - void createWidgets(gsl::span bindings); - void bindWidgets(gsl::span bindings); + void createWidgets(std::span bindings); + void bindWidgets(std::span bindings); }; diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextAGL.h b/pcsx2/GS/Renderers/OpenGL/GLContextAGL.h index a86f1cd4fd..ed504ee272 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextAGL.h +++ b/pcsx2/GS/Renderers/OpenGL/GLContextAGL.h @@ -19,7 +19,7 @@ #include "glad.h" -#include +#include #if defined(__APPLE__) && defined(__OBJC__) #import @@ -35,7 +35,7 @@ public: GLContextAGL(const WindowInfo& wi); ~GLContextAGL() override; - static std::unique_ptr Create(const WindowInfo& wi, gsl::span versions_to_try); + static std::unique_ptr Create(const WindowInfo& wi, std::span versions_to_try); void* GetProcAddress(const char* name) override; bool ChangeSurface(const WindowInfo& new_wi) override; @@ -47,7 +47,7 @@ public: std::unique_ptr CreateSharedContext(const WindowInfo& wi) override; private: - bool Initialize(gsl::span versions_to_try); + bool Initialize(std::span versions_to_try); bool CreateContext(NSOpenGLContext* share_context, int profile, bool make_current); void BindContextToView(); void CleanupView(); diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextAGL.mm b/pcsx2/GS/Renderers/OpenGL/GLContextAGL.mm index af28a1caba..99bb8a6e92 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextAGL.mm +++ b/pcsx2/GS/Renderers/OpenGL/GLContextAGL.mm @@ -46,7 +46,7 @@ GLContextAGL::~GLContextAGL() [m_context release]; } -std::unique_ptr GLContextAGL::Create(const WindowInfo& wi, gsl::span versions_to_try) +std::unique_ptr GLContextAGL::Create(const WindowInfo& wi, std::span versions_to_try) { std::unique_ptr context = std::make_unique(wi); if (!context->Initialize(versions_to_try)) @@ -55,7 +55,7 @@ std::unique_ptr GLContextAGL::Create(const WindowInfo& wi, gsl::span< return context; } -bool GLContextAGL::Initialize(gsl::span versions_to_try) +bool GLContextAGL::Initialize(std::span versions_to_try) { for (const Version& cv : versions_to_try) { diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextEGL.cpp b/pcsx2/GS/Renderers/OpenGL/GLContextEGL.cpp index f4d3190800..23877a3e3d 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextEGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GLContextEGL.cpp @@ -35,7 +35,7 @@ GLContextEGL::~GLContextEGL() DestroyContext(); } -std::unique_ptr GLContextEGL::Create(const WindowInfo& wi, gsl::span versions_to_try) +std::unique_ptr GLContextEGL::Create(const WindowInfo& wi, std::span versions_to_try) { std::unique_ptr context = std::make_unique(wi); if (!context->Initialize(versions_to_try)) diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextEGL.h b/pcsx2/GS/Renderers/OpenGL/GLContextEGL.h index 4b20fdccbf..147383640d 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextEGL.h +++ b/pcsx2/GS/Renderers/OpenGL/GLContextEGL.h @@ -19,7 +19,7 @@ #include "glad_egl.h" -#include +#include class GLContextEGL : public GLContext { @@ -27,7 +27,7 @@ public: GLContextEGL(const WindowInfo& wi); ~GLContextEGL() override; - static std::unique_ptr Create(const WindowInfo& wi, gsl::span versions_to_try); + static std::unique_ptr Create(const WindowInfo& wi, std::span versions_to_try); void* GetProcAddress(const char* name) override; virtual bool ChangeSurface(const WindowInfo& new_wi) override; diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextEGLWayland.cpp b/pcsx2/GS/Renderers/OpenGL/GLContextEGLWayland.cpp index 704257469f..49237757db 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextEGLWayland.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GLContextEGLWayland.cpp @@ -36,7 +36,7 @@ GLContextEGLWayland::~GLContextEGLWayland() dlclose(m_wl_module); } -std::unique_ptr GLContextEGLWayland::Create(const WindowInfo& wi, gsl::span versions_to_try) +std::unique_ptr GLContextEGLWayland::Create(const WindowInfo& wi, std::span versions_to_try) { std::unique_ptr context = std::make_unique(wi); if (!context->LoadModule() || !context->Initialize(versions_to_try)) diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextEGLWayland.h b/pcsx2/GS/Renderers/OpenGL/GLContextEGLWayland.h index 34eaa2c916..f34479ee43 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextEGLWayland.h +++ b/pcsx2/GS/Renderers/OpenGL/GLContextEGLWayland.h @@ -26,7 +26,7 @@ public: GLContextEGLWayland(const WindowInfo& wi); ~GLContextEGLWayland() override; - static std::unique_ptr Create(const WindowInfo& wi, gsl::span versions_to_try); + static std::unique_ptr Create(const WindowInfo& wi, std::span versions_to_try); std::unique_ptr CreateSharedContext(const WindowInfo& wi) override; void ResizeSurface(u32 new_surface_width = 0, u32 new_surface_height = 0) override; diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextEGLX11.cpp b/pcsx2/GS/Renderers/OpenGL/GLContextEGLX11.cpp index 6943d49fea..a895c3c2f2 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextEGLX11.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GLContextEGLX11.cpp @@ -25,7 +25,7 @@ GLContextEGLX11::GLContextEGLX11(const WindowInfo& wi) } GLContextEGLX11::~GLContextEGLX11() = default; -std::unique_ptr GLContextEGLX11::Create(const WindowInfo& wi, gsl::span versions_to_try) +std::unique_ptr GLContextEGLX11::Create(const WindowInfo& wi, std::span versions_to_try) { std::unique_ptr context = std::make_unique(wi); if (!context->Initialize(versions_to_try)) diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextEGLX11.h b/pcsx2/GS/Renderers/OpenGL/GLContextEGLX11.h index 9d537cc09a..aa8950d5f2 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextEGLX11.h +++ b/pcsx2/GS/Renderers/OpenGL/GLContextEGLX11.h @@ -23,7 +23,7 @@ public: GLContextEGLX11(const WindowInfo& wi); ~GLContextEGLX11() override; - static std::unique_ptr Create(const WindowInfo& wi, gsl::span versions_to_try); + static std::unique_ptr Create(const WindowInfo& wi, std::span versions_to_try); std::unique_ptr CreateSharedContext(const WindowInfo& wi) override; void ResizeSurface(u32 new_surface_width = 0, u32 new_surface_height = 0) override; diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextWGL.cpp b/pcsx2/GS/Renderers/OpenGL/GLContextWGL.cpp index 8535f202aa..7bb62ec77a 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextWGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GLContextWGL.cpp @@ -59,7 +59,7 @@ GLContextWGL::~GLContextWGL() ReleaseDC(); } -std::unique_ptr GLContextWGL::Create(const WindowInfo& wi, gsl::span versions_to_try) +std::unique_ptr GLContextWGL::Create(const WindowInfo& wi, std::span versions_to_try) { std::unique_ptr context = std::make_unique(wi); if (!context->Initialize(versions_to_try)) @@ -68,7 +68,7 @@ std::unique_ptr GLContextWGL::Create(const WindowInfo& wi, gsl::span< return context; } -bool GLContextWGL::Initialize(gsl::span versions_to_try) +bool GLContextWGL::Initialize(std::span versions_to_try) { if (m_wi.type == WindowInfo::Type::Win32) { diff --git a/pcsx2/GS/Renderers/OpenGL/GLContextWGL.h b/pcsx2/GS/Renderers/OpenGL/GLContextWGL.h index 7b7b682417..3fd14c45d0 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLContextWGL.h +++ b/pcsx2/GS/Renderers/OpenGL/GLContextWGL.h @@ -22,8 +22,8 @@ #include "glad_wgl.h" #include "glad.h" -#include #include +#include class GLContextWGL final : public GLContext { @@ -31,7 +31,7 @@ public: GLContextWGL(const WindowInfo& wi); ~GLContextWGL() override; - static std::unique_ptr Create(const WindowInfo& wi, gsl::span versions_to_try); + static std::unique_ptr Create(const WindowInfo& wi, std::span versions_to_try); void* GetProcAddress(const char* name) override; bool ChangeSurface(const WindowInfo& new_wi) override; @@ -47,7 +47,7 @@ private: HDC GetDCAndSetPixelFormat(HWND hwnd); - bool Initialize(gsl::span versions_to_try); + bool Initialize(std::span versions_to_try); bool InitializeDC(); void ReleaseDC(); bool CreatePBuffer(); diff --git a/pcsx2/ImGui/FullscreenUI.cpp b/pcsx2/ImGui/FullscreenUI.cpp index 4a793e7459..691038d5eb 100644 --- a/pcsx2/ImGui/FullscreenUI.cpp +++ b/pcsx2/ImGui/FullscreenUI.cpp @@ -4069,7 +4069,7 @@ void FullscreenUI::DrawControllerSettingsPage() } const u32 subtype = USB::GetConfigSubType(*bsi, port, type); - const gsl::span subtypes(USB::GetDeviceSubtypes(type)); + const std::span subtypes(USB::GetDeviceSubtypes(type)); if (!subtypes.empty()) { const char* subtype_name = USB::GetDeviceSubtypeName(type, subtype); @@ -4094,7 +4094,7 @@ void FullscreenUI::DrawControllerSettingsPage() } } - const gsl::span bindings(USB::GetDeviceBindings(type, subtype)); + const std::span bindings(USB::GetDeviceBindings(type, subtype)); if (!bindings.empty()) { MenuHeading(fmt::format(ICON_FA_KEYBOARD " {} Bindings", USB::GetDeviceName(type)).c_str()); @@ -4110,7 +4110,7 @@ void FullscreenUI::DrawControllerSettingsPage() DrawInputBindingButton(bsi, bi.bind_type, section.c_str(), USB::GetConfigSubKey(type, bi.name).c_str(), bi.display_name); } - const gsl::span settings(USB::GetDeviceSettings(type, subtype)); + const std::span settings(USB::GetDeviceSettings(type, subtype)); if (!settings.empty()) { MenuHeading(fmt::format(ICON_FA_SLIDERS_H " {} Settings", USB::GetDeviceName(type)).c_str()); diff --git a/pcsx2/ImGui/ImGuiOverlays.cpp b/pcsx2/ImGui/ImGuiOverlays.cpp index 43290cbdb7..03e93a9770 100644 --- a/pcsx2/ImGui/ImGuiOverlays.cpp +++ b/pcsx2/ImGui/ImGuiOverlays.cpp @@ -40,7 +40,6 @@ #include "common/Timer.h" #include "fmt/core.h" -#include "gsl/span" #include "imgui.h" #include @@ -48,6 +47,7 @@ #include #include #include +#include #include #include @@ -60,7 +60,7 @@ namespace ImGuiManager static void DrawInputRecordingOverlay(float& position_y); } // namespace ImGuiManager -static std::tuple GetMinMax(gsl::span values) +static std::tuple GetMinMax(std::span values) { GSVector4 vmin(GSVector4::load(values.data())); GSVector4 vmax(vmin); @@ -565,7 +565,7 @@ void ImGuiManager::DrawInputsOverlay() if (EmuConfig.USB.Ports[port].DeviceType < 0) continue; - const gsl::span bindings(USB::GetDeviceBindings(port)); + const std::span bindings(USB::GetDeviceBindings(port)); if (bindings.empty()) continue; diff --git a/pcsx2/PINE.cpp b/pcsx2/PINE.cpp index 0610f047b9..1bf25aa139 100644 --- a/pcsx2/PINE.cpp +++ b/pcsx2/PINE.cpp @@ -200,7 +200,7 @@ void PINEServer::MainLoop() // use a bunch of auto auto receive_length = 0; auto end_length = 4; - const gsl::span ipc_buffer_span = gsl::make_span(m_ipc_buffer); + const std::span ipc_buffer_span(m_ipc_buffer); // while we haven't received the entire packet, maybe due to // socket datagram splittage, we continue to read @@ -271,7 +271,7 @@ void PINEServer::Deinitialize() } } -PINEServer::IPCBuffer PINEServer::ParseCommand(gsl::span buf, std::vector& ret_buffer, u32 buf_size) +PINEServer::IPCBuffer PINEServer::ParseCommand(std::span buf, std::vector& ret_buffer, u32 buf_size) { u32 ret_cnt = 5; u32 buf_cnt = 0; diff --git a/pcsx2/PINE.h b/pcsx2/PINE.h index f924b8136a..1a2b9e2946 100644 --- a/pcsx2/PINE.h +++ b/pcsx2/PINE.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #ifdef _WIN32 #include #include @@ -152,7 +152,7 @@ protected: * return value: IPCBuffer containing a buffer with the result * of the command and its size. */ - IPCBuffer ParseCommand(gsl::span buf, std::vector& ret_buffer, u32 buf_size); + IPCBuffer ParseCommand(std::span buf, std::vector& ret_buffer, u32 buf_size); /** * Formats an IPC buffer @@ -190,7 +190,7 @@ protected: * NB: implicitely inlined */ template - static T FromSpan(gsl::span span, int i) + static T FromSpan(std::span span, int i) { return *(T*)(&span[i]); } diff --git a/pcsx2/Patch.cpp b/pcsx2/Patch.cpp index e2d2dd3c80..66f7b397dd 100644 --- a/pcsx2/Patch.cpp +++ b/pcsx2/Patch.cpp @@ -33,11 +33,11 @@ #include "IconsFontAwesome5.h" #include "fmt/format.h" -#include "gsl/span" #include #include #include +#include #include #include @@ -148,7 +148,7 @@ namespace Patch static void TrimPatchLine(std::string& buffer); static int PatchTableExecute(PatchGroup* group, const std::string_view& lhs, const std::string_view& rhs, - const gsl::span& Table); + const std::span& Table); static void LoadPatchLine(PatchGroup* group, const std::string_view& line); static u32 LoadPatchesFromString(PatchList* patch_list, const std::string& patch_file); static bool OpenPatchesZip(); @@ -215,7 +215,7 @@ void Patch::TrimPatchLine(std::string& buffer) } int Patch::PatchTableExecute(PatchGroup* group, const std::string_view& lhs, const std::string_view& rhs, - const gsl::span& Table) + const std::span& Table) { int i = 0; diff --git a/pcsx2/SPU2/SndOut.cpp b/pcsx2/SPU2/SndOut.cpp index 30df94f08f..c22562dbf2 100644 --- a/pcsx2/SPU2/SndOut.cpp +++ b/pcsx2/SPU2/SndOut.cpp @@ -89,7 +89,7 @@ static SndOutModule* mods[] = static SndOutModule* s_output_module; -gsl::span GetSndOutModules() +std::span GetSndOutModules() { return mods; } diff --git a/pcsx2/SPU2/SndOut.h b/pcsx2/SPU2/SndOut.h index 5c3deb8d70..d6da6a7b4b 100644 --- a/pcsx2/SPU2/SndOut.h +++ b/pcsx2/SPU2/SndOut.h @@ -15,10 +15,9 @@ #pragma once +#include #include -#include "gsl/span" - // Number of stereo samples per SndOut block. // All drivers must work in units of this size when communicating with // SndOut. @@ -347,4 +346,4 @@ public: virtual int GetEmptySampleCount() = 0; }; -gsl::span GetSndOutModules(); +std::span GetSndOutModules(); diff --git a/pcsx2/USB/USB.cpp b/pcsx2/USB/USB.cpp index 34501a113a..6daf538fdd 100644 --- a/pcsx2/USB/USB.cpp +++ b/pcsx2/USB/USB.cpp @@ -576,32 +576,32 @@ const char* USB::GetDeviceSubtypeName(const std::string_view& device, u32 subtyp if (!dev) return "Unknown"; - const gsl::span subtypes(dev->SubTypes()); + const std::span subtypes(dev->SubTypes()); if (subtypes.empty() || subtype >= subtypes.size()) return ""; return subtypes[subtype]; } -gsl::span USB::GetDeviceSubtypes(const std::string_view& device) +std::span USB::GetDeviceSubtypes(const std::string_view& device) { const DeviceProxy* dev = RegisterDevice::instance().Device(device); - return dev ? dev->SubTypes() : gsl::span(); + return dev ? dev->SubTypes() : std::span(); } -gsl::span USB::GetDeviceBindings(const std::string_view& device, u32 subtype) +std::span USB::GetDeviceBindings(const std::string_view& device, u32 subtype) { const DeviceProxy* dev = RegisterDevice::instance().Device(device); - return dev ? dev->Bindings(subtype) : gsl::span(); + return dev ? dev->Bindings(subtype) : std::span(); } -gsl::span USB::GetDeviceSettings(const std::string_view& device, u32 subtype) +std::span USB::GetDeviceSettings(const std::string_view& device, u32 subtype) { const DeviceProxy* dev = RegisterDevice::instance().Device(device); - return dev ? dev->Settings(subtype) : gsl::span(); + return dev ? dev->Settings(subtype) : std::span(); } -gsl::span USB::GetDeviceBindings(u32 port) +std::span USB::GetDeviceBindings(u32 port) { pxAssert(port < NUM_PORTS); if (s_usb_device_proxy[port]) diff --git a/pcsx2/USB/USB.h b/pcsx2/USB/USB.h index 1cc8e60c88..4df0419f01 100644 --- a/pcsx2/USB/USB.h +++ b/pcsx2/USB/USB.h @@ -16,13 +16,12 @@ #pragma once #include +#include #include #include #include #include -#include "gsl/span" - #include "Config.h" class SettingsInterface; @@ -41,11 +40,11 @@ namespace USB std::vector> GetDeviceTypes(); const char* GetDeviceName(const std::string_view& device); const char* GetDeviceSubtypeName(const std::string_view& device, u32 subtype); - gsl::span GetDeviceSubtypes(const std::string_view& device); - gsl::span GetDeviceBindings(const std::string_view& device, u32 subtype); - gsl::span GetDeviceSettings(const std::string_view& device, u32 subtype); + std::span GetDeviceSubtypes(const std::string_view& device); + std::span GetDeviceBindings(const std::string_view& device, u32 subtype); + std::span GetDeviceSettings(const std::string_view& device, u32 subtype); - gsl::span GetDeviceBindings(u32 port); + std::span GetDeviceBindings(u32 port); float GetDeviceBindValue(u32 port, u32 bind_index); void SetDeviceBindValue(u32 port, u32 bind_index, float value); diff --git a/pcsx2/USB/deviceproxy.cpp b/pcsx2/USB/deviceproxy.cpp index d285e3c26e..53a0940d35 100644 --- a/pcsx2/USB/deviceproxy.cpp +++ b/pcsx2/USB/deviceproxy.cpp @@ -29,17 +29,17 @@ RegisterDevice* RegisterDevice::registerDevice = nullptr; DeviceProxy::~DeviceProxy() = default; -gsl::span DeviceProxy::SubTypes() const +std::span DeviceProxy::SubTypes() const { return {}; } -gsl::span DeviceProxy::Bindings(u32 subtype) const +std::span DeviceProxy::Bindings(u32 subtype) const { return {}; } -gsl::span DeviceProxy::Settings(u32 subtype) const +std::span DeviceProxy::Settings(u32 subtype) const { return {}; } diff --git a/pcsx2/USB/deviceproxy.h b/pcsx2/USB/deviceproxy.h index b393d5e2d1..009d8502e4 100644 --- a/pcsx2/USB/deviceproxy.h +++ b/pcsx2/USB/deviceproxy.h @@ -16,6 +16,7 @@ #pragma once #include +#include #include #include #include @@ -23,7 +24,6 @@ #include #include #include -#include "gsl/span" #include "qemu-usb/USBinternal.h" @@ -61,9 +61,9 @@ public: virtual const char* Name() const = 0; virtual const char* TypeName() const = 0; - virtual gsl::span SubTypes() const; - virtual gsl::span Bindings(u32 subtype) const; - virtual gsl::span Settings(u32 subtype) const; + virtual std::span SubTypes() const; + virtual std::span Bindings(u32 subtype) const; + virtual std::span Settings(u32 subtype) const; virtual USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const = 0; diff --git a/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp b/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp index 480bdd9942..577da2ee7f 100644 --- a/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp +++ b/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp @@ -514,14 +514,14 @@ namespace usb_eyetoy // TODO: Update device name } - gsl::span EyeToyWebCamDevice::SubTypes() const + std::span EyeToyWebCamDevice::SubTypes() const { static const char* subtypes[] = { TRANSLATE_NOOP("USB", "Sony EyeToy"), TRANSLATE_NOOP("USB", "Konami Capture Eye")}; return subtypes; } - gsl::span EyeToyWebCamDevice::Settings(u32 subtype) const + std::span EyeToyWebCamDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { {SettingInfo::Type::StringList, "device_name", TRANSLATE_NOOP("USB", "Device Name"), diff --git a/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.h b/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.h index 57b7270955..94f7aaf336 100644 --- a/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.h +++ b/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.h @@ -475,8 +475,8 @@ namespace usb_eyetoy const char* TypeName() const override; bool Freeze(USBDevice* dev, StateWrapper& sw) const override; void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override; - gsl::span SubTypes() const override; - gsl::span Settings(u32 subtype) const override; + std::span SubTypes() const override; + std::span Settings(u32 subtype) const override; }; } // namespace usb_eyetoy diff --git a/pcsx2/USB/usb-hid/usb-hid.cpp b/pcsx2/USB/usb-hid/usb-hid.cpp index 7d29fde079..4d528e9686 100644 --- a/pcsx2/USB/usb-hid/usb-hid.cpp +++ b/pcsx2/USB/usb-hid/usb-hid.cpp @@ -948,7 +948,7 @@ namespace usb_hid return "hidkbd"; } - gsl::span HIDKbdDevice::Bindings(u32 subtype) const + std::span HIDKbdDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo info[] = { {"Keyboard", TRANSLATE_NOOP("USB", "Keyboard"), InputBindingInfo::Type::Keyboard, 0, GenericInputBinding::Unknown}, @@ -1041,7 +1041,7 @@ namespace usb_hid return !sw.HasError(); } - gsl::span HIDMouseDevice::Bindings(u32 subtype) const + std::span HIDMouseDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo info[] = { {"Pointer", TRANSLATE_NOOP("USB", "Pointer"), InputBindingInfo::Type::Pointer, INPUT_BUTTON__MAX, GenericInputBinding::Unknown}, diff --git a/pcsx2/USB/usb-hid/usb-hid.h b/pcsx2/USB/usb-hid/usb-hid.h index 627056fe00..c93f159fbb 100644 --- a/pcsx2/USB/usb-hid/usb-hid.h +++ b/pcsx2/USB/usb-hid/usb-hid.h @@ -26,7 +26,7 @@ namespace usb_hid public: const char* Name() const override; const char* TypeName() const override; - gsl::span Bindings(u32 subtype) const override; + std::span Bindings(u32 subtype) const override; USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override; void SetBindingValue(USBDevice* dev, u32 bind, float value) const override; bool Freeze(USBDevice* dev, StateWrapper& sw) const override; @@ -37,7 +37,7 @@ namespace usb_hid public: const char* Name() const override; const char* TypeName() const override; - gsl::span Bindings(u32 subtype) const override; + std::span Bindings(u32 subtype) const override; float GetBindingValue(const USBDevice* dev, u32 bind) const override; void SetBindingValue(USBDevice* dev, u32 bind, float value) const override; USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override; diff --git a/pcsx2/USB/usb-lightgun/guncon2.cpp b/pcsx2/USB/usb-lightgun/guncon2.cpp index 3666084b57..61f2e281ca 100644 --- a/pcsx2/USB/usb-lightgun/guncon2.cpp +++ b/pcsx2/USB/usb-lightgun/guncon2.cpp @@ -478,7 +478,7 @@ namespace usb_lightgun s->button_state &= ~bit; } - gsl::span GunCon2Device::Bindings(u32 subtype) const + std::span GunCon2Device::Bindings(u32 subtype) const { static constexpr const InputBindingInfo bindings[] = { //{"pointer", "Pointer/Aiming", InputBindingInfo::Type::Pointer, BID_POINTER_X, GenericInputBinding::Unknown}, @@ -502,7 +502,7 @@ namespace usb_lightgun return bindings; } - gsl::span GunCon2Device::Settings(u32 subtype) const + std::span GunCon2Device::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { {SettingInfo::Type::Boolean, "custom_config", TRANSLATE_NOOP("USB", "Manual Screen Configuration"), diff --git a/pcsx2/USB/usb-lightgun/guncon2.h b/pcsx2/USB/usb-lightgun/guncon2.h index 7300680504..9b7d011b58 100644 --- a/pcsx2/USB/usb-lightgun/guncon2.h +++ b/pcsx2/USB/usb-lightgun/guncon2.h @@ -28,7 +28,7 @@ namespace usb_lightgun void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override; float GetBindingValue(const USBDevice* dev, u32 bind_index) const override; void SetBindingValue(USBDevice* dev, u32 bind_index, float value) const override; - gsl::span Bindings(u32 subtype) const override; - gsl::span Settings(u32 subtype) const override; + std::span Bindings(u32 subtype) const override; + std::span Settings(u32 subtype) const override; }; } // namespace usb_lightgun diff --git a/pcsx2/USB/usb-mic/usb-headset.cpp b/pcsx2/USB/usb-mic/usb-headset.cpp index af9e2efd5c..fce57655e7 100644 --- a/pcsx2/USB/usb-mic/usb-headset.cpp +++ b/pcsx2/USB/usb-mic/usb-headset.cpp @@ -994,7 +994,7 @@ namespace usb_mic // TODO: Update device } - gsl::span HeadsetDevice::Settings(u32 subtype) const + std::span HeadsetDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { {SettingInfo::Type::StringList, "input_device_name", TRANSLATE_NOOP("USB", "Input Device"), diff --git a/pcsx2/USB/usb-mic/usb-headset.h b/pcsx2/USB/usb-mic/usb-headset.h index 73deea5384..ee08955334 100644 --- a/pcsx2/USB/usb-mic/usb-headset.h +++ b/pcsx2/USB/usb-mic/usb-headset.h @@ -26,7 +26,7 @@ namespace usb_mic bool Freeze(USBDevice* dev, StateWrapper& sw) const override; void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override; - gsl::span Settings(u32 subtype) const override; + std::span Settings(u32 subtype) const override; }; } // namespace usb_mic diff --git a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp index 5b6d451b62..14b5eb6ca5 100644 --- a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp +++ b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp @@ -846,7 +846,7 @@ namespace usb_mic // TODO: Reload devices. } - gsl::span SingstarDevice::Settings(u32 subtype) const + std::span SingstarDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { {SettingInfo::Type::StringList, "player1_device_name", TRANSLATE_NOOP("USB", "Player 1 Device"), @@ -872,7 +872,7 @@ namespace usb_mic return TRANSLATE_NOOP("USB", "Logitech USB Mic"); } - gsl::span LogitechMicDevice::Settings(u32 subtype) const + std::span LogitechMicDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { {SettingInfo::Type::StringList, "input_device_name", TRANSLATE_NOOP("USB", "Input Device"), diff --git a/pcsx2/USB/usb-mic/usb-mic-singstar.h b/pcsx2/USB/usb-mic/usb-mic-singstar.h index 3a3664af95..48ca3dfaef 100644 --- a/pcsx2/USB/usb-mic/usb-mic-singstar.h +++ b/pcsx2/USB/usb-mic/usb-mic-singstar.h @@ -28,7 +28,7 @@ namespace usb_mic const char* TypeName() const override; bool Freeze(USBDevice* dev, StateWrapper& sw) const override; void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override; - gsl::span Settings(u32 subtype) const override; + std::span Settings(u32 subtype) const override; }; class LogitechMicDevice final : public SingstarDevice @@ -37,6 +37,6 @@ namespace usb_mic USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override; const char* TypeName() const override; const char* Name() const override; - gsl::span Settings(u32 subtype) const override; + std::span Settings(u32 subtype) const override; }; } // namespace usb_mic diff --git a/pcsx2/USB/usb-msd/usb-msd.cpp b/pcsx2/USB/usb-msd/usb-msd.cpp index 7a003412b9..61a0650f56 100644 --- a/pcsx2/USB/usb-msd/usb-msd.cpp +++ b/pcsx2/USB/usb-msd/usb-msd.cpp @@ -1053,7 +1053,7 @@ namespace usb_msd // TODO: Handle changes to path. } - gsl::span MsdDevice::Settings(u32 subtype) const + std::span MsdDevice::Settings(u32 subtype) const { static constexpr const SettingInfo settings[] = { {SettingInfo::Type::Path, "ImagePath", TRANSLATE_NOOP("USB", "Image Path"), diff --git a/pcsx2/USB/usb-msd/usb-msd.h b/pcsx2/USB/usb-msd/usb-msd.h index 5331846fa4..7050a84303 100644 --- a/pcsx2/USB/usb-msd/usb-msd.h +++ b/pcsx2/USB/usb-msd/usb-msd.h @@ -27,6 +27,6 @@ namespace usb_msd const char* Name() const override; bool Freeze(USBDevice* dev, StateWrapper& sw) const override; void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override; - gsl::span Settings(u32 subtype) const override; + std::span Settings(u32 subtype) const override; }; } // namespace usb_msd diff --git a/pcsx2/USB/usb-pad/usb-pad.cpp b/pcsx2/USB/usb-pad/usb-pad.cpp index 606f93e916..7bfd2c3f15 100644 --- a/pcsx2/USB/usb-pad/usb-pad.cpp +++ b/pcsx2/USB/usb-pad/usb-pad.cpp @@ -82,7 +82,7 @@ namespace usb_pad return exponent; } - static gsl::span GetWheelBindings(PS2WheelTypes wt) + static std::span GetWheelBindings(PS2WheelTypes wt) { switch (wt) { @@ -169,7 +169,7 @@ namespace usb_pad } } - static gsl::span GetWheelSettings(PS2WheelTypes wt) + static std::span GetWheelSettings(PS2WheelTypes wt) { if (wt <= WT_GT_FORCE) { @@ -874,7 +874,7 @@ namespace usb_pad s->SetBindValue(bind_index, value); } - gsl::span PadDevice::SubTypes() const + std::span PadDevice::SubTypes() const { static const char* subtypes[] = {TRANSLATE_NOOP("USB", "Driving Force"), TRANSLATE_NOOP("USB", "Driving Force Pro"), TRANSLATE_NOOP("USB", "Driving Force Pro (rev11.02)"), @@ -882,12 +882,12 @@ namespace usb_pad return subtypes; } - gsl::span PadDevice::Bindings(u32 subtype) const + std::span PadDevice::Bindings(u32 subtype) const { return GetWheelBindings(static_cast(subtype)); } - gsl::span PadDevice::Settings(u32 subtype) const + std::span PadDevice::Settings(u32 subtype) const { return GetWheelSettings(static_cast(subtype)); } @@ -939,12 +939,12 @@ namespace usb_pad return nullptr; } - gsl::span RBDrumKitDevice::SubTypes() const + std::span RBDrumKitDevice::SubTypes() const { return {}; } - gsl::span RBDrumKitDevice::Bindings(u32 subtype) const + std::span RBDrumKitDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo bindings[] = { {"Blue", TRANSLATE_NOOP("USB", "Blue"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::R1}, @@ -959,7 +959,7 @@ namespace usb_pad return bindings; } - gsl::span RBDrumKitDevice::Settings(u32 subtype) const + std::span RBDrumKitDevice::Settings(u32 subtype) const { return {}; } @@ -976,12 +976,12 @@ namespace usb_pad return "BuzzDevice"; } - gsl::span BuzzDevice::SubTypes() const + std::span BuzzDevice::SubTypes() const { return {}; } - gsl::span BuzzDevice::Bindings(u32 subtype) const + std::span BuzzDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo bindings[] = { {"Red1", TRANSLATE_NOOP("USB", "Player 1 Red"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Circle}, @@ -1012,7 +1012,7 @@ namespace usb_pad return bindings; } - gsl::span BuzzDevice::Settings(u32 subtype) const + std::span BuzzDevice::Settings(u32 subtype) const { return {}; } @@ -1050,12 +1050,12 @@ namespace usb_pad return "Keyboardmania"; } - gsl::span KeyboardmaniaDevice::SubTypes() const + std::span KeyboardmaniaDevice::SubTypes() const { return {}; } - gsl::span KeyboardmaniaDevice::Bindings(u32 subtype) const + std::span KeyboardmaniaDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo bindings[] = { {"C1", TRANSLATE_NOOP("USB", "C 1"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Unknown}, @@ -1092,7 +1092,7 @@ namespace usb_pad return bindings; } - gsl::span KeyboardmaniaDevice::Settings(u32 subtype) const + std::span KeyboardmaniaDevice::Settings(u32 subtype) const { return {}; } diff --git a/pcsx2/USB/usb-pad/usb-pad.h b/pcsx2/USB/usb-pad/usb-pad.h index 514f96a5c7..b598451044 100644 --- a/pcsx2/USB/usb-pad/usb-pad.h +++ b/pcsx2/USB/usb-pad/usb-pad.h @@ -91,9 +91,9 @@ namespace usb_pad void SetBindingValue(USBDevice* dev, u32 bind_index, float value) const override; void InputDeviceConnected(USBDevice* dev, const std::string_view& identifier) const override; void InputDeviceDisconnected(USBDevice* dev, const std::string_view& identifier) const override; - gsl::span SubTypes() const override; - gsl::span Bindings(u32 subtype) const override; - gsl::span Settings(u32 subtype) const override; + std::span SubTypes() const override; + std::span Bindings(u32 subtype) const override; + std::span Settings(u32 subtype) const override; }; class RBDrumKitDevice final : public PadDevice @@ -101,9 +101,9 @@ namespace usb_pad public: const char* Name() const override; const char* TypeName() const override; - gsl::span SubTypes() const override; - gsl::span Bindings(u32 subtype) const override; - gsl::span Settings(u32 subtype) const override; + std::span SubTypes() const override; + std::span Bindings(u32 subtype) const override; + std::span Settings(u32 subtype) const override; USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override; }; @@ -112,9 +112,9 @@ namespace usb_pad public: const char* Name() const; const char* TypeName() const; - gsl::span SubTypes() const; - gsl::span Bindings(u32 subtype) const; - gsl::span Settings(u32 subtype) const; + std::span SubTypes() const; + std::span Bindings(u32 subtype) const; + std::span Settings(u32 subtype) const; USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const; }; @@ -123,9 +123,9 @@ namespace usb_pad public: const char* Name() const; const char* TypeName() const; - gsl::span SubTypes() const; - gsl::span Bindings(u32 subtype) const; - gsl::span Settings(u32 subtype) const; + std::span SubTypes() const; + std::span Bindings(u32 subtype) const; + std::span Settings(u32 subtype) const; USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const; bool Freeze(USBDevice* dev, StateWrapper& sw) const; }; @@ -135,9 +135,9 @@ namespace usb_pad public: const char* Name() const; const char* TypeName() const; - gsl::span SubTypes() const; - gsl::span Bindings(u32 subtype) const; - gsl::span Settings(u32 subtype) const; + std::span SubTypes() const; + std::span Bindings(u32 subtype) const; + std::span Settings(u32 subtype) const; USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const; }; diff --git a/pcsx2/USB/usb-pad/usb-seamic.cpp b/pcsx2/USB/usb-pad/usb-seamic.cpp index 79f13b4886..40804f1e66 100644 --- a/pcsx2/USB/usb-pad/usb-seamic.cpp +++ b/pcsx2/USB/usb-pad/usb-seamic.cpp @@ -353,12 +353,12 @@ namespace usb_pad return "seamic"; } - gsl::span SeamicDevice::SubTypes() const + std::span SeamicDevice::SubTypes() const { return {}; } - gsl::span SeamicDevice::Bindings(u32 subtype) const + std::span SeamicDevice::Bindings(u32 subtype) const { // TODO: This is likely wrong. Someone who cares can fix it. static constexpr const InputBindingInfo bindings[] = { @@ -385,7 +385,7 @@ namespace usb_pad return bindings; } - gsl::span SeamicDevice::Settings(u32 subtype) const + std::span SeamicDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { {SettingInfo::Type::StringList, "input_device_name", TRANSLATE_NOOP("USB", "Input Device"), diff --git a/pcsx2/USB/usb-pad/usb-turntable.cpp b/pcsx2/USB/usb-pad/usb-turntable.cpp index 1a176c6907..f893281a92 100644 --- a/pcsx2/USB/usb-pad/usb-turntable.cpp +++ b/pcsx2/USB/usb-pad/usb-turntable.cpp @@ -430,7 +430,7 @@ namespace usb_pad } } - gsl::span DJTurntableDevice::Bindings(u32 subtype) const + std::span DJTurntableDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo bindings[] = { {"DPadUp", TRANSLATE_NOOP("USB", "D-Pad Up"), InputBindingInfo::Type::Button, CID_DJ_DPAD_UP, GenericInputBinding::DPadUp}, @@ -463,7 +463,7 @@ namespace usb_pad return bindings; } - gsl::span DJTurntableDevice::Settings(u32 subtype) const + std::span DJTurntableDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { {SettingInfo::Type::Float, "TurntableMultiplier", TRANSLATE_NOOP("USB", "Turntable Multiplier"), diff --git a/pcsx2/USB/usb-pad/usb-turntable.h b/pcsx2/USB/usb-pad/usb-turntable.h index 9d03411fc8..1a85578351 100644 --- a/pcsx2/USB/usb-pad/usb-turntable.h +++ b/pcsx2/USB/usb-pad/usb-turntable.h @@ -101,8 +101,8 @@ namespace usb_pad float GetBindingValue(const USBDevice* dev, u32 bind_index) const override; void SetBindingValue(USBDevice* dev, u32 bind_index, float value) const override; void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override; - gsl::span Bindings(u32 subtype) const override; - gsl::span Settings(u32 subtype) const override; + std::span Bindings(u32 subtype) const override; + std::span Settings(u32 subtype) const override; USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override; }; diff --git a/pcsx2/USB/usb-printer/usb-printer.cpp b/pcsx2/USB/usb-printer/usb-printer.cpp index b045b42eb5..be3295a87d 100644 --- a/pcsx2/USB/usb-printer/usb-printer.cpp +++ b/pcsx2/USB/usb-printer/usb-printer.cpp @@ -368,7 +368,7 @@ namespace usb_printer return true; } - gsl::span PrinterDevice::SubTypes() const + std::span PrinterDevice::SubTypes() const { return sPrinterNames; } diff --git a/pcsx2/USB/usb-printer/usb-printer.h b/pcsx2/USB/usb-printer/usb-printer.h index 5d8ab3d8c7..3c190eca89 100644 --- a/pcsx2/USB/usb-printer/usb-printer.h +++ b/pcsx2/USB/usb-printer/usb-printer.h @@ -128,7 +128,7 @@ namespace usb_printer const char* TypeName() const override; bool Freeze(USBDevice* dev, StateWrapper& sw) const override; - gsl::span SubTypes() const override; + std::span SubTypes() const override; }; #pragma pack(push, 1)