aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/winmm.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-15 04:24:33 -0800
committerChris Robinson <[email protected]>2018-11-15 04:24:33 -0800
commit1971d0f5c6c94b250f4b3e29bdfa95c836f900bc (patch)
treeb3af8bbd22fe26ad4db683214911897fae767ae3 /Alc/backends/winmm.cpp
parentd4f64b9e29319f56f2ecab1291918a52ec8336f1 (diff)
Use std::string instead of al_string for enumerating
Diffstat (limited to 'Alc/backends/winmm.cpp')
-rw-r--r--Alc/backends/winmm.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp
index 40a34b16..6e43ff79 100644
--- a/Alc/backends/winmm.cpp
+++ b/Alc/backends/winmm.cpp
@@ -672,7 +672,7 @@ struct ALCwinmmBackendFactory final : public ALCbackendFactory {
static ALCboolean ALCwinmmBackendFactory_init(ALCwinmmBackendFactory *self);
static void ALCwinmmBackendFactory_deinit(ALCwinmmBackendFactory *self);
static ALCboolean ALCwinmmBackendFactory_querySupport(ALCwinmmBackendFactory *self, ALCbackend_Type type);
-static void ALCwinmmBackendFactory_probe(ALCwinmmBackendFactory *self, enum DevProbe type, al_string *outnames);
+static void ALCwinmmBackendFactory_probe(ALCwinmmBackendFactory *self, enum DevProbe type, std::string *outnames);
static ALCbackend* ALCwinmmBackendFactory_createBackend(ALCwinmmBackendFactory *self, ALCdevice *device, ALCbackend_Type type);
DEFINE_ALCBACKENDFACTORY_VTABLE(ALCwinmmBackendFactory);
@@ -700,16 +700,15 @@ static ALCboolean ALCwinmmBackendFactory_querySupport(ALCwinmmBackendFactory* UN
return ALC_FALSE;
}
-static void ALCwinmmBackendFactory_probe(ALCwinmmBackendFactory* UNUSED(self), enum DevProbe type, al_string *outnames)
+static void ALCwinmmBackendFactory_probe(ALCwinmmBackendFactory* UNUSED(self), enum DevProbe type, std::string *outnames)
{
auto add_device = [outnames](const std::string &dname) -> void
{
- const char *name{dname.c_str()};
- size_t namelen{dname.length()};
/* +1 to also append the null char (to ensure a null-separated list and
* double-null terminated list).
*/
- alstr_append_range(outnames, name, name + namelen+1);
+ if(!dname.empty())
+ outnames->append(dname.c_str(), dname.length()+1);
};
switch(type)
{