aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/solaris.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-08-06 18:49:42 -0700
committerChris Robinson <[email protected]>2023-08-06 18:49:42 -0700
commit9296af5566afea4ba4cb78b374ef3ee0bf9bc04b (patch)
treeac71d8896956166aed320ed38ffb32847bc2cba7 /alc/backends/solaris.cpp
parent05d80f9b3283d7686a27e5d3ed0bac6086669368 (diff)
Use a string_view for the backend open method
Diffstat (limited to 'alc/backends/solaris.cpp')
-rw-r--r--alc/backends/solaris.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/alc/backends/solaris.cpp b/alc/backends/solaris.cpp
index 15dcc98f..38f9db19 100644
--- a/alc/backends/solaris.cpp
+++ b/alc/backends/solaris.cpp
@@ -62,7 +62,7 @@ struct SolarisBackend final : public BackendBase {
int mixerProc();
- void open(const char *name) override;
+ void open(std::string_view name) override;
bool reset() override;
void start() override;
void stop() override;
@@ -139,13 +139,13 @@ int SolarisBackend::mixerProc()
}
-void SolarisBackend::open(const char *name)
+void SolarisBackend::open(std::string_view name)
{
- if(!name)
+ if(name.empty())
name = solaris_device;
- else if(strcmp(name, solaris_device) != 0)
- throw al::backend_exception{al::backend_error::NoDevice, "Device name \"%s\" not found",
- name};
+ else if(name != solaris_device)
+ throw al::backend_exception{al::backend_error::NoDevice, "Device name \"%.*s\" not found",
+ static_cast<int>(name.length()), name.data()};
int fd{::open(solaris_driver.c_str(), O_WRONLY)};
if(fd == -1)