Get rid of a couple typedefs

This commit is contained in:
Chris Robinson 2011-07-02 21:33:53 -07:00
parent b043390ec2
commit ac7ca07221
10 changed files with 58 additions and 58 deletions

View File

@ -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, static const ALfloat angles_X71[8] = { -30.0f, 30.0f, 0.0f, 0.0f,
-110.0f, 110.0f, -90.0f, 90.0f }; -110.0f, 110.0f, -90.0f, 90.0f };
static const Channel chans_Mono[1] = { FRONT_CENTER }; static const enum Channel chans_Mono[1] = { FRONT_CENTER };
static const Channel chans_Stereo[2] = { FRONT_LEFT, FRONT_RIGHT }; static const enum Channel chans_Stereo[2] = { FRONT_LEFT, FRONT_RIGHT };
static const Channel chans_Rear[2] = { BACK_LEFT, BACK_RIGHT }; static const enum Channel chans_Rear[2] = { BACK_LEFT, BACK_RIGHT };
static const Channel chans_Quad[4] = { FRONT_LEFT, FRONT_RIGHT, static const enum Channel chans_Quad[4] = { FRONT_LEFT, FRONT_RIGHT,
BACK_LEFT, BACK_RIGHT }; BACK_LEFT, BACK_RIGHT };
static const Channel chans_X51[6] = { FRONT_LEFT, FRONT_RIGHT, static const enum Channel chans_X51[6] = { FRONT_LEFT, FRONT_RIGHT,
FRONT_CENTER, LFE, FRONT_CENTER, LFE,
BACK_LEFT, BACK_RIGHT }; BACK_LEFT, BACK_RIGHT };
static const Channel chans_X61[7] = { FRONT_LEFT, FRONT_RIGHT, static const enum Channel chans_X61[7] = { FRONT_LEFT, FRONT_RIGHT,
FRONT_CENTER, LFE, BACK_CENTER, FRONT_CENTER, LFE, BACK_CENTER,
SIDE_LEFT, SIDE_RIGHT }; SIDE_LEFT, SIDE_RIGHT };
static const Channel chans_X71[8] = { FRONT_LEFT, FRONT_RIGHT, static const enum Channel chans_X71[8] = { FRONT_LEFT, FRONT_RIGHT,
FRONT_CENTER, LFE, FRONT_CENTER, LFE,
BACK_LEFT, BACK_RIGHT, BACK_LEFT, BACK_RIGHT,
SIDE_LEFT, SIDE_RIGHT }; SIDE_LEFT, SIDE_RIGHT };
ALCdevice *Device = ALContext->Device; ALCdevice *Device = ALContext->Device;
ALfloat SourceVolume,ListenerGain,MinVolume,MaxVolume; ALfloat SourceVolume,ListenerGain,MinVolume,MaxVolume;
@ -117,7 +117,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALint NumSends, Frequency; ALint NumSends, Frequency;
const ALfloat *SpeakerGain; const ALfloat *SpeakerGain;
const ALfloat *angles = NULL; const ALfloat *angles = NULL;
const Channel *chans = NULL; const enum Channel *chans = NULL;
ALint num_channels = 0; ALint num_channels = 0;
ALboolean VirtualChannels; ALboolean VirtualChannels;
ALfloat Pitch; ALfloat Pitch;
@ -218,7 +218,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
for(i = 0;i < (ALint)Device->NumChan;i++) for(i = 0;i < (ALint)Device->NumChan;i++)
{ {
Channel chan = Device->Speaker2Chan[i]; enum Channel chan = Device->Speaker2Chan[i];
SrcMatrix[c][chan] += DryGain * ListenerGain * SrcMatrix[c][chan] += DryGain * ListenerGain *
SpeakerGain[chan]; SpeakerGain[chan];
} }
@ -312,7 +312,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
for(i = 0;i < (ALint)Device->NumChan;i++) for(i = 0;i < (ALint)Device->NumChan;i++)
{ {
Channel chan = Device->Speaker2Chan[i]; enum Channel chan = Device->Speaker2Chan[i];
SrcMatrix[c][chan] += DryGain * ListenerGain * SrcMatrix[c][chan] += DryGain * ListenerGain *
SpeakerGain[chan]; SpeakerGain[chan];
} }
@ -747,7 +747,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
} }
for(i = 0;i < (ALint)Device->NumChan;i++) 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); ALfloat gain = lerp(AmbientGain, SpeakerGain[chan], DirGain);
ALSource->Params.DryGains[0][chan] = DryGain * gain; ALSource->Params.DryGains[0][chan] = DryGain * gain;
} }
@ -792,23 +792,23 @@ static __inline ALbyte aluF2B(ALfloat val)
return i>>8; return i>>8;
} }
static const Channel MonoChans[] = { FRONT_CENTER }; static const enum Channel MonoChans[] = { FRONT_CENTER };
static const Channel StereoChans[] = { FRONT_LEFT, FRONT_RIGHT }; static const enum Channel StereoChans[] = { FRONT_LEFT, FRONT_RIGHT };
static const Channel QuadChans[] = { FRONT_LEFT, FRONT_RIGHT, static const enum Channel QuadChans[] = { FRONT_LEFT, FRONT_RIGHT,
BACK_LEFT, BACK_RIGHT }; BACK_LEFT, BACK_RIGHT };
static const Channel X51Chans[] = { FRONT_LEFT, FRONT_RIGHT, static const enum Channel X51Chans[] = { FRONT_LEFT, FRONT_RIGHT,
FRONT_CENTER, LFE, FRONT_CENTER, LFE,
BACK_LEFT, BACK_RIGHT }; BACK_LEFT, BACK_RIGHT };
static const Channel X51SideChans[] = { FRONT_LEFT, FRONT_RIGHT, static const enum Channel X51SideChans[] = { FRONT_LEFT, FRONT_RIGHT,
FRONT_CENTER, LFE, FRONT_CENTER, LFE,
SIDE_LEFT, SIDE_RIGHT }; SIDE_LEFT, SIDE_RIGHT };
static const Channel X61Chans[] = { FRONT_LEFT, FRONT_LEFT, static const enum Channel X61Chans[] = { FRONT_LEFT, FRONT_LEFT,
FRONT_CENTER, LFE, BACK_CENTER, FRONT_CENTER, LFE, BACK_CENTER,
SIDE_LEFT, SIDE_RIGHT }; SIDE_LEFT, SIDE_RIGHT };
static const Channel X71Chans[] = { FRONT_LEFT, FRONT_RIGHT, static const enum Channel X71Chans[] = { FRONT_LEFT, FRONT_RIGHT,
FRONT_CENTER, LFE, FRONT_CENTER, LFE,
BACK_LEFT, BACK_RIGHT, BACK_LEFT, BACK_RIGHT,
SIDE_LEFT, SIDE_RIGHT }; SIDE_LEFT, SIDE_RIGHT };
#define DECL_TEMPLATE(T, chans,N, func) \ #define DECL_TEMPLATE(T, chans,N, func) \
static void Write_##T##_##chans(ALCdevice *device, T *RESTRICT buffer, \ static void Write_##T##_##chans(ALCdevice *device, T *RESTRICT buffer, \

View File

@ -94,7 +94,7 @@ static ALboolean EchoDeviceUpdate(ALeffectState *effect, ALCdevice *Device)
state->Gain[i] = 0.0f; state->Gain[i] = 0.0f;
for(i = 0;i < Device->NumChan;i++) for(i = 0;i < Device->NumChan;i++)
{ {
Channel chan = Device->Speaker2Chan[i]; enum Channel chan = Device->Speaker2Chan[i];
state->Gain[chan] = 1.0f; state->Gain[chan] = 1.0f;
} }

View File

@ -139,7 +139,7 @@ static ALboolean ModulatorDeviceUpdate(ALeffectState *effect, ALCdevice *Device)
state->Gain[index] = 0.0f; state->Gain[index] = 0.0f;
for(index = 0;index < Device->NumChan;index++) for(index = 0;index < Device->NumChan;index++)
{ {
Channel chan = Device->Speaker2Chan[index]; enum Channel chan = Device->Speaker2Chan[index];
state->Gain[chan] = 1.0f; state->Gain[chan] = 1.0f;
} }

View File

@ -634,7 +634,7 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection
State->Early.PanGain[index] = 0.0f; State->Early.PanGain[index] = 0.0f;
for(index = 0;index < Device->NumChan;index++) 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); 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; State->Late.PanGain[index] = 0.0f;
for(index = 0;index < Device->NumChan;index++) 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); 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; State->Gain[index] = 0.0f;
for(index = 0;index < Device->NumChan;index++) for(index = 0;index < Device->NumChan;index++)
{ {
Channel chan = Device->Speaker2Chan[index]; enum Channel chan = Device->Speaker2Chan[index];
State->Gain[chan] = 1.0f; State->Gain[chan] = 1.0f;
} }

View File

@ -403,7 +403,7 @@ DECL_TEMPLATE(cubic)
#undef DECL_TEMPLATE #undef DECL_TEMPLATE
MixerFunc SelectMixer(ALbuffer *Buffer, resampler_t Resampler) MixerFunc SelectMixer(ALbuffer *Buffer, enum Resampler Resampler)
{ {
switch(Resampler) switch(Resampler)
{ {
@ -441,7 +441,7 @@ DECL_TEMPLATE(cubic)
#undef DECL_TEMPLATE #undef DECL_TEMPLATE
MixerFunc SelectHrtfMixer(ALbuffer *Buffer, resampler_t Resampler) MixerFunc SelectHrtfMixer(ALbuffer *Buffer, enum Resampler Resampler)
{ {
switch(Resampler) switch(Resampler)
{ {
@ -466,7 +466,7 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
ALuint BuffersPlayed; ALuint BuffersPlayed;
ALboolean Looping; ALboolean Looping;
ALuint increment; ALuint increment;
resampler_t Resampler; enum Resampler Resampler;
ALenum State; ALenum State;
ALuint OutPos; ALuint OutPos;
ALuint FrameSize; ALuint FrameSize;

View File

@ -32,12 +32,12 @@
#include "alu.h" #include "alu.h"
static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHANNELS], 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 layout_str[256];
char *confkey, *next; char *confkey, *next;
char *sep, *end; char *sep, *end;
Channel val; enum Channel val;
int i; int i;
if(!ConfigValueExists(NULL, name)) if(!ConfigValueExists(NULL, name))
@ -125,7 +125,7 @@ static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHAN
if(min != i) if(min != i)
{ {
ALfloat tmpf; ALfloat tmpf;
Channel tmpc; enum Channel tmpc;
tmpf = SpeakerAngle[i]; tmpf = SpeakerAngle[i];
SpeakerAngle[i] = SpeakerAngle[min]; SpeakerAngle[i] = SpeakerAngle[min];
@ -166,7 +166,7 @@ ALint aluCart2LUTpos(ALfloat re, ALfloat im)
ALvoid aluInitPanning(ALCdevice *Device) ALvoid aluInitPanning(ALCdevice *Device)
{ {
ALfloat SpeakerAngle[MAXCHANNELS]; ALfloat SpeakerAngle[MAXCHANNELS];
Channel *Speaker2Chan; enum Channel *Speaker2Chan;
ALfloat Alpha, Theta; ALfloat Alpha, Theta;
ALint pos; ALint pos;
ALuint s; ALuint s;

View File

@ -413,7 +413,7 @@ struct ALCdevice_struct
ALuint DevChannels[MAXCHANNELS]; ALuint DevChannels[MAXCHANNELS];
Channel Speaker2Chan[MAXCHANNELS]; enum Channel Speaker2Chan[MAXCHANNELS];
ALfloat PanningLUT[LUT_NUM][MAXCHANNELS]; ALfloat PanningLUT[LUT_NUM][MAXCHANNELS];
ALuint NumChan; ALuint NumChan;

View File

@ -15,7 +15,7 @@ extern "C" {
#define SRC_HISTORY_LENGTH (1<<SRC_HISTORY_BITS) #define SRC_HISTORY_LENGTH (1<<SRC_HISTORY_BITS)
#define SRC_HISTORY_MASK (SRC_HISTORY_LENGTH-1) #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 ResamplerPadding[RESAMPLER_MAX];
extern const ALsizei ResamplerPrePadding[RESAMPLER_MAX]; extern const ALsizei ResamplerPrePadding[RESAMPLER_MAX];
@ -48,7 +48,7 @@ typedef struct ALsource
ALenum DistanceModel; ALenum DistanceModel;
ALboolean VirtualChannels; ALboolean VirtualChannels;
resampler_t Resampler; enum Resampler Resampler;
ALenum state; ALenum state;
ALuint position; ALuint position;

View File

@ -70,7 +70,7 @@ typedef ALvoid (*MixerFunc)(struct ALsource *self, ALCdevice *Device,
ALuint OutPos, ALuint SamplesToDo, ALuint OutPos, ALuint SamplesToDo,
ALuint BufferSize); ALuint BufferSize);
typedef enum { enum Resampler {
POINT_RESAMPLER = 0, POINT_RESAMPLER = 0,
LINEAR_RESAMPLER, LINEAR_RESAMPLER,
CUBIC_RESAMPLER, CUBIC_RESAMPLER,
@ -78,9 +78,9 @@ typedef enum {
RESAMPLER_MAX, RESAMPLER_MAX,
RESAMPLER_MIN = -1, RESAMPLER_MIN = -1,
RESAMPLER_DEFAULT = LINEAR_RESAMPLER RESAMPLER_DEFAULT = LINEAR_RESAMPLER
} resampler_t; };
typedef enum { enum Channel {
FRONT_LEFT = 0, FRONT_LEFT = 0,
FRONT_RIGHT, FRONT_RIGHT,
FRONT_CENTER, FRONT_CENTER,
@ -92,7 +92,7 @@ typedef enum {
SIDE_RIGHT, SIDE_RIGHT,
MAXCHANNELS MAXCHANNELS
} Channel; };
#define BUFFERSIZE 4096 #define BUFFERSIZE 4096
@ -135,8 +135,8 @@ ALint aluCart2LUTpos(ALfloat re, ALfloat im);
ALvoid CalcSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext); ALvoid CalcSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext);
ALvoid CalcNonAttnSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext); ALvoid CalcNonAttnSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext);
MixerFunc SelectMixer(struct ALbuffer *Buffer, resampler_t Resampler); MixerFunc SelectMixer(struct ALbuffer *Buffer, enum Resampler Resampler);
MixerFunc SelectHrtfMixer(struct ALbuffer *Buffer, resampler_t Resampler); MixerFunc SelectHrtfMixer(struct ALbuffer *Buffer, enum Resampler Resampler);
ALvoid MixSource(struct ALsource *Source, ALCdevice *Device, ALuint SamplesToDo); ALvoid MixSource(struct ALsource *Source, ALCdevice *Device, ALuint SamplesToDo);

View File

@ -33,7 +33,7 @@
#include "alAuxEffectSlot.h" #include "alAuxEffectSlot.h"
resampler_t DefaultResampler; enum Resampler DefaultResampler;
const ALsizei ResamplerPadding[RESAMPLER_MAX] = { const ALsizei ResamplerPadding[RESAMPLER_MAX] = {
0, /* Point */ 0, /* Point */
1, /* Linear */ 1, /* Linear */