aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/helpers.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-15 05:33:02 -0800
committerChris Robinson <[email protected]>2018-11-15 05:33:02 -0800
commit9d9d626d99e2514c03a783140fa11076a4580607 (patch)
tree090720e62c7c562d7a61d08d185bf6cb8ec5e6a4 /Alc/helpers.cpp
parent08bee7cb586abe53ebd36d4d54160a12bf9d6dfa (diff)
Avoid some more uses of al_string
Diffstat (limited to 'Alc/helpers.cpp')
-rw-r--r--Alc/helpers.cpp14
1 files changed, 6 insertions, 8 deletions
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