diff options
author | Chris Robinson <[email protected]> | 2018-11-15 04:24:33 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-15 04:24:33 -0800 |
commit | 1971d0f5c6c94b250f4b3e29bdfa95c836f900bc (patch) | |
tree | b3af8bbd22fe26ad4db683214911897fae767ae3 /Alc/backends/dsound.cpp | |
parent | d4f64b9e29319f56f2ecab1291918a52ec8336f1 (diff) |
Use std::string instead of al_string for enumerating
Diffstat (limited to 'Alc/backends/dsound.cpp')
-rw-r--r-- | Alc/backends/dsound.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp index 10650175..50e956ea 100644 --- a/Alc/backends/dsound.cpp +++ b/Alc/backends/dsound.cpp @@ -951,7 +951,7 @@ ALCbackendFactory *ALCdsoundBackendFactory_getFactory(void); static ALCboolean ALCdsoundBackendFactory_init(ALCdsoundBackendFactory *self); static void ALCdsoundBackendFactory_deinit(ALCdsoundBackendFactory *self); static ALCboolean ALCdsoundBackendFactory_querySupport(ALCdsoundBackendFactory *self, ALCbackend_Type type); -static void ALCdsoundBackendFactory_probe(ALCdsoundBackendFactory *self, enum DevProbe type, al_string *outnames); +static void ALCdsoundBackendFactory_probe(ALCdsoundBackendFactory *self, enum DevProbe type, std::string *outnames); static ALCbackend* ALCdsoundBackendFactory_createBackend(ALCdsoundBackendFactory *self, ALCdevice *device, ALCbackend_Type type); DEFINE_ALCBACKENDFACTORY_VTABLE(ALCdsoundBackendFactory); @@ -994,16 +994,14 @@ static ALCboolean ALCdsoundBackendFactory_querySupport(ALCdsoundBackendFactory* return ALC_FALSE; } -static void ALCdsoundBackendFactory_probe(ALCdsoundBackendFactory* UNUSED(self), enum DevProbe type, al_string *outnames) +static void ALCdsoundBackendFactory_probe(ALCdsoundBackendFactory* UNUSED(self), enum DevProbe type, std::string *outnames) { auto add_device = [outnames](const DevMap &entry) -> void { - const char *name{entry.name.c_str()}; - size_t namelen{entry.name.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); + outnames->append(entry.name.c_str(), entry.name.length()+1); }; /* Initialize COM to prevent name truncation */ |