diff options
author | Chris Robinson <[email protected]> | 2018-11-15 05:33:02 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-15 05:33:02 -0800 |
commit | 9d9d626d99e2514c03a783140fa11076a4580607 (patch) | |
tree | 090720e62c7c562d7a61d08d185bf6cb8ec5e6a4 | |
parent | 08bee7cb586abe53ebd36d4d54160a12bf9d6dfa (diff) |
Avoid some more uses of al_string
-rw-r--r-- | Alc/backends/jack.cpp | 7 | ||||
-rw-r--r-- | Alc/backends/pulseaudio.cpp | 2 | ||||
-rw-r--r-- | Alc/helpers.cpp | 14 |
3 files changed, 10 insertions, 13 deletions
diff --git a/Alc/backends/jack.cpp b/Alc/backends/jack.cpp index 83f591fe..4aa6cd78 100644 --- a/Alc/backends/jack.cpp +++ b/Alc/backends/jack.cpp @@ -102,7 +102,7 @@ static ALCboolean jack_load(void) #ifdef HAVE_DYNLOAD if(!jack_handle) { - al_string missing_funcs = AL_STRING_INIT_STATIC(); + std::string missing_funcs; #ifdef _WIN32 #define JACKLIB "libjack.dll" @@ -121,7 +121,7 @@ static ALCboolean jack_load(void) p##f = reinterpret_cast<decltype(p##f)>(GetSymbol(jack_handle, #f)); \ if(p##f == nullptr) { \ error = ALC_TRUE; \ - alstr_append_cstr(&missing_funcs, "\n" #f); \ + missing_funcs += "\n" #f; \ } \ } while(0) JACK_FUNCS(LOAD_FUNC); @@ -133,11 +133,10 @@ static ALCboolean jack_load(void) if(error) { - WARN("Missing expected functions:%s\n", alstr_get_cstr(missing_funcs)); + WARN("Missing expected functions:%s\n", missing_funcs.c_str()); CloseLib(jack_handle); jack_handle = NULL; } - alstr_reset(&missing_funcs); } #endif diff --git a/Alc/backends/pulseaudio.cpp b/Alc/backends/pulseaudio.cpp index 37aee77c..77719e3c 100644 --- a/Alc/backends/pulseaudio.cpp +++ b/Alc/backends/pulseaudio.cpp @@ -1877,7 +1877,7 @@ static ALCboolean PulseBackendFactory_querySupport(PulseBackendFactory* UNUSED(s return ALC_FALSE; } -static void PulseBackendFactory_probe(PulseBackendFactory* UNUSED(self), enum DevProbe UNUSED(type), al_string* UNUSED(outnames)) +static void PulseBackendFactory_probe(PulseBackendFactory* UNUSED(self), enum DevProbe UNUSED(type), std::string* UNUSED(outnames)) { } diff --git a/Alc/helpers.cpp b/Alc/helpers.cpp index 833be68e..468df505 100644 --- a/Alc/helpers.cpp +++ b/Alc/helpers.cpp @@ -210,7 +210,7 @@ void FillCPUCaps(int capfilter) ERR("Failed to open /proc/cpuinfo, cannot check for NEON support\n"); else { - al_string features = AL_STRING_INIT_STATIC(); + std::string features; char buf[256]; while(fgets(buf, sizeof(buf), file) != nullptr) @@ -218,21 +218,21 @@ void FillCPUCaps(int capfilter) if(strncmp(buf, "Features\t:", 10) != 0) continue; - alstr_copy_cstr(&features, buf+10); - while(VECTOR_BACK(features) != '\n') + features = buf+10; + while(features.back() != '\n') { if(fgets(buf, sizeof(buf), file) == nullptr) break; - alstr_append_cstr(&features, buf); + features += buf; } break; } fclose(file); file = nullptr; - if(!alstr_empty(features)) + if(!features.empty()) { - const char *str = alstr_get_cstr(features); + const char *str = features.c_str(); while(isspace(str[0])) ++str; TRACE("Got features string:%s\n", str); @@ -246,8 +246,6 @@ void FillCPUCaps(int capfilter) ++str; } } - - alstr_reset(&features); } #endif |