diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-08-08 06:12:11 -0400 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-08-14 14:37:24 +0200 |
commit | c0e8e576df16171da6f0e68cbfa18123e8d1e7e0 (patch) | |
tree | fb157acfec3c1a510644481aade8f7115efb2295 /NorthstarDedicatedTest/audio.cpp | |
parent | d20cf6f08af37830d3bfc934cef356fa6a1aa102 (diff) | |
download | NorthstarLauncher-c0e8e576df16171da6f0e68cbfa18123e8d1e7e0.tar.gz NorthstarLauncher-c0e8e576df16171da6f0e68cbfa18123e8d1e7e0.zip |
Fix most clang/mingw issues (#226)
- Fix include case.
- Replace MSVC-specific align with standard alignas.
- Type fixes.
- Delete operator noexcept.
- A few other minor issues.
- clang-format everything.
- Use c++20 instead of c++17.
- Rewrite ERROR macro for launcher_wsock32_proxy.
- Use a plain ifstream for the audio.cpp wavStream.
Note: When compiling with clang, you'll need -municode.
Related to #212.
Diffstat (limited to 'NorthstarDedicatedTest/audio.cpp')
-rw-r--r-- | NorthstarDedicatedTest/audio.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/NorthstarDedicatedTest/audio.cpp b/NorthstarDedicatedTest/audio.cpp index 0b65670f..ed30d01b 100644 --- a/NorthstarDedicatedTest/audio.cpp +++ b/NorthstarDedicatedTest/audio.cpp @@ -194,7 +194,7 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa std::string pathString = file.path().string(); // Open the file. - std::basic_ifstream<uint8_t> wavStream(pathString, std::ios::binary); + std::ifstream wavStream(pathString, std::ios::binary); if (wavStream.fail()) { @@ -219,7 +219,7 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa [pathString, fileSize, data] { std::shared_lock lock(g_CustomAudioManager.m_loadingMutex); - std::basic_ifstream<uint8_t> wavStream(pathString, std::ios::binary); + std::ifstream wavStream(pathString, std::ios::binary); // would be weird if this got hit, since it would've worked previously if (wavStream.fail()) @@ -230,9 +230,9 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa // read from after the header first to preserve the empty header, then read the header last wavStream.seekg(sizeof(EMPTY_WAVE), std::ios::beg); - wavStream.read(&data[sizeof(EMPTY_WAVE)], fileSize - sizeof(EMPTY_WAVE)); + wavStream.read(reinterpret_cast<char*>(&data[sizeof(EMPTY_WAVE)]), fileSize - sizeof(EMPTY_WAVE)); wavStream.seekg(0, std::ios::beg); - wavStream.read(data, sizeof(EMPTY_WAVE)); + wavStream.read(reinterpret_cast<char*>(data), sizeof(EMPTY_WAVE)); wavStream.close(); spdlog::info("Finished async read of audio sample {}", pathString); @@ -512,4 +512,4 @@ void InitialiseMilesAudioHooks(HMODULE baseAddress) ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x57DAD0, &MilesLog_Hook, reinterpret_cast<LPVOID*>(&MilesLog_Original)); MilesStopAll = (MilesStopAll_Type)((char*)baseAddress + 0x580850); -}
\ No newline at end of file +} |