aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-18 18:20:11 -0700
committerChris Robinson <[email protected]>2019-09-18 18:20:11 -0700
commita092624ed3028cdea9b84403ca286c4415d4d57c (patch)
treedf5d52a9d86473da94df6679efc1efaf9c86d261
parent9a0a5c79d89d6056879124a7a9e68cffc5757a65 (diff)
Fix some Windows warnings
-rw-r--r--alc/backends/dsound.cpp6
-rw-r--r--alc/backends/wasapi.cpp18
2 files changed, 12 insertions, 12 deletions
diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp
index c581fe8f..c7014e33 100644
--- a/alc/backends/dsound.cpp
+++ b/alc/backends/dsound.cpp
@@ -828,9 +828,9 @@ ALCuint DSoundCapture::availableSamples()
DWORD BufferBytes{mBufferBytes};
DWORD LastCursor{mCursor};
- DWORD ReadCursor;
- void *ReadPtr1, *ReadPtr2;
- DWORD ReadCnt1, ReadCnt2;
+ DWORD ReadCursor{};
+ void *ReadPtr1{}, *ReadPtr2{};
+ DWORD ReadCnt1{}, ReadCnt2{};
HRESULT hr{mDSCbuffer->GetCurrentPosition(nullptr, &ReadCursor)};
if(SUCCEEDED(hr))
{
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp
index 0dec5cb9..1271eeaa 100644
--- a/alc/backends/wasapi.cpp
+++ b/alc/backends/wasapi.cpp
@@ -402,7 +402,7 @@ void TraceFormat(const char *msg, const WAVEFORMATEX *format)
}
-enum class MsgType : unsigned int {
+enum class MsgType {
OpenDevice,
ResetDevice,
StartDevice,
@@ -415,7 +415,7 @@ enum class MsgType : unsigned int {
Count
};
-constexpr char MessageStr[static_cast<unsigned int>(MsgType::Count)][20]{
+constexpr char MessageStr[static_cast<size_t>(MsgType::Count)][20]{
"Open Device",
"Reset Device",
"Start Device",
@@ -522,8 +522,8 @@ int WasapiProxy::messageHandler(std::promise<HRESULT> *promise)
while(popMessage(msg))
{
TRACE("Got message \"%s\" (0x%04x, this=%p)\n",
- MessageStr[static_cast<unsigned int>(msg.mType)], static_cast<unsigned int>(msg.mType),
- msg.mProxy);
+ MessageStr[static_cast<size_t>(msg.mType)], static_cast<int>(msg.mType),
+ decltype(std::declval<void*>()){msg.mProxy});
switch(msg.mType)
{
@@ -1042,8 +1042,8 @@ HRESULT WasapiPlayback::resetProxy()
return hr;
}
- UINT32 buffer_len, min_len;
- REFERENCE_TIME min_per;
+ UINT32 buffer_len{}, min_len{};
+ REFERENCE_TIME min_per{};
hr = mClient->GetDevicePeriod(&min_per, nullptr);
if(SUCCEEDED(hr))
hr = mClient->GetBufferSize(&buffer_len);
@@ -1414,7 +1414,7 @@ HRESULT WasapiCapture::resetProxy()
REFERENCE_TIME buf_time{mDevice->BufferSize * REFTIME_PER_SEC / mDevice->Frequency};
buf_time = maxu64(buf_time, REFTIME_PER_SEC/10);
- WAVEFORMATEXTENSIBLE OutputType;
+ WAVEFORMATEXTENSIBLE OutputType{};
OutputType.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
switch(mDevice->FmtChans)
{
@@ -1589,8 +1589,8 @@ HRESULT WasapiCapture::resetProxy()
return hr;
}
- UINT32 buffer_len;
- REFERENCE_TIME min_per;
+ UINT32 buffer_len{};
+ REFERENCE_TIME min_per{};
hr = mClient->GetDevicePeriod(&min_per, nullptr);
if(SUCCEEDED(hr))
hr = mClient->GetBufferSize(&buffer_len);