You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Fix compilation warnings in JS and Windows builds
Warnings raised by Emscripten 1.38.0 and MinGW64 5.0.4 / GCC 8.3.0. JS can now build with `werror=yes warnings=extra`. MinGW64 still has a few warnings to resolve with `warnings=extra`, and only one with `warnings=all`. Part of #29033 and #29801.
This commit is contained in:
@@ -167,13 +167,13 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_c
|
||||
ERR_FAIL_COND_V(hr != S_OK, ERR_CANT_OPEN);
|
||||
|
||||
for (ULONG i = 0; i < count && !found; i++) {
|
||||
IMMDevice *device = NULL;
|
||||
IMMDevice *tmp_device = NULL;
|
||||
|
||||
hr = devices->Item(i, &device);
|
||||
hr = devices->Item(i, &tmp_device);
|
||||
ERR_BREAK(hr != S_OK);
|
||||
|
||||
IPropertyStore *props = NULL;
|
||||
hr = device->OpenPropertyStore(STGM_READ, &props);
|
||||
hr = tmp_device->OpenPropertyStore(STGM_READ, &props);
|
||||
ERR_BREAK(hr != S_OK);
|
||||
|
||||
PROPVARIANT propvar;
|
||||
@@ -183,7 +183,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_c
|
||||
ERR_BREAK(hr != S_OK);
|
||||
|
||||
if (p_device->device_name == String(propvar.pwszVal)) {
|
||||
hr = device->GetId(&strId);
|
||||
hr = tmp_device->GetId(&strId);
|
||||
ERR_BREAK(hr != S_OK);
|
||||
|
||||
found = true;
|
||||
@@ -191,7 +191,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_c
|
||||
|
||||
PropVariantClear(&propvar);
|
||||
props->Release();
|
||||
device->Release();
|
||||
tmp_device->Release();
|
||||
}
|
||||
|
||||
if (found) {
|
||||
@@ -289,7 +289,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_c
|
||||
}
|
||||
|
||||
DWORD streamflags = 0;
|
||||
if (mix_rate != pwfex->nSamplesPerSec) {
|
||||
if ((DWORD)mix_rate != pwfex->nSamplesPerSec) {
|
||||
streamflags |= AUDCLNT_STREAMFLAGS_RATEADJUST;
|
||||
pwfex->nSamplesPerSec = mix_rate;
|
||||
pwfex->nAvgBytesPerSec = pwfex->nSamplesPerSec * pwfex->nChannels * (pwfex->wBitsPerSample / 8);
|
||||
@@ -571,7 +571,7 @@ void AudioDriverWASAPI::thread_func(void *p_udata) {
|
||||
if (ad->audio_output.active) {
|
||||
ad->audio_server_process(ad->buffer_frames, ad->samples_in.ptrw());
|
||||
} else {
|
||||
for (unsigned int i = 0; i < ad->samples_in.size(); i++) {
|
||||
for (int i = 0; i < ad->samples_in.size(); i++) {
|
||||
ad->samples_in.write[i] = 0;
|
||||
}
|
||||
}
|
||||
@@ -699,7 +699,7 @@ void AudioDriverWASAPI::thread_func(void *p_udata) {
|
||||
ERR_BREAK(hr != S_OK);
|
||||
|
||||
// fixme: Only works for floating point atm
|
||||
for (int j = 0; j < num_frames_available; j++) {
|
||||
for (UINT32 j = 0; j < num_frames_available; j++) {
|
||||
int32_t l, r;
|
||||
|
||||
if (flags & AUDCLNT_BUFFERFLAGS_SILENT) {
|
||||
|
||||
Reference in New Issue
Block a user