Codechange: Use null pointer literal instead of the NULL macro
This commit is contained in:

committed by
Michael Lutz

parent
3b4f224c0b
commit
7c8e7c6b6e
@@ -50,12 +50,12 @@ static DWORD WINAPI SoundThread(LPVOID arg)
|
||||
if ((hdr->dwFlags & WHDR_INQUEUE) != 0) continue;
|
||||
MxMixSamples(hdr->lpData, hdr->dwBufferLength / 4);
|
||||
if (waveOutWrite(_waveout, hdr, sizeof(WAVEHDR)) != MMSYSERR_NOERROR) {
|
||||
MessageBox(NULL, _T("Sounds are disabled until restart."), _T("waveOutWrite failed"), MB_ICONINFORMATION);
|
||||
MessageBox(nullptr, _T("Sounds are disabled until restart."), _T("waveOutWrite failed"), MB_ICONINFORMATION);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
WaitForSingleObject(_event, INFINITE);
|
||||
} while (_waveout != NULL);
|
||||
} while (_waveout != nullptr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ const char *SoundDriver_Win32::Start(const char * const *parm)
|
||||
_bufsize = min(_bufsize, UINT16_MAX);
|
||||
|
||||
try {
|
||||
if (NULL == (_event = CreateEvent(NULL, FALSE, FALSE, NULL))) throw "Failed to create event";
|
||||
if (nullptr == (_event = CreateEvent(nullptr, FALSE, FALSE, nullptr))) throw "Failed to create event";
|
||||
|
||||
if (waveOutOpen(&_waveout, WAVE_MAPPER, &wfex, (DWORD_PTR)_event, 0, CALLBACK_EVENT) != MMSYSERR_NOERROR) throw "waveOutOpen failed";
|
||||
|
||||
@@ -84,13 +84,13 @@ const char *SoundDriver_Win32::Start(const char * const *parm)
|
||||
PrepareHeader(&_wave_hdr[0]);
|
||||
PrepareHeader(&_wave_hdr[1]);
|
||||
|
||||
if (NULL == (_thread = CreateThread(NULL, 8192, SoundThread, 0, 0, &_threadId))) throw "Failed to create thread";
|
||||
if (nullptr == (_thread = CreateThread(nullptr, 8192, SoundThread, 0, 0, &_threadId))) throw "Failed to create thread";
|
||||
} catch (const char *error) {
|
||||
this->Stop();
|
||||
return error;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SoundDriver_Win32::Stop()
|
||||
@@ -98,7 +98,7 @@ void SoundDriver_Win32::Stop()
|
||||
HWAVEOUT waveout = _waveout;
|
||||
|
||||
/* Stop the sound thread. */
|
||||
_waveout = NULL;
|
||||
_waveout = nullptr;
|
||||
SetEvent(_event);
|
||||
WaitForSingleObject(_thread, INFINITE);
|
||||
|
||||
|
Reference in New Issue
Block a user