diff options
author | Chris Robinson <[email protected]> | 2011-07-02 21:33:53 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-07-02 21:33:53 -0700 |
commit | ac7ca07221c0a5c06b2502baa21ea94e5b65395c (patch) | |
tree | 8d5b7d67077d26c397342f814c897e0811240750 | |
parent | b043390ec2ad465acc12b98acdb51909bdfdd667 (diff) |
Get rid of a couple typedefs
-rw-r--r-- | Alc/ALu.c | 72 | ||||
-rw-r--r-- | Alc/alcEcho.c | 2 | ||||
-rw-r--r-- | Alc/alcModulator.c | 2 | ||||
-rw-r--r-- | Alc/alcReverb.c | 6 | ||||
-rw-r--r-- | Alc/mixer.c | 6 | ||||
-rw-r--r-- | Alc/panning.c | 8 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alSource.h | 4 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 12 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 2 |
10 files changed, 58 insertions, 58 deletions
@@ -89,21 +89,21 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) static const ALfloat angles_X71[8] = { -30.0f, 30.0f, 0.0f, 0.0f, -110.0f, 110.0f, -90.0f, 90.0f }; - static const Channel chans_Mono[1] = { FRONT_CENTER }; - static const Channel chans_Stereo[2] = { FRONT_LEFT, FRONT_RIGHT }; - static const Channel chans_Rear[2] = { BACK_LEFT, BACK_RIGHT }; - static const Channel chans_Quad[4] = { FRONT_LEFT, FRONT_RIGHT, - BACK_LEFT, BACK_RIGHT }; - static const Channel chans_X51[6] = { FRONT_LEFT, FRONT_RIGHT, - FRONT_CENTER, LFE, - BACK_LEFT, BACK_RIGHT }; - static const Channel chans_X61[7] = { FRONT_LEFT, FRONT_RIGHT, - FRONT_CENTER, LFE, BACK_CENTER, - SIDE_LEFT, SIDE_RIGHT }; - static const Channel chans_X71[8] = { FRONT_LEFT, FRONT_RIGHT, - FRONT_CENTER, LFE, - BACK_LEFT, BACK_RIGHT, - SIDE_LEFT, SIDE_RIGHT }; + static const enum Channel chans_Mono[1] = { FRONT_CENTER }; + static const enum Channel chans_Stereo[2] = { FRONT_LEFT, FRONT_RIGHT }; + static const enum Channel chans_Rear[2] = { BACK_LEFT, BACK_RIGHT }; + static const enum Channel chans_Quad[4] = { FRONT_LEFT, FRONT_RIGHT, + BACK_LEFT, BACK_RIGHT }; + static const enum Channel chans_X51[6] = { FRONT_LEFT, FRONT_RIGHT, + FRONT_CENTER, LFE, + BACK_LEFT, BACK_RIGHT }; + static const enum Channel chans_X61[7] = { FRONT_LEFT, FRONT_RIGHT, + FRONT_CENTER, LFE, BACK_CENTER, + SIDE_LEFT, SIDE_RIGHT }; + static const enum Channel chans_X71[8] = { FRONT_LEFT, FRONT_RIGHT, + FRONT_CENTER, LFE, + BACK_LEFT, BACK_RIGHT, + SIDE_LEFT, SIDE_RIGHT }; ALCdevice *Device = ALContext->Device; ALfloat SourceVolume,ListenerGain,MinVolume,MaxVolume; @@ -117,7 +117,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALint NumSends, Frequency; const ALfloat *SpeakerGain; const ALfloat *angles = NULL; - const Channel *chans = NULL; + const enum Channel *chans = NULL; ALint num_channels = 0; ALboolean VirtualChannels; ALfloat Pitch; @@ -218,7 +218,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) for(i = 0;i < (ALint)Device->NumChan;i++) { - Channel chan = Device->Speaker2Chan[i]; + enum Channel chan = Device->Speaker2Chan[i]; SrcMatrix[c][chan] += DryGain * ListenerGain * SpeakerGain[chan]; } @@ -312,7 +312,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) for(i = 0;i < (ALint)Device->NumChan;i++) { - Channel chan = Device->Speaker2Chan[i]; + enum Channel chan = Device->Speaker2Chan[i]; SrcMatrix[c][chan] += DryGain * ListenerGain * SpeakerGain[chan]; } @@ -747,7 +747,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) } for(i = 0;i < (ALint)Device->NumChan;i++) { - Channel chan = Device->Speaker2Chan[i]; + enum Channel chan = Device->Speaker2Chan[i]; ALfloat gain = lerp(AmbientGain, SpeakerGain[chan], DirGain); ALSource->Params.DryGains[0][chan] = DryGain * gain; } @@ -792,23 +792,23 @@ static __inline ALbyte aluF2B(ALfloat val) return i>>8; } -static const Channel MonoChans[] = { FRONT_CENTER }; -static const Channel StereoChans[] = { FRONT_LEFT, FRONT_RIGHT }; -static const Channel QuadChans[] = { FRONT_LEFT, FRONT_RIGHT, - BACK_LEFT, BACK_RIGHT }; -static const Channel X51Chans[] = { FRONT_LEFT, FRONT_RIGHT, - FRONT_CENTER, LFE, - BACK_LEFT, BACK_RIGHT }; -static const Channel X51SideChans[] = { FRONT_LEFT, FRONT_RIGHT, - FRONT_CENTER, LFE, - SIDE_LEFT, SIDE_RIGHT }; -static const Channel X61Chans[] = { FRONT_LEFT, FRONT_LEFT, - FRONT_CENTER, LFE, BACK_CENTER, - SIDE_LEFT, SIDE_RIGHT }; -static const Channel X71Chans[] = { FRONT_LEFT, FRONT_RIGHT, - FRONT_CENTER, LFE, - BACK_LEFT, BACK_RIGHT, - SIDE_LEFT, SIDE_RIGHT }; +static const enum Channel MonoChans[] = { FRONT_CENTER }; +static const enum Channel StereoChans[] = { FRONT_LEFT, FRONT_RIGHT }; +static const enum Channel QuadChans[] = { FRONT_LEFT, FRONT_RIGHT, + BACK_LEFT, BACK_RIGHT }; +static const enum Channel X51Chans[] = { FRONT_LEFT, FRONT_RIGHT, + FRONT_CENTER, LFE, + BACK_LEFT, BACK_RIGHT }; +static const enum Channel X51SideChans[] = { FRONT_LEFT, FRONT_RIGHT, + FRONT_CENTER, LFE, + SIDE_LEFT, SIDE_RIGHT }; +static const enum Channel X61Chans[] = { FRONT_LEFT, FRONT_LEFT, + FRONT_CENTER, LFE, BACK_CENTER, + SIDE_LEFT, SIDE_RIGHT }; +static const enum Channel X71Chans[] = { FRONT_LEFT, FRONT_RIGHT, + FRONT_CENTER, LFE, + BACK_LEFT, BACK_RIGHT, + SIDE_LEFT, SIDE_RIGHT }; #define DECL_TEMPLATE(T, chans,N, func) \ static void Write_##T##_##chans(ALCdevice *device, T *RESTRICT buffer, \ diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index aea2b00a..c47063bb 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -94,7 +94,7 @@ static ALboolean EchoDeviceUpdate(ALeffectState *effect, ALCdevice *Device) state->Gain[i] = 0.0f; for(i = 0;i < Device->NumChan;i++) { - Channel chan = Device->Speaker2Chan[i]; + enum Channel chan = Device->Speaker2Chan[i]; state->Gain[chan] = 1.0f; } diff --git a/Alc/alcModulator.c b/Alc/alcModulator.c index 55c6740e..8244b454 100644 --- a/Alc/alcModulator.c +++ b/Alc/alcModulator.c @@ -139,7 +139,7 @@ static ALboolean ModulatorDeviceUpdate(ALeffectState *effect, ALCdevice *Device) state->Gain[index] = 0.0f; for(index = 0;index < Device->NumChan;index++) { - Channel chan = Device->Speaker2Chan[index]; + enum Channel chan = Device->Speaker2Chan[index]; state->Gain[chan] = 1.0f; } diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c index 20638710..f2a09299 100644 --- a/Alc/alcReverb.c +++ b/Alc/alcReverb.c @@ -634,7 +634,7 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection State->Early.PanGain[index] = 0.0f; for(index = 0;index < Device->NumChan;index++) { - Channel chan = Device->Speaker2Chan[index]; + enum Channel chan = Device->Speaker2Chan[index]; State->Early.PanGain[chan] = lerp(1.0, speakerGain[chan], dirGain); } @@ -647,7 +647,7 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection State->Late.PanGain[index] = 0.0f; for(index = 0;index < Device->NumChan;index++) { - Channel chan = Device->Speaker2Chan[index]; + enum Channel chan = Device->Speaker2Chan[index]; State->Late.PanGain[chan] = lerp(1.0, speakerGain[chan], dirGain); } } @@ -1018,7 +1018,7 @@ static ALboolean VerbDeviceUpdate(ALeffectState *effect, ALCdevice *Device) State->Gain[index] = 0.0f; for(index = 0;index < Device->NumChan;index++) { - Channel chan = Device->Speaker2Chan[index]; + enum Channel chan = Device->Speaker2Chan[index]; State->Gain[chan] = 1.0f; } diff --git a/Alc/mixer.c b/Alc/mixer.c index 77c0d73b..050901ea 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -403,7 +403,7 @@ DECL_TEMPLATE(cubic) #undef DECL_TEMPLATE -MixerFunc SelectMixer(ALbuffer *Buffer, resampler_t Resampler) +MixerFunc SelectMixer(ALbuffer *Buffer, enum Resampler Resampler) { switch(Resampler) { @@ -441,7 +441,7 @@ DECL_TEMPLATE(cubic) #undef DECL_TEMPLATE -MixerFunc SelectHrtfMixer(ALbuffer *Buffer, resampler_t Resampler) +MixerFunc SelectHrtfMixer(ALbuffer *Buffer, enum Resampler Resampler) { switch(Resampler) { @@ -466,7 +466,7 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) ALuint BuffersPlayed; ALboolean Looping; ALuint increment; - resampler_t Resampler; + enum Resampler Resampler; ALenum State; ALuint OutPos; ALuint FrameSize; diff --git a/Alc/panning.c b/Alc/panning.c index 8df70f30..c3459ec1 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -32,12 +32,12 @@ #include "alu.h" static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHANNELS], - Channel Speaker2Chan[MAXCHANNELS], ALint chans) + enum Channel Speaker2Chan[MAXCHANNELS], ALint chans) { char layout_str[256]; char *confkey, *next; char *sep, *end; - Channel val; + enum Channel val; int i; if(!ConfigValueExists(NULL, name)) @@ -125,7 +125,7 @@ static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHAN if(min != i) { ALfloat tmpf; - Channel tmpc; + enum Channel tmpc; tmpf = SpeakerAngle[i]; SpeakerAngle[i] = SpeakerAngle[min]; @@ -166,7 +166,7 @@ ALint aluCart2LUTpos(ALfloat re, ALfloat im) ALvoid aluInitPanning(ALCdevice *Device) { ALfloat SpeakerAngle[MAXCHANNELS]; - Channel *Speaker2Chan; + enum Channel *Speaker2Chan; ALfloat Alpha, Theta; ALint pos; ALuint s; diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 8b8db208..44f32e0f 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -413,7 +413,7 @@ struct ALCdevice_struct ALuint DevChannels[MAXCHANNELS]; - Channel Speaker2Chan[MAXCHANNELS]; + enum Channel Speaker2Chan[MAXCHANNELS]; ALfloat PanningLUT[LUT_NUM][MAXCHANNELS]; ALuint NumChan; diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index 8afe8281..7f50f7ef 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -15,7 +15,7 @@ extern "C" { #define SRC_HISTORY_LENGTH (1<<SRC_HISTORY_BITS) #define SRC_HISTORY_MASK (SRC_HISTORY_LENGTH-1) -extern resampler_t DefaultResampler; +extern enum Resampler DefaultResampler; extern const ALsizei ResamplerPadding[RESAMPLER_MAX]; extern const ALsizei ResamplerPrePadding[RESAMPLER_MAX]; @@ -48,7 +48,7 @@ typedef struct ALsource ALenum DistanceModel; ALboolean VirtualChannels; - resampler_t Resampler; + enum Resampler Resampler; ALenum state; ALuint position; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 4e794f26..9ac3b234 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -70,7 +70,7 @@ typedef ALvoid (*MixerFunc)(struct ALsource *self, ALCdevice *Device, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize); -typedef enum { +enum Resampler { POINT_RESAMPLER = 0, LINEAR_RESAMPLER, CUBIC_RESAMPLER, @@ -78,9 +78,9 @@ typedef enum { RESAMPLER_MAX, RESAMPLER_MIN = -1, RESAMPLER_DEFAULT = LINEAR_RESAMPLER -} resampler_t; +}; -typedef enum { +enum Channel { FRONT_LEFT = 0, FRONT_RIGHT, FRONT_CENTER, @@ -92,7 +92,7 @@ typedef enum { SIDE_RIGHT, MAXCHANNELS -} Channel; +}; #define BUFFERSIZE 4096 @@ -135,8 +135,8 @@ ALint aluCart2LUTpos(ALfloat re, ALfloat im); ALvoid CalcSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext); ALvoid CalcNonAttnSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext); -MixerFunc SelectMixer(struct ALbuffer *Buffer, resampler_t Resampler); -MixerFunc SelectHrtfMixer(struct ALbuffer *Buffer, resampler_t Resampler); +MixerFunc SelectMixer(struct ALbuffer *Buffer, enum Resampler Resampler); +MixerFunc SelectHrtfMixer(struct ALbuffer *Buffer, enum Resampler Resampler); ALvoid MixSource(struct ALsource *Source, ALCdevice *Device, ALuint SamplesToDo); diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 1de380f9..a94a8f4a 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -33,7 +33,7 @@ #include "alAuxEffectSlot.h" -resampler_t DefaultResampler; +enum Resampler DefaultResampler; const ALsizei ResamplerPadding[RESAMPLER_MAX] = { 0, /* Point */ 1, /* Linear */ |