mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Cleanup: avoid comparing double to enum
This is necessary for C++20 compatibility.
This commit is contained in:
parent
8e9726c143
commit
0981cf25cf
3 changed files with 4 additions and 4 deletions
2
extern/audaspace/bindings/C/AUD_Device.cpp
vendored
2
extern/audaspace/bindings/C/AUD_Device.cpp
vendored
|
|
@ -51,7 +51,7 @@ AUD_API AUD_Device* AUD_Device_open(const char* type, AUD_DeviceSpecs specs, int
|
|||
dspecs.channels = CHANNELS_STEREO;
|
||||
if(dspecs.format == FORMAT_INVALID)
|
||||
dspecs.format = FORMAT_FLOAT32;
|
||||
if(dspecs.rate == RATE_INVALID)
|
||||
if(dspecs.rate == double(RATE_INVALID))
|
||||
dspecs.rate = RATE_48000;
|
||||
if(buffersize < 128)
|
||||
buffersize = AUD_DEFAULT_BUFFER_SIZE;
|
||||
|
|
|
|||
2
extern/audaspace/bindings/C/AUD_Sound.cpp
vendored
2
extern/audaspace/bindings/C/AUD_Sound.cpp
vendored
|
|
@ -174,7 +174,7 @@ AUD_API const char* AUD_Sound_write(AUD_Sound* sound, const char* filename, AUD_
|
|||
DeviceSpecs specs;
|
||||
specs.specs = reader->getSpecs();
|
||||
|
||||
if((rate != RATE_INVALID) && (specs.rate != rate))
|
||||
if((rate != double(RATE_INVALID)) && (specs.rate != rate))
|
||||
{
|
||||
specs.rate = rate;
|
||||
reader = std::make_shared<JOSResampleReader>(reader, rate);
|
||||
|
|
|
|||
|
|
@ -931,7 +931,7 @@ void OpenALDevice::updateStreams()
|
|||
|
||||
ALCint attribs[] = { ALC_FREQUENCY, (ALCint)specs.rate, 0 };
|
||||
ALCint* attributes = attribs;
|
||||
if(specs.rate == RATE_INVALID)
|
||||
if(specs.rate == double(RATE_INVALID))
|
||||
attributes = nullptr;
|
||||
|
||||
m_context = alcCreateContext(m_device, attributes);
|
||||
|
|
@ -1152,7 +1152,7 @@ OpenALDevice::OpenALDevice(DeviceSpecs specs, int buffersize, const std::string
|
|||
// at least try to set the frequency
|
||||
ALCint attribs[] = { ALC_FREQUENCY, (ALCint)specs.rate, 0 };
|
||||
ALCint* attributes = attribs;
|
||||
if(specs.rate == RATE_INVALID)
|
||||
if(specs.rate == double(RATE_INVALID))
|
||||
attributes = nullptr;
|
||||
|
||||
m_context = alcCreateContext(m_device, attributes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue