1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Re-define nil as nullptr, cleaning up some potential issues along the way

This commit is contained in:
2013-01-20 20:48:41 -08:00
parent c65ac61fb8
commit f86b549293
36 changed files with 123 additions and 130 deletions

View File

@ -198,7 +198,7 @@ void plAudioSystem::IEnumerateDevices()
char *devices = (char *)alcGetString(nil, ALC_DEVICE_SPECIFIER);
int major, minor;
while(*devices != nil)
while (*devices)
{
ALCdevice *device = alcOpenDevice(devices);
if (device)

View File

@ -125,7 +125,7 @@ void plDSoundBuffer::IRelease( void )
// Release stuff
fEAXSource.Release();
alSourcei(source, AL_BUFFER, nil);
alSourcei(source, AL_BUFFER, 0);
alDeleteSources(1, &source);
if(buffer)
alDeleteBuffers( 1, &buffer );
@ -173,7 +173,7 @@ bool plDSoundBuffer::FillBuffer(void *data, unsigned bytes, plWAVHeader *header)
{
if(source)
{
alSourcei(source, AL_BUFFER, nil);
alSourcei(source, AL_BUFFER, 0);
alDeleteSources(1, &source);
}
if(buffer)
@ -278,7 +278,7 @@ bool plDSoundBuffer::SetupStreamingSource(plAudioFileReader *stream)
plStatusLog::AddLineS("audio.log", "Failed to create audio source %d %d", error, source);
return false;
}
alSourcei(source, AL_BUFFER, nil);
alSourcei(source, AL_BUFFER, 0);
SetScalarVolume(0);
@ -344,7 +344,7 @@ bool plDSoundBuffer::SetupStreamingSource(void *data, unsigned bytes)
plStatusLog::AddLineS("audio.log", "Failed to create audio source %d %d", error, source);
return false;
}
alSourcei(source, AL_BUFFER, nil);
alSourcei(source, AL_BUFFER, 0);
SetScalarVolume(0);
alSourcef(source, AL_ROLLOFF_FACTOR, 0.3048);
@ -512,7 +512,7 @@ bool plDSoundBuffer::SetupVoiceSource()
{
return false;
}
alSourcei(source, AL_BUFFER, nil);
alSourcei(source, AL_BUFFER, 0);
alGetError();
//alSourcei(source, AL_PITCH, 0);

View File

@ -149,9 +149,9 @@ plWinMicLevel::plWinMicLevel()
if( sNumMixers == 0 )
return;
if( ::mixerOpen( &sMixerHandle, 0,
nil, // Window handle to receive callback messages
nil, MIXER_OBJECTF_MIXER ) != MMSYSERR_NOERROR )
if( ::mixerOpen( &sMixerHandle, 0,
0, // Window handle to receive callback messages
0, MIXER_OBJECTF_MIXER ) != MMSYSERR_NOERROR )
{
sMixerHandle = nil; // Just to be sure
return;