aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-12 21:58:41 -0800
committerChris Robinson <[email protected]>2018-12-12 21:58:41 -0800
commit0d73b13f59e5df1bc87266e4ee3bced85a8dd5ef (patch)
tree20f5fbe04706b28e415dd21752a6fac484ca1890 /Alc
parentb779ebb512b840a325b32f258261c37bf36a1b7a (diff)
Add more casts for MSVC
Diffstat (limited to 'Alc')
-rw-r--r--Alc/alc.cpp2
-rw-r--r--Alc/ambdec.cpp23
-rw-r--r--Alc/backends/winmm.cpp3
-rw-r--r--Alc/helpers.cpp2
-rw-r--r--Alc/hrtf.cpp2
5 files changed, 20 insertions, 12 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 3ccf545a..5ef486cf 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -171,7 +171,7 @@ struct BackendInfo BackendList[] = {
{ "wave", WaveBackendFactory::getFactory },
#endif
};
-ALsizei BackendListSize = COUNTOF(BackendList);
+ALsizei BackendListSize = static_cast<ALsizei>(COUNTOF(BackendList));
struct BackendInfo PlaybackBackend;
struct BackendInfo CaptureBackend;
diff --git a/Alc/ambdec.cpp b/Alc/ambdec.cpp
index d25b8966..66fc2255 100644
--- a/Alc/ambdec.cpp
+++ b/Alc/ambdec.cpp
@@ -142,7 +142,8 @@ bool load_ambdec_matrix(ALfloat *gains, ALfloat (*matrix)[MAX_AMBI_COEFFS], ALsi
if(istr.fail()) break;
if(!istr.eof() && !std::isspace(istr.peek()))
{
- ERR("Extra junk on gain %u: %s\n", curgain+1, buffer.c_str()+istr.tellg());
+ ERR("Extra junk on gain %u: %s\n", curgain+1,
+ buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return false;
}
if(curgain < MAX_AMBI_ORDER+1)
@@ -163,7 +164,7 @@ bool load_ambdec_matrix(ALfloat *gains, ALfloat (*matrix)[MAX_AMBI_COEFFS], ALsi
if(!istr.eof() && !std::isspace(istr.peek()))
{
ERR("Extra junk on matrix element %ux%u: %s\n", cur, curidx,
- buffer.c_str()+istr.tellg());
+ buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return false;
}
if(curidx < MAX_AMBI_COEFFS)
@@ -228,7 +229,8 @@ int AmbDecConf::load(const char *fname) noexcept
istr >> Version;
if(!istr.eof() && !std::isspace(istr.peek()))
{
- ERR("Extra junk after version: %s\n", buffer.c_str()+istr.tellg());
+ ERR("Extra junk after version: %s\n",
+ buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return 0;
}
if(Version != 3)
@@ -242,7 +244,8 @@ int AmbDecConf::load(const char *fname) noexcept
istr >> std::hex >> ChanMask >> std::dec;
if(!istr.eof() && !std::isspace(istr.peek()))
{
- ERR("Extra junk after mask: %s\n", buffer.c_str()+istr.tellg());
+ ERR("Extra junk after mask: %s\n",
+ buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return 0;
}
}
@@ -251,7 +254,8 @@ int AmbDecConf::load(const char *fname) noexcept
istr >> FreqBands;
if(!istr.eof() && !std::isspace(istr.peek()))
{
- ERR("Extra junk after freq_bands: %s\n", buffer.c_str()+istr.tellg());
+ ERR("Extra junk after freq_bands: %s\n",
+ buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return 0;
}
if(FreqBands != 1 && FreqBands != 2)
@@ -265,7 +269,8 @@ int AmbDecConf::load(const char *fname) noexcept
istr >> NumSpeakers;
if(!istr.eof() && !std::isspace(istr.peek()))
{
- ERR("Extra junk after speakers: %s\n", buffer.c_str()+istr.tellg());
+ ERR("Extra junk after speakers: %s\n",
+ buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return 0;
}
if(NumSpeakers > MAX_OUTPUT_CHANNELS)
@@ -291,7 +296,8 @@ int AmbDecConf::load(const char *fname) noexcept
istr >> XOverFreq;
if(!istr.eof() && !std::isspace(istr.peek()))
{
- ERR("Extra junk after xover_freq: %s\n", buffer.c_str()+istr.tellg());
+ ERR("Extra junk after xover_freq: %s\n",
+ buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return 0;
}
}
@@ -300,7 +306,8 @@ int AmbDecConf::load(const char *fname) noexcept
istr >> XOverRatio;
if(!istr.eof() && !std::isspace(istr.peek()))
{
- ERR("Extra junk after xover_ratio: %s\n", buffer.c_str()+istr.tellg());
+ ERR("Extra junk after xover_ratio: %s\n",
+ buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return 0;
}
}
diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp
index 0d353906..ff5d026c 100644
--- a/Alc/backends/winmm.cpp
+++ b/Alc/backends/winmm.cpp
@@ -363,7 +363,8 @@ ALCboolean ALCwinmmPlayback_start(ALCwinmmPlayback *self)
[self](WAVEHDR &waveHdr) -> void
{ waveOutPrepareHeader(self->OutHdl, &waveHdr, static_cast<UINT>(sizeof(WAVEHDR))); }
);
- self->Writable.store(self->WaveBuffer.size(), std::memory_order_release);
+ self->Writable.store(static_cast<ALuint>(self->WaveBuffer.size()),
+ std::memory_order_release);
self->mKillNow.store(AL_FALSE, std::memory_order_release);
self->mThread = std::thread(ALCwinmmPlayback_mixerProc, self);
diff --git a/Alc/helpers.cpp b/Alc/helpers.cpp
index a46e857f..17942855 100644
--- a/Alc/helpers.cpp
+++ b/Alc/helpers.cpp
@@ -316,7 +316,7 @@ PathNamePair GetProcBinary()
al::vector<WCHAR> fullpath(256);
DWORD len;
- while((len=GetModuleFileNameW(nullptr, fullpath.data(), fullpath.size())) == fullpath.size())
+ while((len=GetModuleFileNameW(nullptr, fullpath.data(), static_cast<DWORD>(fullpath.size()))) == fullpath.size())
fullpath.resize(fullpath.size() << 1);
if(len == 0)
{
diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp
index 230574a9..5cc1e8b4 100644
--- a/Alc/hrtf.cpp
+++ b/Alc/hrtf.cpp
@@ -133,7 +133,7 @@ class databuf final : public std::streambuf {
if(pos < 0 || pos > egptr()-eback())
return traits_type::eof();
- setg(eback(), eback() + pos, egptr());
+ setg(eback(), eback() + static_cast<size_t>(pos), egptr());
return pos;
}