aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-22 06:59:32 -0800
committerChris Robinson <[email protected]>2018-11-22 06:59:32 -0800
commitab6db9a589ac5ad8daa498e9fedb4de66cbb1948 (patch)
treefc6e8749da635aa00ed8cbf199239b28ec5fff39
parent9d73e03aaa6d51d6b787b0d576760f782fc3394f (diff)
Clean up some unnecessary specifiers
-rw-r--r--Alc/alc.cpp4
-rw-r--r--Alc/alu.cpp12
-rw-r--r--Alc/hrtf.h12
-rw-r--r--Alc/panning.cpp8
-rw-r--r--OpenAL32/Include/alMain.h6
5 files changed, 19 insertions, 23 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 4c724fd6..10b4c007 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -2418,8 +2418,8 @@ ALCdevice_struct::~ALCdevice_struct()
if(HrtfHandle)
Hrtf_DecRef(HrtfHandle);
HrtfHandle = nullptr;
- al_free(Hrtf);
- Hrtf = nullptr;
+ al_free(mHrtfState);
+ mHrtfState = nullptr;
}
diff --git a/Alc/alu.cpp b/Alc/alu.cpp
index a8f2f402..c67e8705 100644
--- a/Alc/alu.cpp
+++ b/Alc/alu.cpp
@@ -109,22 +109,18 @@ namespace {
void ProcessHrtf(ALCdevice *device, ALsizei SamplesToDo)
{
- DirectHrtfState *state;
- int lidx, ridx;
- ALsizei c;
-
if(device->AmbiUp)
ambiup_process(device->AmbiUp.get(),
device->Dry.Buffer, device->Dry.NumChannels, device->FOAOut.Buffer,
SamplesToDo
);
- lidx = GetChannelIdxByName(&device->RealOut, FrontLeft);
- ridx = GetChannelIdxByName(&device->RealOut, FrontRight);
+ int lidx{GetChannelIdxByName(&device->RealOut, FrontLeft)};
+ int ridx{GetChannelIdxByName(&device->RealOut, FrontRight)};
assert(lidx != -1 && ridx != -1);
- state = device->Hrtf;
- for(c = 0;c < device->Dry.NumChannels;c++)
+ DirectHrtfState *state{device->mHrtfState};
+ for(ALsizei c{0};c < device->Dry.NumChannels;c++)
{
MixDirectHrtf(device->RealOut.Buffer[lidx], device->RealOut.Buffer[ridx],
device->Dry.Buffer[c], state->Offset, state->IrSize,
diff --git a/Alc/hrtf.h b/Alc/hrtf.h
index a74df749..d73faca7 100644
--- a/Alc/hrtf.h
+++ b/Alc/hrtf.h
@@ -36,18 +36,18 @@ struct Hrtf {
};
-typedef struct HrtfState {
+struct HrtfState {
alignas(16) ALfloat History[HRTF_HISTORY_LENGTH];
alignas(16) ALfloat Values[HRIR_LENGTH][2];
-} HrtfState;
+};
-typedef struct HrtfParams {
+struct HrtfParams {
alignas(16) ALfloat Coeffs[HRIR_LENGTH][2];
ALsizei Delay[2];
ALfloat Gain;
-} HrtfParams;
+};
-typedef struct DirectHrtfState {
+struct DirectHrtfState {
/* HRTF filter state for dry buffer content */
ALsizei Offset;
ALsizei IrSize;
@@ -55,7 +55,7 @@ typedef struct DirectHrtfState {
alignas(16) ALfloat Values[HRIR_LENGTH][2];
alignas(16) ALfloat Coeffs[HRIR_LENGTH][2];
} Chan[];
-} DirectHrtfState;
+};
struct AngularPoint {
ALfloat Elev;
diff --git a/Alc/panning.cpp b/Alc/panning.cpp
index 29c708f6..e0677600 100644
--- a/Alc/panning.cpp
+++ b/Alc/panning.cpp
@@ -857,7 +857,7 @@ static void InitHrtfPanning(ALCdevice *device)
count = COUNTOF(IndexMap);
}
- device->Hrtf = reinterpret_cast<DirectHrtfState*>(
+ device->mHrtfState = reinterpret_cast<DirectHrtfState*>(
al_calloc(16, FAM_SIZE(DirectHrtfState, Chan, count)));
for(i = 0;i < count;i++)
@@ -892,7 +892,7 @@ static void InitHrtfPanning(ALCdevice *device)
device->RealOut.NumChannels = ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder);
BuildBFormatHrtf(device->HrtfHandle,
- device->Hrtf, device->Dry.NumChannels, AmbiPoints, AmbiMatrix, COUNTOF(AmbiPoints),
+ device->mHrtfState, device->Dry.NumChannels, AmbiPoints, AmbiMatrix, COUNTOF(AmbiPoints),
AmbiOrderHFGain
);
@@ -930,8 +930,8 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf
int bs2blevel;
size_t i;
- al_free(device->Hrtf);
- device->Hrtf = nullptr;
+ al_free(device->mHrtfState);
+ device->mHrtfState = nullptr;
device->HrtfHandle = nullptr;
device->HrtfName.clear();
device->Render_Mode = NormalRender;
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 3fdd4e02..3a8e28fc 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -666,9 +666,9 @@ struct ALCdevice_struct {
POSTPROCESS PostProcess{};
/* HRTF state and info */
- struct DirectHrtfState *Hrtf{nullptr};
+ DirectHrtfState *mHrtfState{nullptr};
std::string HrtfName;
- struct Hrtf *HrtfHandle{nullptr};
+ Hrtf *HrtfHandle{nullptr};
al::vector<EnumeratedHrtf> HrtfList;
ALCenum HrtfStatus{ALC_FALSE};
@@ -739,7 +739,7 @@ struct ALCdevice_struct {
ATOMIC(ALCcontext*) ContextList{nullptr};
almtx_t BackendLock;
- struct ALCbackend *Backend{nullptr};
+ ALCbackend *Backend{nullptr};
ATOMIC(ALCdevice*) next{nullptr};