aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-15 06:23:01 -0800
committerChris Robinson <[email protected]>2018-11-15 06:23:01 -0800
commit7b3a2085aac8eac47f9968f331d3991167793e85 (patch)
tree5566b15f7a90fe8e0fb2b280c4f8b83c80247f4f /Alc/hrtf.cpp
parentab9f8162b84870161948ddd27d29483206dd4e57 (diff)
Use a regular char* for the device's name
Diffstat (limited to 'Alc/hrtf.cpp')
-rw-r--r--Alc/hrtf.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp
index 4bc1305d..783686d5 100644
--- a/Alc/hrtf.cpp
+++ b/Alc/hrtf.cpp
@@ -82,14 +82,6 @@ std::mutex LoadedHrtfLock;
HrtfEntry *LoadedHrtfs{nullptr};
-char *alstrdup(const std::string &str)
-{
- const size_t len{str.length()};
- char *ret{static_cast<char*>(al_calloc(DEF_ALIGN, len+1))};
- memcpy(ret, str.data(), len);
- return ret;
-}
-
class databuf final : public std::streambuf {
int_type underflow() override
{ return traits_type::eof(); }
@@ -1016,7 +1008,7 @@ void AddFileEntry(vector_EnumeratedHrtf *list, const std::string &filename)
VECTOR_FIND_IF(iter, const EnumeratedHrtf, *list, MATCH_NAME);
#undef MATCH_NAME
} while(iter != VECTOR_END(*list));
- EnumeratedHrtf entry{ alstrdup(newname), loaded_entry };
+ EnumeratedHrtf entry{ alstrdup(newname.c_str()), loaded_entry };
TRACE("Adding file entry \"%s\"\n", entry.name);
VECTOR_PUSH_BACK(*list, entry);
@@ -1082,7 +1074,7 @@ void AddBuiltInEntry(vector_EnumeratedHrtf *list, const std::string &filename, A
VECTOR_FIND_IF(iter, const EnumeratedHrtf, *list, MATCH_NAME);
#undef MATCH_NAME
} while(iter != VECTOR_END(*list));
- EnumeratedHrtf entry{ alstrdup(newname), loaded_entry };
+ EnumeratedHrtf entry{ alstrdup(newname.c_str()), loaded_entry };
TRACE("Adding built-in entry \"%s\"\n", entry.name);
VECTOR_PUSH_BACK(*list, entry);