aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-24 11:41:50 -0800
committerChris Robinson <[email protected]>2018-11-24 11:41:50 -0800
commitd83cff02e5ac6f35231df6ce6a1e61ee21a6a41c (patch)
tree60346c3c9f90ae4c47a4ab4fa269201b89f9fb59
parentb508a760c88e8af6e852561dd7cf50edd7c601b9 (diff)
Ensure an enum is the appropriate size/type
-rw-r--r--OpenAL32/alSource.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp
index 8ee94600..0955d1e9 100644
--- a/OpenAL32/alSource.cpp
+++ b/OpenAL32/alSource.cpp
@@ -584,7 +584,7 @@ inline ALeffectslot *LookupEffectSlot(ALCcontext *context, ALuint id) noexcept
}
-enum SourceProp {
+enum SourceProp : ALenum {
srcPitch = AL_PITCH,
srcGain = AL_GAIN,
srcMinGain = AL_MIN_GAIN,
@@ -710,9 +710,7 @@ void SendStateChangeEvent(ALCcontext *context, ALuint id, ALenum state)
ALint FloatValsByProp(ALenum prop)
{
- if(prop != (ALenum)((SourceProp)prop))
- return 0;
- switch((SourceProp)prop)
+ switch(static_cast<SourceProp>(prop))
{
case AL_PITCH:
case AL_GAIN:
@@ -774,9 +772,7 @@ ALint FloatValsByProp(ALenum prop)
}
ALint DoubleValsByProp(ALenum prop)
{
- if(prop != (ALenum)((SourceProp)prop))
- return 0;
- switch((SourceProp)prop)
+ switch(static_cast<SourceProp>(prop))
{
case AL_PITCH:
case AL_GAIN:
@@ -837,9 +833,7 @@ ALint DoubleValsByProp(ALenum prop)
ALint IntValsByProp(ALenum prop)
{
- if(prop != (ALenum)((SourceProp)prop))
- return 0;
- switch((SourceProp)prop)
+ switch(static_cast<SourceProp>(prop))
{
case AL_PITCH:
case AL_GAIN:
@@ -898,9 +892,7 @@ ALint IntValsByProp(ALenum prop)
}
ALint Int64ValsByProp(ALenum prop)
{
- if(prop != (ALenum)((SourceProp)prop))
- return 0;
- switch((SourceProp)prop)
+ switch(static_cast<SourceProp>(prop))
{
case AL_PITCH:
case AL_GAIN: