diff options
author | Chris Robinson <[email protected]> | 2018-12-24 19:29:01 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-24 19:29:01 -0800 |
commit | fbae41020d8968d0e65af08584df4736b5ed7239 (patch) | |
tree | b2bb3297e5e5b4cf348e4e9379dfa4366dd8aa2d /Alc | |
parent | 194e7ff815d744830c8aaedfb0d32ed3c3d01645 (diff) |
Remove extraneous typedef, struct, and enum keywords
Diffstat (limited to 'Alc')
43 files changed, 115 insertions, 127 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index bde9aa79..b6065e97 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -1148,11 +1148,11 @@ static void alc_initconfig(void) continue; size_t len{next ? (size_t)(next-str) : strlen(str)}; - for(n = 0;n < EFFECTLIST_SIZE;n++) + for(size_t n{0u};n < countof(gEffectList);n++) { - if(len == strlen(EffectList[n].name) && - strncmp(EffectList[n].name, str, len) == 0) - DisabledEffects[EffectList[n].type] = AL_TRUE; + if(len == strlen(gEffectList[n].name) && + strncmp(gEffectList[n].name, str, len) == 0) + DisabledEffects[gEffectList[n].type] = AL_TRUE; } } while(next++); } @@ -1168,7 +1168,7 @@ static void alc_initconfig(void) /************************************************ * Device enumeration ************************************************/ -static void ProbeDevices(std::string *list, BackendInfo *backendinfo, enum DevProbe type) +static void ProbeDevices(std::string *list, BackendInfo *backendinfo, DevProbe type) { DO_INITCONFIG(); @@ -1246,13 +1246,12 @@ ALsizei ChannelsFromDevFmt(DevFmtChannels chans, ALsizei ambiorder) noexcept return 0; } -static ALboolean DecomposeDevFormat(ALenum format, enum DevFmtChannels *chans, - enum DevFmtType *type) +static ALboolean DecomposeDevFormat(ALenum format, DevFmtChannels *chans, DevFmtType *type) { static const struct { ALenum format; - enum DevFmtChannels channels; - enum DevFmtType type; + DevFmtChannels channels; + DevFmtType type; } list[] = { { AL_FORMAT_MONO8, DevFmtMono, DevFmtUByte }, { AL_FORMAT_MONO16, DevFmtMono, DevFmtShort }, @@ -1585,13 +1584,13 @@ static inline void UpdateClockBase(ALCdevice *device) */ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) { - enum HrtfRequestMode hrtf_userreq = Hrtf_Default; - enum HrtfRequestMode hrtf_appreq = Hrtf_Default; + HrtfRequestMode hrtf_userreq = Hrtf_Default; + HrtfRequestMode hrtf_appreq = Hrtf_Default; ALCenum gainLimiter = device->LimiterState; const ALsizei old_sends = device->NumAuxSends; ALsizei new_sends = device->NumAuxSends; - enum DevFmtChannels oldChans; - enum DevFmtType oldType; + DevFmtChannels oldChans; + DevFmtType oldType; ALboolean update_failed; ALCsizei hrtf_id = -1; ALCcontext *context; @@ -1778,8 +1777,8 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) else { device->Frequency = freq; - device->FmtChans = static_cast<enum DevFmtChannels>(schans); - device->FmtType = static_cast<enum DevFmtType>(stype); + device->FmtChans = static_cast<DevFmtChannels>(schans); + device->FmtType = static_cast<DevFmtType>(stype); if(schans == ALC_BFORMAT3D_SOFT) { device->mAmbiOrder = aorder; @@ -3661,7 +3660,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) { static constexpr struct ChannelMap { const char name[16]; - enum DevFmtChannels chans; + DevFmtChannels chans; ALsizei order; } chanlist[] = { { "mono", DevFmtMono, 0 }, @@ -3693,7 +3692,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) { static constexpr struct TypeMap { const char name[16]; - enum DevFmtType type; + DevFmtType type; } typelist[] = { { "int8", DevFmtByte }, { "uint8", DevFmtUByte }, diff --git a/Alc/alu.cpp b/Alc/alu.cpp index b039f5af..01b4f3c3 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -100,7 +100,7 @@ void ClearArray(ALfloat (&f)[MAX_OUTPUT_CHANNELS]) } struct ChanMap { - enum Channel channel; + Channel channel; ALfloat angle; ALfloat elevation; }; @@ -454,7 +454,7 @@ bool CalcEffectSlotParams(ALeffectslot *slot, ALCcontext *context, bool force) } -constexpr struct ChanMap MonoMap[1]{ +constexpr ChanMap MonoMap[1]{ { FrontCenter, 0.0f, 0.0f } }, RearMap[2]{ { BackLeft, Deg2Rad(-150.0f), Deg2Rad(0.0f) }, @@ -509,7 +509,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev ALsizei num_channels{0}; bool isbformat{false}; ALfloat downmix_gain{1.0f}; - switch(Buffer->FmtChannels) + switch(Buffer->mFmtChannels) { case FmtMono: chans = MonoMap; @@ -633,7 +633,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev * responses. */ ALfloat coeffs[MAX_AMBI_COEFFS]; - CalcAngleCoeffs((Device->Render_Mode==StereoPair) ? ScaleAzimuthFront(Azi, 1.5f) : Azi, + CalcAngleCoeffs((Device->mRenderMode==StereoPair) ? ScaleAzimuthFront(Azi, 1.5f) : Azi, Elev, Spread, coeffs); /* NOTE: W needs to be scaled due to FuMa normalization. */ @@ -745,7 +745,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev } } } - else if(Device->Render_Mode == HrtfRender) + else if(Device->mRenderMode == HrtfRender) { /* Full HRTF rendering. Skip the virtual channels and render to the * real outputs. @@ -858,7 +858,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev * input channels. */ ALfloat coeffs[MAX_AMBI_COEFFS]; - CalcAngleCoeffs((Device->Render_Mode==StereoPair) ? ScaleAzimuthFront(Azi, 1.5f) : Azi, + CalcAngleCoeffs((Device->mRenderMode==StereoPair) ? ScaleAzimuthFront(Azi, 1.5f) : Azi, Elev, Spread, coeffs); for(ALsizei c{0};c < num_channels;c++) @@ -927,7 +927,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev ALfloat coeffs[MAX_AMBI_COEFFS]; CalcAngleCoeffs( - (Device->Render_Mode==StereoPair) ? ScaleAzimuthFront(chans[c].angle, 3.0f) + (Device->mRenderMode==StereoPair) ? ScaleAzimuthFront(chans[c].angle, 3.0f) : chans[c].angle, chans[c].elevation, Spread, coeffs ); @@ -1023,11 +1023,11 @@ void CalcNonAttnSourceParams(ALvoice *voice, const ALvoicePropsBase *props, cons voice->Step = MAX_PITCH<<FRACTIONBITS; else voice->Step = maxi(fastf2i(Pitch * FRACTIONONE), 1); - if(props->Resampler == BSinc24Resampler) + if(props->mResampler == BSinc24Resampler) BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc24); - else if(props->Resampler == BSinc12Resampler) + else if(props->mResampler == BSinc12Resampler) BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc12); - voice->Resampler = SelectResampler(props->Resampler); + voice->Resampler = SelectResampler(props->mResampler); /* Calculate gains */ const ALlistener &Listener = ALContext->Listener; @@ -1361,11 +1361,11 @@ void CalcAttnSourceParams(ALvoice *voice, const ALvoicePropsBase *props, const A voice->Step = MAX_PITCH<<FRACTIONBITS; else voice->Step = maxi(fastf2i(Pitch * FRACTIONONE), 1); - if(props->Resampler == BSinc24Resampler) + if(props->mResampler == BSinc24Resampler) BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc24); - else if(props->Resampler == BSinc12Resampler) + else if(props->mResampler == BSinc12Resampler) BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc12); - voice->Resampler = SelectResampler(props->Resampler); + voice->Resampler = SelectResampler(props->mResampler); ALfloat ev{0.0f}, az{0.0f}; if(Distance > 0.0f) @@ -1413,8 +1413,8 @@ void CalcSourceParams(ALvoice *voice, ALCcontext *context, bool force) ); if(LIKELY(buffer != buffers_end)) { - if(voice->Props.SpatializeMode==SpatializeOn || - (voice->Props.SpatializeMode==SpatializeAuto && (*buffer)->FmtChannels==FmtMono)) + if(voice->Props.mSpatializeMode==SpatializeOn || + (voice->Props.mSpatializeMode==SpatializeAuto && (*buffer)->mFmtChannels==FmtMono)) CalcAttnSourceParams(voice, &voice->Props, *buffer, context); else CalcNonAttnSourceParams(voice, &voice->Props, *buffer, context); diff --git a/Alc/backends/alsa.cpp b/Alc/backends/alsa.cpp index 228cafe0..cf3f7fff 100644 --- a/Alc/backends/alsa.cpp +++ b/Alc/backends/alsa.cpp @@ -742,7 +742,7 @@ ALCboolean ALCplaybackAlsa_reset(ALCplaybackAlsa *self) { static const struct { snd_pcm_format_t format; - enum DevFmtType fmttype; + DevFmtType fmttype; } formatlist[] = { { SND_PCM_FORMAT_FLOAT, DevFmtFloat }, { SND_PCM_FORMAT_S32, DevFmtInt }, @@ -767,7 +767,7 @@ ALCboolean ALCplaybackAlsa_reset(ALCplaybackAlsa *self) /* test and set channels (implicitly sets frame bits) */ if(snd_pcm_hw_params_test_channels(self->PcmHandle, hp, device->channelsFromFmt()) < 0) { - static const enum DevFmtChannels channellist[] = { + static const DevFmtChannels channellist[] = { DevFmtStereo, DevFmtQuad, DevFmtX51, @@ -1308,7 +1308,7 @@ void AlsaBackendFactory::deinit() bool AlsaBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || type == ALCbackend_Capture); } -void AlsaBackendFactory::probe(enum DevProbe type, std::string *outnames) +void AlsaBackendFactory::probe(DevProbe type, std::string *outnames) { auto add_device = [outnames](const DevMap &entry) -> void { diff --git a/Alc/backends/alsa.h b/Alc/backends/alsa.h index 3f772115..8ee78f56 100644 --- a/Alc/backends/alsa.h +++ b/Alc/backends/alsa.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/base.h b/Alc/backends/base.h index f4de5176..f7be5cd0 100644 --- a/Alc/backends/base.h +++ b/Alc/backends/base.h @@ -34,7 +34,7 @@ ClockLatency GetClockLatency(ALCdevice *device); struct ALCbackendVtable; struct ALCbackend { - const struct ALCbackendVtable *vtbl; + const ALCbackendVtable *vtbl; ALCdevice *mDevice; @@ -84,7 +84,7 @@ DECLARE_THUNK(T, ALCbackend, void, unlock) \ static void T##_ALCbackend_Delete(void *ptr) \ { T##_Delete(STATIC_UPCAST(T, ALCbackend, (ALCbackend*)ptr)); } \ \ -static const struct ALCbackendVtable T##_ALCbackend_vtable = { \ +static const ALCbackendVtable T##_ALCbackend_vtable = { \ T##_ALCbackend_Destruct, \ \ T##_ALCbackend_open, \ @@ -114,7 +114,7 @@ struct BackendFactory { virtual bool querySupport(ALCbackend_Type type) = 0; - virtual void probe(enum DevProbe type, std::string *outnames) = 0; + virtual void probe(DevProbe type, std::string *outnames) = 0; virtual ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) = 0; }; diff --git a/Alc/backends/coreaudio.cpp b/Alc/backends/coreaudio.cpp index aaaf6221..c73a67f9 100644 --- a/Alc/backends/coreaudio.cpp +++ b/Alc/backends/coreaudio.cpp @@ -754,7 +754,7 @@ bool CoreAudioBackendFactory::init() { return true; } bool CoreAudioBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || ALCbackend_Capture); } -void CoreAudioBackendFactory::probe(enum DevProbe type, std::string *outnames) +void CoreAudioBackendFactory::probe(DevProbe type, std::string *outnames) { switch(type) { diff --git a/Alc/backends/coreaudio.h b/Alc/backends/coreaudio.h index 2926ee12..bc9c492c 100644 --- a/Alc/backends/coreaudio.h +++ b/Alc/backends/coreaudio.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp index 26e561bf..4ada7419 100644 --- a/Alc/backends/dsound.cpp +++ b/Alc/backends/dsound.cpp @@ -45,7 +45,7 @@ #include "compat.h" /* MinGW-w64 needs this for some unknown reason now. */ -typedef const WAVEFORMATEX *LPCWAVEFORMATEX; +using LPCWAVEFORMATEX = const WAVEFORMATEX*; #include <dsound.h> @@ -960,7 +960,7 @@ void DSoundBackendFactory::deinit() bool DSoundBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || type == ALCbackend_Capture); } -void DSoundBackendFactory::probe(enum DevProbe type, std::string *outnames) +void DSoundBackendFactory::probe(DevProbe type, std::string *outnames) { auto add_device = [outnames](const DevMap &entry) -> void { diff --git a/Alc/backends/dsound.h b/Alc/backends/dsound.h index ebaa9c64..3911686e 100644 --- a/Alc/backends/dsound.h +++ b/Alc/backends/dsound.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/jack.cpp b/Alc/backends/jack.cpp index 88f60c93..c768983d 100644 --- a/Alc/backends/jack.cpp +++ b/Alc/backends/jack.cpp @@ -559,7 +559,7 @@ void JackBackendFactory::deinit() bool JackBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback); } -void JackBackendFactory::probe(enum DevProbe type, std::string *outnames) +void JackBackendFactory::probe(DevProbe type, std::string *outnames) { switch(type) { diff --git a/Alc/backends/jack.h b/Alc/backends/jack.h index 8a6e3a22..bdf73701 100644 --- a/Alc/backends/jack.h +++ b/Alc/backends/jack.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/loopback.cpp b/Alc/backends/loopback.cpp index 5a6e14b5..65c87971 100644 --- a/Alc/backends/loopback.cpp +++ b/Alc/backends/loopback.cpp @@ -92,7 +92,7 @@ bool LoopbackBackendFactory::init() bool LoopbackBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Loopback); } -void LoopbackBackendFactory::probe(enum DevProbe, std::string*) +void LoopbackBackendFactory::probe(DevProbe, std::string*) { } ALCbackend *LoopbackBackendFactory::createBackend(ALCdevice *device, ALCbackend_Type type) diff --git a/Alc/backends/loopback.h b/Alc/backends/loopback.h index 68f33a5c..4607d6ed 100644 --- a/Alc/backends/loopback.h +++ b/Alc/backends/loopback.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/null.cpp b/Alc/backends/null.cpp index 969193b8..fb113077 100644 --- a/Alc/backends/null.cpp +++ b/Alc/backends/null.cpp @@ -180,7 +180,7 @@ bool NullBackendFactory::init() bool NullBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback); } -void NullBackendFactory::probe(enum DevProbe type, std::string *outnames) +void NullBackendFactory::probe(DevProbe type, std::string *outnames) { switch(type) { diff --git a/Alc/backends/null.h b/Alc/backends/null.h index e2adfc33..37457d94 100644 --- a/Alc/backends/null.h +++ b/Alc/backends/null.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/opensl.cpp b/Alc/backends/opensl.cpp index ab829e05..9213919b 100644 --- a/Alc/backends/opensl.cpp +++ b/Alc/backends/opensl.cpp @@ -46,7 +46,7 @@ static const ALCchar opensl_device[] = "OpenSL"; -static SLuint32 GetChannelMask(enum DevFmtChannels chans) +static SLuint32 GetChannelMask(DevFmtChannels chans) { switch(chans) { @@ -75,7 +75,7 @@ static SLuint32 GetChannelMask(enum DevFmtChannels chans) } #ifdef SL_DATAFORMAT_PCM_EX -static SLuint32 GetTypeRepresentation(enum DevFmtType type) +static SLuint32 GetTypeRepresentation(DevFmtType type) { switch(type) { @@ -979,7 +979,7 @@ bool OSLBackendFactory::init() { return true; } bool OSLBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || type == ALCbackend_Capture); } -void OSLBackendFactory::probe(enum DevProbe type, std::string *outnames) +void OSLBackendFactory::probe(DevProbe type, std::string *outnames) { switch(type) { diff --git a/Alc/backends/opensl.h b/Alc/backends/opensl.h index 799d568f..31d0caae 100644 --- a/Alc/backends/opensl.h +++ b/Alc/backends/opensl.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/oss.cpp b/Alc/backends/oss.cpp index 4b1d468c..e338c40d 100644 --- a/Alc/backends/oss.cpp +++ b/Alc/backends/oss.cpp @@ -170,7 +170,7 @@ void ALCossListPopulate(al::vector<DevMap> *devlist, int type_flag) goto done; } - struct oss_sysinfo si; + oss_sysinfo si; if(ioctl(fd, SNDCTL_SYSINFO, &si) == -1) { TRACE("SNDCTL_SYSINFO failed: %s\n", strerror(errno)); @@ -179,7 +179,7 @@ void ALCossListPopulate(al::vector<DevMap> *devlist, int type_flag) for(int i{0};i < si.numaudios;i++) { - struct oss_audioinfo ai; + oss_audioinfo ai; ai.dev = i; if(ioctl(fd, SNDCTL_AUDIOINFO, &ai) == -1) { @@ -759,7 +759,7 @@ void OSSBackendFactory::deinit() bool OSSBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || type == ALCbackend_Capture); } -void OSSBackendFactory::probe(enum DevProbe type, std::string *outnames) +void OSSBackendFactory::probe(DevProbe type, std::string *outnames) { auto add_device = [outnames](const DevMap &entry) -> void { diff --git a/Alc/backends/oss.h b/Alc/backends/oss.h index c3865d84..4652a779 100644 --- a/Alc/backends/oss.h +++ b/Alc/backends/oss.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/portaudio.cpp b/Alc/backends/portaudio.cpp index a89959b6..59b357b5 100644 --- a/Alc/backends/portaudio.cpp +++ b/Alc/backends/portaudio.cpp @@ -488,7 +488,7 @@ void PortBackendFactory::deinit() bool PortBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || type == ALCbackend_Capture); } -void PortBackendFactory::probe(enum DevProbe type, std::string *outnames) +void PortBackendFactory::probe(DevProbe type, std::string *outnames) { switch(type) { diff --git a/Alc/backends/portaudio.h b/Alc/backends/portaudio.h index 598cd13d..581d4901 100644 --- a/Alc/backends/portaudio.h +++ b/Alc/backends/portaudio.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/pulseaudio.cpp b/Alc/backends/pulseaudio.cpp index cbf2992d..8428b9d8 100644 --- a/Alc/backends/pulseaudio.cpp +++ b/Alc/backends/pulseaudio.cpp @@ -1791,7 +1791,7 @@ bool PulseBackendFactory::querySupport(ALCbackend_Type type) return false; } -void PulseBackendFactory::probe(enum DevProbe type, std::string *outnames) +void PulseBackendFactory::probe(DevProbe type, std::string *outnames) { auto add_device = [outnames](const DevMap &entry) -> void { diff --git a/Alc/backends/pulseaudio.h b/Alc/backends/pulseaudio.h index 63b5bbbb..eb7045dc 100644 --- a/Alc/backends/pulseaudio.h +++ b/Alc/backends/pulseaudio.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/qsa.cpp b/Alc/backends/qsa.cpp index f0d1876e..f14718c0 100644 --- a/Alc/backends/qsa.cpp +++ b/Alc/backends/qsa.cpp @@ -119,7 +119,7 @@ void deviceList(int type, al::vector<DevMap> *devmap) int max_cards, card, err, dev; DevMap entry; char name[1024]; - struct snd_ctl_hw_info info; + snd_ctl_hw_info info; max_cards = snd_cards(); if(max_cards < 0) @@ -195,7 +195,7 @@ FORCE_ALIGN static int qsa_proc_playback(void *ptr) ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice; qsa_data *data = self->ExtraData; snd_pcm_channel_status_t status; - struct sched_param param; + sched_param param; char* write_ptr; ALint len; int sret; @@ -978,7 +978,7 @@ void QSABackendFactory::deinit() bool QSABackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || type == ALCbackend_Capture); } -void QSABackendFactory::probe(enum DevProbe type, std::string *outnames) +void QSABackendFactory::probe(DevProbe type, std::string *outnames) { auto add_device = [outnames](const DevMap &entry) -> void { diff --git a/Alc/backends/qsa.h b/Alc/backends/qsa.h index c4941392..99d80106 100644 --- a/Alc/backends/qsa.h +++ b/Alc/backends/qsa.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/sdl2.cpp b/Alc/backends/sdl2.cpp index f0c98fab..d61e0a1b 100644 --- a/Alc/backends/sdl2.cpp +++ b/Alc/backends/sdl2.cpp @@ -44,8 +44,8 @@ struct ALCsdl2Backend final : public ALCbackend { ALsizei frameSize; ALuint Frequency; - enum DevFmtChannels FmtChans; - enum DevFmtType FmtType; + DevFmtChannels FmtChans; + DevFmtType FmtType; ALuint UpdateSize; }; @@ -233,7 +233,7 @@ bool SDL2BackendFactory::querySupport(ALCbackend_Type type) return (type == ALCbackend_Playback); } -void SDL2BackendFactory::probe(enum DevProbe type, std::string *outnames) +void SDL2BackendFactory::probe(DevProbe type, std::string *outnames) { if(type != ALL_DEVICE_PROBE) return; diff --git a/Alc/backends/sdl2.h b/Alc/backends/sdl2.h index 7f383447..7bf4d0e4 100644 --- a/Alc/backends/sdl2.h +++ b/Alc/backends/sdl2.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/sndio.cpp b/Alc/backends/sndio.cpp index 25566490..2be1d26c 100644 --- a/Alc/backends/sndio.cpp +++ b/Alc/backends/sndio.cpp @@ -40,7 +40,7 @@ static const ALCchar sndio_device[] = "SndIO Default"; struct SndioPlayback final : public ALCbackend { - struct sio_hdl *sndHandle{nullptr}; + sio_hdl *sndHandle{nullptr}; ALvoid *mix_data{nullptr}; ALsizei data_size{0}; @@ -152,7 +152,7 @@ static ALCenum SndioPlayback_open(SndioPlayback *self, const ALCchar *name) static ALCboolean SndioPlayback_reset(SndioPlayback *self) { ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice; - struct sio_par par; + sio_par par; sio_initpar(&par); @@ -277,7 +277,7 @@ static void SndioPlayback_stop(SndioPlayback *self) struct SndioCapture final : public ALCbackend { - struct sio_hdl *sndHandle{nullptr}; + sio_hdl *sndHandle{nullptr}; RingBufferPtr ring{nullptr}; @@ -379,7 +379,7 @@ static int SndioCapture_recordProc(SndioCapture *self) static ALCenum SndioCapture_open(SndioCapture *self, const ALCchar *name) { ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice; - struct sio_par par; + sio_par par; if(!name) name = sndio_device; @@ -536,7 +536,7 @@ bool SndIOBackendFactory::init() bool SndIOBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || type == ALCbackend_Capture); } -void SndIOBackendFactory::probe(enum DevProbe type, std::string *outnames) +void SndIOBackendFactory::probe(DevProbe type, std::string *outnames) { switch(type) { diff --git a/Alc/backends/sndio.h b/Alc/backends/sndio.h index 38cd2767..20e99afb 100644 --- a/Alc/backends/sndio.h +++ b/Alc/backends/sndio.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/solaris.cpp b/Alc/backends/solaris.cpp index 79341ad1..41026de8 100644 --- a/Alc/backends/solaris.cpp +++ b/Alc/backends/solaris.cpp @@ -301,7 +301,7 @@ bool SolarisBackendFactory::init() bool SolarisBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback); } -void SolarisBackendFactory::probe(enum DevProbe type, std::string *outnames) +void SolarisBackendFactory::probe(DevProbe type, std::string *outnames) { switch(type) { diff --git a/Alc/backends/solaris.h b/Alc/backends/solaris.h index dcb34570..73f4a467 100644 --- a/Alc/backends/solaris.h +++ b/Alc/backends/solaris.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp index 3f8cad23..c1b4bddb 100644 --- a/Alc/backends/wasapi.cpp +++ b/Alc/backends/wasapi.cpp @@ -1601,7 +1601,7 @@ HRESULT ALCwasapiCapture::resetProxy() wfx = nullptr; } - enum DevFmtType srcType; + DevFmtType srcType; if(IsEqualGUID(OutputType.SubFormat, KSDATAFORMAT_SUBTYPE_PCM)) { if(OutputType.Format.wBitsPerSample == 8) @@ -1839,7 +1839,7 @@ void WasapiBackendFactory::deinit() bool WasapiBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || type == ALCbackend_Capture); } -void WasapiBackendFactory::probe(enum DevProbe type, std::string *outnames) +void WasapiBackendFactory::probe(DevProbe type, std::string *outnames) { ThreadRequest req{ nullptr, 0 }; diff --git a/Alc/backends/wasapi.h b/Alc/backends/wasapi.h index 2ee10ac8..a94f85df 100644 --- a/Alc/backends/wasapi.h +++ b/Alc/backends/wasapi.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp index 463e6bd7..d40e93f0 100644 --- a/Alc/backends/wave.cpp +++ b/Alc/backends/wave.cpp @@ -385,7 +385,7 @@ bool WaveBackendFactory::init() bool WaveBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback); } -void WaveBackendFactory::probe(enum DevProbe type, std::string *outnames) +void WaveBackendFactory::probe(DevProbe type, std::string *outnames) { switch(type) { diff --git a/Alc/backends/wave.h b/Alc/backends/wave.h index 65bb5ecf..bb51cc71 100644 --- a/Alc/backends/wave.h +++ b/Alc/backends/wave.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp index 38766869..0ebba81c 100644 --- a/Alc/backends/winmm.cpp +++ b/Alc/backends/winmm.cpp @@ -669,7 +669,7 @@ void WinMMBackendFactory::deinit() bool WinMMBackendFactory::querySupport(ALCbackend_Type type) { return (type == ALCbackend_Playback || type == ALCbackend_Capture); } -void WinMMBackendFactory::probe(enum DevProbe type, std::string *outnames) +void WinMMBackendFactory::probe(DevProbe type, std::string *outnames) { auto add_device = [outnames](const std::string &dname) -> void { diff --git a/Alc/backends/winmm.h b/Alc/backends/winmm.h index b60dbc10..e5801c01 100644 --- a/Alc/backends/winmm.h +++ b/Alc/backends/winmm.h @@ -10,7 +10,7 @@ public: bool querySupport(ALCbackend_Type type) override; - void probe(enum DevProbe type, std::string *outnames) override; + void probe(DevProbe type, std::string *outnames) override; ALCbackend *createBackend(ALCdevice *device, ALCbackend_Type type) override; diff --git a/Alc/converter.cpp b/Alc/converter.cpp index 3effddd8..66627879 100644 --- a/Alc/converter.cpp +++ b/Alc/converter.cpp @@ -44,8 +44,7 @@ inline void LoadSampleArray(ALfloat *RESTRICT dst, const void *src, ALint srcste dst[i] = LoadSample<T>(ssrc[i*srcstep]); } -void LoadSamples(ALfloat *dst, const ALvoid *src, ALint srcstep, enum DevFmtType srctype, - ALsizei samples) +void LoadSamples(ALfloat *dst, const ALvoid *src, ALint srcstep, DevFmtType srctype, ALsizei samples) { #define HANDLE_FMT(T) \ case T: LoadSampleArray<T>(dst, src, srcstep, samples); break @@ -95,7 +94,7 @@ inline void StoreSampleArray(void *dst, const ALfloat *RESTRICT src, ALint dstst } -void StoreSamples(ALvoid *dst, const ALfloat *src, ALint dststep, enum DevFmtType dsttype, ALsizei samples) +void StoreSamples(ALvoid *dst, const ALfloat *src, ALint dststep, DevFmtType dsttype, ALsizei samples) { #define HANDLE_FMT(T) \ case T: StoreSampleArray<T>(dst, src, dststep, samples); break @@ -136,9 +135,8 @@ void Stereo2Mono(ALfloat *RESTRICT dst, const void *src, ALsizei frames) } // namespace -SampleConverter *CreateSampleConverter(enum DevFmtType srcType, enum DevFmtType dstType, - ALsizei numchans, ALsizei srcRate, ALsizei dstRate, - Resampler resampler) +SampleConverter *CreateSampleConverter(DevFmtType srcType, DevFmtType dstType, ALsizei numchans, + ALsizei srcRate, ALsizei dstRate, Resampler resampler) { if(numchans <= 0 || srcRate <= 0 || dstRate <= 0) return nullptr; diff --git a/Alc/converter.h b/Alc/converter.h index 7444d4fa..1c473f49 100644 --- a/Alc/converter.h +++ b/Alc/converter.h @@ -29,9 +29,8 @@ struct SampleConverter { DEF_PLACE_NEWDEL() }; -SampleConverter *CreateSampleConverter(enum DevFmtType srcType, enum DevFmtType dstType, - ALsizei numchans, ALsizei srcRate, ALsizei dstRate, - Resampler resampler); +SampleConverter *CreateSampleConverter(DevFmtType srcType, DevFmtType dstType, ALsizei numchans, + ALsizei srcRate, ALsizei dstRate, Resampler resampler); void DestroySampleConverter(SampleConverter **converter); ALsizei SampleConverterInput(SampleConverter *converter, const ALvoid **src, ALsizei *srcframes, ALvoid *dst, ALsizei dstframes); @@ -49,7 +48,7 @@ struct ChannelConverter { DEF_NEWDEL(ChannelConverter) }; -ChannelConverter *CreateChannelConverter(enum DevFmtType srcType, enum DevFmtChannels srcChans, enum DevFmtChannels dstChans); +ChannelConverter *CreateChannelConverter(DevFmtType srcType, DevFmtChannels srcChans, DevFmtChannels dstChans); void DestroyChannelConverter(ChannelConverter **converter); void ChannelConverterInput(ChannelConverter *converter, const ALvoid *src, ALfloat *dst, ALsizei frames); diff --git a/Alc/helpers.cpp b/Alc/helpers.cpp index 17942855..beee4bff 100644 --- a/Alc/helpers.cpp +++ b/Alc/helpers.cpp @@ -125,13 +125,13 @@ DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x #if defined(HAVE_GCC_GET_CPUID) && (defined(__i386__) || defined(__x86_64__) || \ defined(_M_IX86) || defined(_M_X64)) -typedef unsigned int reg_type; +using reg_type = unsigned int; static inline void get_cpuid(int f, reg_type *regs) { __get_cpuid(f, ®s[0], ®s[1], ®s[2], ®s[3]); } #define CAN_GET_CPUID #elif defined(HAVE_CPUID_INTRINSIC) && (defined(__i386__) || defined(__x86_64__) || \ defined(_M_IX86) || defined(_M_X64)) -typedef int reg_type; +using reg_type = int; static inline void get_cpuid(int f, reg_type *regs) { (__cpuid)(regs, f); } #define CAN_GET_CPUID diff --git a/Alc/mixer/defs.h b/Alc/mixer/defs.h index 46f70982..5fa88773 100644 --- a/Alc/mixer/defs.h +++ b/Alc/mixer/defs.h @@ -6,12 +6,8 @@ #include "alMain.h" #include "alu.h" -#ifdef __cplusplus -extern "C" { -#endif struct MixGains; - struct MixHrtfParams; struct HrtfState; @@ -26,8 +22,8 @@ const ALfloat *Resample_bsinc_C(const InterpState *state, const ALfloat *RESTRIC /* C mixers */ void MixHrtf_C(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, const ALfloat *data, ALsizei Offset, ALsizei OutPos, - const ALsizei IrSize, struct MixHrtfParams *hrtfparams, - struct HrtfState *hrtfstate, ALsizei BufferSize); + const ALsizei IrSize, MixHrtfParams *hrtfparams, + HrtfState *hrtfstate, ALsizei BufferSize); void MixHrtfBlend_C(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, const ALfloat *data, ALsizei Offset, ALsizei OutPos, const ALsizei IrSize, const HrtfParams *oldparams, @@ -47,8 +43,8 @@ void MixRow_C(ALfloat *OutBuffer, const ALfloat *Gains, /* SSE mixers */ void MixHrtf_SSE(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, const ALfloat *data, ALsizei Offset, ALsizei OutPos, - const ALsizei IrSize, struct MixHrtfParams *hrtfparams, - struct HrtfState *hrtfstate, ALsizei BufferSize); + const ALsizei IrSize, MixHrtfParams *hrtfparams, + HrtfState *hrtfstate, ALsizei BufferSize); void MixHrtfBlend_SSE(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, const ALfloat *data, ALsizei Offset, ALsizei OutPos, const ALsizei IrSize, const HrtfParams *oldparams, @@ -94,8 +90,8 @@ const ALfloat *Resample_bsinc_SSE(const InterpState *state, const ALfloat *RESTR /* Neon mixers */ void MixHrtf_Neon(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, const ALfloat *data, ALsizei Offset, ALsizei OutPos, - const ALsizei IrSize, struct MixHrtfParams *hrtfparams, - struct HrtfState *hrtfstate, ALsizei BufferSize); + const ALsizei IrSize, MixHrtfParams *hrtfparams, + HrtfState *hrtfstate, ALsizei BufferSize); void MixHrtfBlend_Neon(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, const ALfloat *data, ALsizei Offset, ALsizei OutPos, const ALsizei IrSize, const HrtfParams *oldparams, @@ -120,8 +116,4 @@ const ALfloat *Resample_bsinc_Neon(const InterpState *state, const ALfloat *REST ALsizei frac, ALint increment, ALfloat *RESTRICT dst, ALsizei dstlen); -#ifdef __cplusplus -} // extern "C" -#endif - #endif /* MIXER_DEFS_H */ diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp index db2609f5..680f4a31 100644 --- a/Alc/mixvoice.cpp +++ b/Alc/mixvoice.cpp @@ -54,7 +54,7 @@ static_assert((INT_MAX>>FRACTIONBITS)/MAX_PITCH > BUFFERSIZE, static_assert(MAX_RESAMPLE_PADDING >= 24, "MAX_RESAMPLE_PADDING must be at least 24!"); -enum Resampler ResamplerDefault = LinearResampler; +Resampler ResamplerDefault = LinearResampler; MixerFunc MixSamples = Mix_C; RowMixerFunc MixRowSamples = MixRow_C; @@ -113,7 +113,7 @@ static inline HrtfMixerBlendFunc SelectHrtfBlendMixer(void) return MixHrtfBlend_C; } -ResamplerFunc SelectResampler(enum Resampler resampler) +ResamplerFunc SelectResampler(Resampler resampler) { switch(resampler) { @@ -183,7 +183,7 @@ void aluInitMixer(void) char *end; long n = strtol(str, &end, 0); if(*end == '\0' && (n == PointResampler || n == LinearResampler || n == FIR4Resampler)) - ResamplerDefault = static_cast<enum Resampler>(n); + ResamplerDefault = static_cast<Resampler>(n); else WARN("Invalid resampler: %s\n", str); } @@ -393,7 +393,7 @@ ALboolean MixSource(ALvoice *voice, ALuint SourceID, ALCcontext *Context, ALsize const ALbyte *Data{buffer->mData.data()}; LoadSamples(&SrcData[FilledAmt], &Data[(DataPosInt*NumChannels + chan)*SampleSize], - NumChannels, buffer->FmtType, DataSize + NumChannels, buffer->mFmtType, DataSize ); return CompLen; }; @@ -417,7 +417,7 @@ ALboolean MixSource(ALvoice *voice, ALuint SourceID, ALCcontext *Context, ALsize const ALbyte *Data{buffer->mData.data()}; LoadSamples(&SrcData[FilledAmt], &Data[(DataPosInt*NumChannels + chan)*SampleSize], - NumChannels, buffer->FmtType, DataSize + NumChannels, buffer->mFmtType, DataSize ); return CompLen; }; @@ -440,7 +440,7 @@ ALboolean MixSource(ALvoice *voice, ALuint SourceID, ALCcontext *Context, ALsize const ALbyte *Data{buffer->mData.data()}; LoadSamples(&SrcData[FilledAmt], &Data[(LoopStart*NumChannels + chan)*SampleSize], - NumChannels, buffer->FmtType, DataSize + NumChannels, buffer->mFmtType, DataSize ); return CompLen; }; @@ -479,7 +479,7 @@ ALboolean MixSource(ALvoice *voice, ALuint SourceID, ALCcontext *Context, ALsize Data += (pos*NumChannels + chan)*SampleSize; LoadSamples(&SrcData[FilledAmt], Data, NumChannels, - buffer->FmtType, DataSize); + buffer->mFmtType, DataSize); return CompLen; }; auto buffers_end = tmpiter->buffers + tmpiter->num_buffers; diff --git a/Alc/panning.cpp b/Alc/panning.cpp index cec6eaf7..5e7806ec 100644 --- a/Alc/panning.cpp +++ b/Alc/panning.cpp @@ -678,7 +678,7 @@ void InitHrtfPanning(ALCdevice *device) /* Don't bother with HOA when using full HRTF rendering. Nothing needs it, * and it eases the CPU/memory load. */ - if(device->Render_Mode != HrtfRender) + if(device->mRenderMode != HrtfRender) { device->AmbiUp.reset(new AmbiUpsampler{}); @@ -879,7 +879,7 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, HrtfRequestMode hrtf_appr device->mHrtfState = nullptr; device->mHrtf = nullptr; device->HrtfName.clear(); - device->Render_Mode = NormalRender; + device->mRenderMode = NormalRender; device->Dry.Ambi = AmbiConfig{}; device->Dry.CoeffCount = 0; @@ -1063,20 +1063,20 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, HrtfRequestMode hrtf_appr Hrtf_DecRef(old_hrtf); old_hrtf = nullptr; - device->Render_Mode = HrtfRender; + device->mRenderMode = HrtfRender; const char *mode; if(ConfigValueStr(device->DeviceName.c_str(), nullptr, "hrtf-mode", &mode)) { if(strcasecmp(mode, "full") == 0) - device->Render_Mode = HrtfRender; + device->mRenderMode = HrtfRender; else if(strcasecmp(mode, "basic") == 0) - device->Render_Mode = NormalRender; + device->mRenderMode = NormalRender; else ERR("Unexpected hrtf-mode: %s\n", mode); } TRACE("%s HRTF rendering enabled, using \"%s\"\n", - ((device->Render_Mode == HrtfRender) ? "Full" : "Basic"), device->HrtfName.c_str() + ((device->mRenderMode == HrtfRender) ? "Full" : "Basic"), device->HrtfName.c_str() ); InitHrtfPanning(device); return; @@ -1089,7 +1089,7 @@ no_hrtf: old_hrtf = nullptr; TRACE("HRTF disabled\n"); - device->Render_Mode = StereoPair; + device->mRenderMode = StereoPair; int bs2blevel{((headphones && hrtf_appreq != Hrtf_Disable) || (hrtf_appreq == Hrtf_Enable)) ? 5 : 0}; @@ -1110,11 +1110,11 @@ no_hrtf: if(ConfigValueStr(device->DeviceName.c_str(), nullptr, "stereo-encoding", &mode)) { if(strcasecmp(mode, "uhj") == 0) - device->Render_Mode = NormalRender; + device->mRenderMode = NormalRender; else if(strcasecmp(mode, "panpot") != 0) ERR("Unexpected stereo-encoding: %s\n", mode); } - if(device->Render_Mode == NormalRender) + if(device->mRenderMode == NormalRender) { device->Uhj_Encoder.reset(new Uhj2Encoder{}); TRACE("UHJ enabled\n"); |