diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-08-08 06:12:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-08 11:12:11 +0100 |
commit | 5e7668c2cd7ef9d017536f1e2e4ec89708f5b74f (patch) | |
tree | 6c55b909fd258251c238bfad9caf83113fd88f33 /NorthstarDedicatedTest/audio.cpp | |
parent | 286cea5f6280e568f5cb4c953d93993c98625ce4 (diff) | |
download | NorthstarLauncher-5e7668c2cd7ef9d017536f1e2e4ec89708f5b74f.tar.gz NorthstarLauncher-5e7668c2cd7ef9d017536f1e2e4ec89708f5b74f.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 +} |