aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-07-28 11:28:36 -0700
committerChris Robinson <[email protected]>2019-07-28 11:28:36 -0700
commit5428d6acc37e33802b0b66b2f9cdc0a37dd36429 (patch)
treee8e159f6b612e246a97e23d14f47a25f1996b35d
parent659b6d4245b92a7dba3a1b1693db6de8ddf999eb (diff)
Clean up includes a bit
Trying out the IWYU tool to only include what's necessary in a given file. Seems to work decently (it'll miss some headers, suggest unnecessary ones, and make nonsense suggestions for some things, but overall gives a good starting point), and helps clean out some headers.
-rw-r--r--Alc/alc.cpp86
-rw-r--r--Alc/alu.cpp62
-rw-r--r--Alc/backends/alsa.cpp31
-rw-r--r--Alc/backends/dsound.cpp5
-rw-r--r--Alc/backends/null.cpp15
-rw-r--r--Alc/backends/oss.cpp37
-rw-r--r--Alc/backends/wasapi.cpp4
-rw-r--r--Alc/backends/wave.cpp22
-rw-r--r--Alc/bformatdec.cpp21
-rw-r--r--Alc/bformatdec.h18
-rw-r--r--Alc/effects/chorus.cpp21
-rw-r--r--Alc/filters/biquad.cpp10
-rw-r--r--Alc/filters/biquad.h1
-rw-r--r--Alc/helpers.cpp35
-rw-r--r--Alc/hrtf.cpp35
-rw-r--r--Alc/hrtf.h10
-rw-r--r--Alc/mixvoice.cpp43
-rw-r--r--OpenAL32/Include/alMain.h58
-rw-r--r--OpenAL32/Include/alu.h43
-rw-r--r--OpenAL32/alBuffer.cpp38
-rw-r--r--OpenAL32/alEffect.cpp25
-rw-r--r--OpenAL32/alError.cpp15
-rw-r--r--OpenAL32/alSource.cpp55
-rw-r--r--OpenAL32/alState.cpp19
-rw-r--r--OpenAL32/event.cpp22
-rw-r--r--include/AL/efx.h1
26 files changed, 446 insertions, 286 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index a7b53c6b..0bc099b4 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -22,47 +22,71 @@
#include "version.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <memory.h>
-#include <ctype.h>
-#include <signal.h>
-
-#include <cmath>
+#include <exception>
+#include <algorithm>
+#include <array>
#include <atomic>
+#include <cctype>
+#include <chrono>
+#include <climits>
+#include <cmath>
+#include <csignal>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <functional>
+#include <iterator>
+#include <limits>
+#include <memory>
#include <mutex>
-#include <thread>
-#include <vector>
-#include <string>
+#include <new>
#include <numeric>
-#include <algorithm>
-#include <functional>
+#include <string>
+#include <thread>
+#include <utility>
+
+#include "AL/al.h"
+#include "AL/alc.h"
+#include "AL/alext.h"
+#include "AL/efx.h"
-#include "alMain.h"
-#include "alcontext.h"
-#include "alSource.h"
-#include "alListener.h"
-#include "alSource.h"
-#include "alBuffer.h"
-#include "alFilter.h"
-#include "alEffect.h"
#include "alAuxEffectSlot.h"
+#include "alEffect.h"
#include "alError.h"
-#include "mastering.h"
-#include "bformatdec.h"
-#include "uhjfilter.h"
-#include "alu.h"
+#include "alFilter.h"
+#include "alListener.h"
+#include "alMain.h"
+#include "alSource.h"
+#include "albyte.h"
#include "alconfig.h"
-#include "ringbuffer.h"
-#include "filters/splitter.h"
+#include "alcontext.h"
+#include "alexcpt.h"
+#include "almalloc.h"
+#include "alnumeric.h"
+#include "aloptional.h"
+#include "alspan.h"
+#include "alu.h"
+#include "ambidefs.h"
+#include "atomic.h"
+#include "bformatdec.h"
#include "bs2b.h"
-
-#include "fpu_modes.h"
-#include "cpu_caps.h"
#include "compat.h"
+#include "cpu_caps.h"
+#include "effects/base.h"
+#include "filters/nfc.h"
+#include "filters/splitter.h"
+#include "fpu_modes.h"
+#include "hrtf.h"
+#include "inprogext.h"
+#include "logging.h"
+#include "mastering.h"
+#include "opthelpers.h"
+#include "ringbuffer.h"
#include "threads.h"
-#include "alexcpt.h"
-#include "almalloc.h"
+#include "uhjfilter.h"
+#include "vecmat.h"
+#include "vector.h"
#include "backends/base.h"
#include "backends/null.h"
diff --git a/Alc/alu.cpp b/Alc/alu.cpp
index f5c3b842..666cbb27 100644
--- a/Alc/alu.cpp
+++ b/Alc/alu.cpp
@@ -20,36 +20,62 @@
#include "config.h"
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
+#include "alu.h"
+#include <algorithm>
+#include <array>
+#include <atomic>
+#include <cassert>
+#include <chrono>
+#include <climits>
#include <cmath>
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <functional>
+#include <iterator>
#include <limits>
+#include <memory>
+#include <new>
#include <numeric>
-#include <algorithm>
-#include <functional>
+#include <utility>
-#include "alMain.h"
-#include "alcontext.h"
-#include "alSource.h"
+#include "AL/al.h"
+#include "AL/alc.h"
+#include "AL/efx.h"
+
+#include "alAuxEffectSlot.h"
#include "alBuffer.h"
+#include "alEffect.h"
#include "alListener.h"
-#include "alAuxEffectSlot.h"
-#include "alu.h"
+#include "alMain.h"
+#include "alcontext.h"
+#include "almalloc.h"
+#include "alnumeric.h"
+#include "alspan.h"
+#include "ambidefs.h"
+#include "atomic.h"
+#include "bformatdec.h"
#include "bs2b.h"
+#include "cpu_caps.h"
+#include "effects/base.h"
+#include "filters/biquad.h"
+#include "filters/nfc.h"
+#include "filters/splitter.h"
+#include "fpu_modes.h"
#include "hrtf.h"
+#include "inprogext.h"
#include "mastering.h"
-#include "uhjfilter.h"
-#include "bformatdec.h"
+#include "math_defs.h"
+#include "mixer/defs.h"
+#include "opthelpers.h"
#include "ringbuffer.h"
-#include "filters/splitter.h"
+#include "threads.h"
+#include "uhjfilter.h"
+#include "vecmat.h"
+#include "vector.h"
-#include "mixer/defs.h"
-#include "fpu_modes.h"
-#include "cpu_caps.h"
#include "bsinc_inc.h"
diff --git a/Alc/backends/alsa.cpp b/Alc/backends/alsa.cpp
index aeb38585..698a4088 100644
--- a/Alc/backends/alsa.cpp
+++ b/Alc/backends/alsa.cpp
@@ -22,22 +22,33 @@
#include "backends/alsa.h"
-#include <cstdlib>
-#include <cstdio>
-#include <memory.h>
-
-#include <atomic>
-#include <thread>
-#include <vector>
-#include <string>
#include <algorithm>
+#include <atomic>
+#include <cassert>
+#include <cerrno>
+#include <chrono>
+#include <cstring>
+#include <exception>
#include <functional>
+#include <memory>
+#include <string>
+#include <thread>
+#include <utility>
+
+#include "AL/al.h"
#include "alMain.h"
-#include "alu.h"
+#include "albyte.h"
#include "alconfig.h"
-#include "ringbuffer.h"
+#include "almalloc.h"
+#include "alnumeric.h"
+#include "aloptional.h"
+#include "alu.h"
#include "compat.h"
+#include "logging.h"
+#include "ringbuffer.h"
+#include "threads.h"
+#include "vector.h"
#include <alsa/asoundlib.h>
diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp
index 93de3135..5c77df60 100644
--- a/Alc/backends/dsound.cpp
+++ b/Alc/backends/dsound.cpp
@@ -22,6 +22,9 @@
#include "backends/dsound.h"
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
@@ -34,6 +37,7 @@
#endif
#include <atomic>
+#include <cassert>
#include <thread>
#include <string>
#include <vector>
@@ -44,6 +48,7 @@
#include "alu.h"
#include "ringbuffer.h"
#include "compat.h"
+#include "threads.h"
/* MinGW-w64 needs this for some unknown reason now. */
using LPCWAVEFORMATEX = const WAVEFORMATEX*;
diff --git a/Alc/backends/null.cpp b/Alc/backends/null.cpp
index 121d7700..00a37fda 100644
--- a/Alc/backends/null.cpp
+++ b/Alc/backends/null.cpp
@@ -22,18 +22,19 @@
#include "backends/null.h"
-#include <cstdlib>
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
+#include <exception>
+#include <atomic>
#include <chrono>
-#include <thread>
+#include <cstdint>
+#include <cstring>
#include <functional>
+#include <thread>
#include "alMain.h"
+#include "almalloc.h"
#include "alu.h"
-#include "compat.h"
+#include "logging.h"
+#include "threads.h"
namespace {
diff --git a/Alc/backends/oss.cpp b/Alc/backends/oss.cpp
index e5b74334..33075890 100644
--- a/Alc/backends/oss.cpp
+++ b/Alc/backends/oss.cpp
@@ -22,32 +22,37 @@
#include "backends/oss.h"
+#include <fcntl.h>
+#include <poll.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/time.h>
#include <sys/stat.h>
-#include <fcntl.h>
-#include <cstdlib>
-#include <cstdio>
-#include <cstring>
-#include <memory.h>
#include <unistd.h>
-#include <cerrno>
-#include <poll.h>
-#include <cmath>
-#include <atomic>
-#include <thread>
-#include <vector>
-#include <string>
#include <algorithm>
+#include <atomic>
+#include <cerrno>
+#include <cstdio>
+#include <cstring>
+#include <exception>
#include <functional>
+#include <memory>
+#include <new>
+#include <string>
+#include <thread>
+#include <utility>
+
+#include "AL/al.h"
#include "alMain.h"
-#include "alu.h"
#include "alconfig.h"
+#include "almalloc.h"
+#include "alnumeric.h"
+#include "aloptional.h"
+#include "alu.h"
+#include "logging.h"
#include "ringbuffer.h"
-#include "compat.h"
+#include "threads.h"
+#include "vector.h"
#include <sys/soundcard.h>
diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp
index db4b5e4e..384aaba8 100644
--- a/Alc/backends/wasapi.cpp
+++ b/Alc/backends/wasapi.cpp
@@ -22,6 +22,9 @@
#include "backends/wasapi.h"
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
@@ -56,6 +59,7 @@
#include "ringbuffer.h"
#include "compat.h"
#include "converter.h"
+#include "threads.h"
/* Some headers seem to define these as macros for __uuidof, which is annoying
diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp
index d06f36d7..77692686 100644
--- a/Alc/backends/wave.cpp
+++ b/Alc/backends/wave.cpp
@@ -22,20 +22,28 @@
#include "backends/wave.h"
-#include <cstdlib>
-#include <cstdio>
-#include <memory.h>
+#include <algorithm>
+#include <atomic>
#include <cerrno>
-
#include <chrono>
-#include <thread>
-#include <vector>
+#include <cstdint>
+#include <cstdio>
+#include <cstring>
+#include <exception>
#include <functional>
+#include <thread>
+
+#include "AL/al.h"
#include "alMain.h"
-#include "alu.h"
#include "alconfig.h"
+#include "almalloc.h"
+#include "alnumeric.h"
+#include "alu.h"
#include "compat.h"
+#include "logging.h"
+#include "threads.h"
+#include "vector.h"
namespace {
diff --git a/Alc/bformatdec.cpp b/Alc/bformatdec.cpp
index 6ef398ec..889bbf3a 100644
--- a/Alc/bformatdec.cpp
+++ b/Alc/bformatdec.cpp
@@ -1,27 +1,24 @@
#include "config.h"
-#include <cmath>
+#include "bformatdec.h"
+
+#include <algorithm>
#include <array>
-#include <vector>
+#include <cassert>
+#include <cmath>
+#include <iterator>
#include <numeric>
-#include <algorithm>
-#include <functional>
-#include "bformatdec.h"
+#include "almalloc.h"
+#include "alu.h"
#include "ambdec.h"
#include "filters/splitter.h"
-#include "alu.h"
-
-#include "threads.h"
-#include "almalloc.h"
+#include "opthelpers.h"
namespace {
-using namespace std::placeholders;
-
-
constexpr ALfloat Ambi3DDecoderHFScale[MAX_AMBI_ORDER+1] = {
1.00000000e+00f, 1.00000000e+00f
};
diff --git a/Alc/bformatdec.h b/Alc/bformatdec.h
index 1ec4a1bb..31abc4fe 100644
--- a/Alc/bformatdec.h
+++ b/Alc/bformatdec.h
@@ -1,11 +1,17 @@
#ifndef BFORMATDEC_H
#define BFORMATDEC_H
+#include <array>
+#include <cstddef>
+
+#include "AL/al.h"
+
#include "alMain.h"
-#include "filters/splitter.h"
-#include "ambidefs.h"
#include "almalloc.h"
-
+#include "alspan.h"
+#include "ambidefs.h"
+#include "filters/splitter.h"
+#include "vector.h"
struct AmbDecConf;
@@ -27,10 +33,10 @@ class BFormatDec {
/* NOTE: BandSplitter filters are unused with single-band decoding */
BandSplitter mXOver[MAX_AMBI_CHANNELS];
- al::vector<std::array<ALfloat,BUFFERSIZE>, 16> mSamples;
+ al::vector<FloatBufferLine, 16> mSamples;
/* These two alias into Samples */
- std::array<ALfloat,BUFFERSIZE> *mSamplesHF{nullptr};
- std::array<ALfloat,BUFFERSIZE> *mSamplesLF{nullptr};
+ FloatBufferLine *mSamplesHF{nullptr};
+ FloatBufferLine *mSamplesLF{nullptr};
ALuint mNumChannels{0u};
bool mDualBand{false};
diff --git a/Alc/effects/chorus.cpp b/Alc/effects/chorus.cpp
index a2a34008..b9bf3f4c 100644
--- a/Alc/effects/chorus.cpp
+++ b/Alc/effects/chorus.cpp
@@ -20,17 +20,28 @@
#include "config.h"
+#include <algorithm>
+#include <climits>
+#include <cmath>
#include <cstdlib>
+#include <iterator>
-#include <cmath>
-#include <algorithm>
+#include "AL/al.h"
+#include "AL/alc.h"
+#include "AL/efx.h"
-#include "alMain.h"
-#include "alcontext.h"
#include "alAuxEffectSlot.h"
#include "alError.h"
+#include "alMain.h"
+#include "alcontext.h"
+#include "almalloc.h"
+#include "alnumeric.h"
+#include "alspan.h"
#include "alu.h"
-#include "filters/biquad.h"
+#include "ambidefs.h"
+#include "effects/base.h"
+#include "math_defs.h"
+#include "opthelpers.h"
#include "vector.h"
diff --git a/Alc/filters/biquad.cpp b/Alc/filters/biquad.cpp
index e4b7bec0..6a3cef64 100644
--- a/Alc/filters/biquad.cpp
+++ b/Alc/filters/biquad.cpp
@@ -1,13 +1,13 @@
#include "config.h"
-#include <cmath>
+#include "biquad.h"
-#include "AL/alc.h"
-#include "AL/al.h"
+#include <algorithm>
+#include <cassert>
+#include <cmath>
-#include "alMain.h"
-#include "biquad.h"
+#include "opthelpers.h"
template<typename Real>
diff --git a/Alc/filters/biquad.h b/Alc/filters/biquad.h
index eb4cf82a..893a69a9 100644
--- a/Alc/filters/biquad.h
+++ b/Alc/filters/biquad.h
@@ -4,7 +4,6 @@
#include <cmath>
#include <utility>
-#include "AL/al.h"
#include "math_defs.h"
diff --git a/Alc/helpers.cpp b/Alc/helpers.cpp
index ee0bb2dc..9f6283a3 100644
--- a/Alc/helpers.cpp
+++ b/Alc/helpers.cpp
@@ -28,14 +28,15 @@
#include "config.h"
-#include <cstdlib>
-#include <ctime>
+#include <algorithm>
#include <cerrno>
#include <cstdarg>
-#include <cctype>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
+#include <mutex>
+#include <string>
+
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
@@ -95,35 +96,19 @@ DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x
#ifdef HAVE_SYS_SYSCONF_H
#include <sys/sysconf.h>
#endif
-#ifdef HAVE_FLOAT_H
-#include <cfloat>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
#ifndef _WIN32
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
#include <unistd.h>
#elif defined(_WIN32_IE)
#include <shlobj.h>
#endif
-#include <mutex>
-#include <vector>
-#include <string>
-#include <algorithm>
-
#include "alMain.h"
-#include "alu.h"
+#include "almalloc.h"
+#include "compat.h"
#include "cpu_caps.h"
#include "fpu_modes.h"
-#include "vector.h"
-#include "compat.h"
-#include "threads.h"
+#include "logging.h"
#if defined(HAVE_GCC_GET_CPUID) && (defined(__i386__) || defined(__x86_64__) || \
diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp
index d86c4ecf..5561ebfd 100644
--- a/Alc/hrtf.cpp
+++ b/Alc/hrtf.cpp
@@ -20,30 +20,37 @@
#include "config.h"
-#include <stdlib.h>
-#include <ctype.h>
+#include "hrtf.h"
-#include <mutex>
+#include <algorithm>
#include <array>
-#include <vector>
+#include <cassert>
+#include <cctype>
+#include <cstdint>
+#include <cstdio>
+#include <cstring>
+#include <functional>
+#include <fstream>
+#include <iterator>
#include <memory>
-#include <istream>
+#include <mutex>
+#include <new>
#include <numeric>
-#include <algorithm>
-#include <functional>
+#include <utility>
#include "AL/al.h"
-#include "AL/alc.h"
+
#include "alMain.h"
-#include "alSource.h"
-#include "alu.h"
-#include "hrtf.h"
#include "alconfig.h"
-#include "filters/splitter.h"
-
-#include "compat.h"
#include "almalloc.h"
+#include "alnumeric.h"
+#include "aloptional.h"
#include "alspan.h"
+#include "compat.h"
+#include "filters/splitter.h"
+#include "logging.h"
+#include "math_defs.h"
+#include "opthelpers.h"
struct HrtfHandle {
diff --git a/Alc/hrtf.h b/Alc/hrtf.h
index 72533cc1..6c41cb82 100644
--- a/Alc/hrtf.h
+++ b/Alc/hrtf.h
@@ -2,15 +2,19 @@
#define ALC_HRTF_H
#include <array>
+#include <cstddef>
#include <memory>
#include <string>
#include "AL/al.h"
-#include "AL/alc.h"
-#include "vector.h"
#include "almalloc.h"
+#include "ambidefs.h"
+#include "atomic.h"
+#include "vector.h"
+
+struct HrtfHandle;
#define HRTF_HISTORY_BITS (6)
#define HRTF_HISTORY_LENGTH (1<<HRTF_HISTORY_BITS)
@@ -21,8 +25,6 @@
#define HRIR_MASK (HRIR_LENGTH-1)
-struct HrtfHandle;
-
struct HrtfEntry {
RefCount ref;
diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp
index 9b0196d9..1020cc74 100644
--- a/Alc/mixvoice.cpp
+++ b/Alc/mixvoice.cpp
@@ -20,32 +20,47 @@
#include "config.h"
-#include <cmath>
+#include <algorithm>
+#include <array>
+#include <atomic>
+#include <cassert>
+#include <climits>
+#include <cstddef>
+#include <cstdint>
#include <cstdlib>
#include <cstring>
-#include <cctype>
-#include <cassert>
-
+#include <iterator>
+#include <memory>
+#include <new>
#include <numeric>
-#include <algorithm>
+#include <string>
+#include <utility>
#include "AL/al.h"
#include "AL/alc.h"
+#include "alBuffer.h"
#include "alMain.h"
-#include "alcontext.h"
#include "alSource.h"
-#include "alBuffer.h"
-#include "alListener.h"
-#include "alAuxEffectSlot.h"
-#include "sample_cvt.h"
-#include "alu.h"
+#include "albyte.h"
#include "alconfig.h"
-#include "ringbuffer.h"
+#include "alcontext.h"
+#include "alnumeric.h"
+#include "aloptional.h"
+#include "alspan.h"
+#include "alu.h"
#include "cpu_caps.h"
+#include "filters/biquad.h"
+#include "filters/nfc.h"
+#include "filters/splitter.h"
+#include "hrtf.h"
+#include "inprogext.h"
+#include "logging.h"
#include "mixer/defs.h"
-
-#include "alspan.h"
+#include "opthelpers.h"
+#include "ringbuffer.h"
+#include "threads.h"
+#include "vector.h"
static_assert((INT_MAX>>FRACTIONBITS)/MAX_PITCH > BUFFERSIZE,
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 3487d42e..33b2fc39 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -1,38 +1,41 @@
#ifndef AL_MAIN_H
#define AL_MAIN_H
-#include <string.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <math.h>
-#include <limits.h>
-
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-
+#include <algorithm>
#include <array>
-#include <vector>
-#include <string>
+#include <atomic>
#include <chrono>
-#include <algorithm>
+#include <cstdint>
+#include <cstddef>
+#include <memory>
+#include <mutex>
+#include <string>
+#include <utility>
#include "AL/al.h"
#include "AL/alc.h"
#include "AL/alext.h"
-#include "inprogext.h"
-#include "atomic.h"
-#include "vector.h"
#include "albyte.h"
#include "almalloc.h"
#include "alnumeric.h"
#include "alspan.h"
-#include "threads.h"
#include "ambidefs.h"
+#include "atomic.h"
#include "hrtf.h"
+#include "inprogext.h"
+#include "vector.h"
+
+class BFormatDec;
+struct ALbuffer;
+struct ALeffect;
+struct ALfilter;
+struct BackendBase;
+struct Compressor;
+struct EffectState;
+struct FrontStablizer;
+struct Uhj2Encoder;
+struct bs2b;
#ifndef UNUSED
@@ -59,23 +62,6 @@ static const union {
#endif
-struct HrtfEntry;
-struct HrtfHandle;
-struct EnumeratedHrtf;
-struct DirectHrtfState;
-struct FrontStablizer;
-struct Compressor;
-struct BackendBase;
-struct ALbuffer;
-struct ALeffect;
-struct ALfilter;
-struct EffectState;
-struct Uhj2Encoder;
-class BFormatDec;
-class AmbiUpsampler;
-struct bs2b;
-
-
#define MIN_OUTPUT_RATE 8000
#define DEFAULT_OUTPUT_RATE 44100
#define DEFAULT_UPDATE_SIZE 882 /* 20ms */
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 8abfe15f..841e5c03 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -1,31 +1,29 @@
#ifndef _ALU_H_
#define _ALU_H_
-#include <limits.h>
-#include <math.h>
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-
-#include <cmath>
#include <array>
+#include <atomic>
+#include <cmath>
+#include <cstddef>
-#include "alMain.h"
-#include "alBuffer.h"
+#include "AL/al.h"
+#include "AL/alc.h"
+#include "AL/alext.h"
-#include "hrtf.h"
-#include "logging.h"
-#include "math_defs.h"
+#include "alBuffer.h"
+#include "alMain.h"
+#include "almalloc.h"
+#include "alspan.h"
+#include "ambidefs.h"
#include "filters/biquad.h"
-#include "filters/splitter.h"
#include "filters/nfc.h"
+#include "filters/splitter.h"
+#include "hrtf.h"
+#include "logging.h"
-#include "almalloc.h"
-#include "alnumeric.h"
-#include "alspan.h"
+struct ALbufferlistitem;
+struct ALeffectslot;
+struct BSincTable;
enum class DistanceModel;
@@ -34,13 +32,6 @@ enum class DistanceModel;
#define MAX_SENDS 16
-struct BSincTable;
-struct ALsource;
-struct ALbufferlistitem;
-struct ALvoice;
-struct ALeffectslot;
-
-
#define DITHER_RNG_SEED 22222
diff --git a/OpenAL32/alBuffer.cpp b/OpenAL32/alBuffer.cpp
index a6ed98cc..f20b0aee 100644
--- a/OpenAL32/alBuffer.cpp
+++ b/OpenAL32/alBuffer.cpp
@@ -20,27 +20,39 @@
#include "config.h"
-#include <cstdlib>
-#include <cstdio>
-#include <cassert>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
+#include "alBuffer.h"
-#include <tuple>
+#include <algorithm>
#include <array>
-#include <vector>
+#include <atomic>
+#include <cassert>
+#include <cstdint>
+#include <cstdio>
+#include <cstring>
+#include <iterator>
#include <limits>
-#include <algorithm>
+#include <memory>
+#include <mutex>
+#include <new>
+#include <utility>
+#include "AL/al.h"
+#include "AL/alc.h"
+#include "AL/alext.h"
+
+#include "alError.h"
#include "alMain.h"
+#include "albyte.h"
#include "alcontext.h"
-#include "alu.h"
-#include "alError.h"
-#include "alBuffer.h"
-#include "sample_cvt.h"
#include "alexcpt.h"
+#include "almalloc.h"
+#include "alnumeric.h"
#include "aloptional.h"
+#include "atomic.h"
+#include "inprogext.h"
+#include "opthelpers.h"
+#include "sample_cvt.h"
+#include "vector.h"
namespace {
diff --git a/OpenAL32/alEffect.cpp b/OpenAL32/alEffect.cpp
index 0c4f9e72..2de61019 100644
--- a/OpenAL32/alEffect.cpp
+++ b/OpenAL32/alEffect.cpp
@@ -20,22 +20,33 @@
#include "config.h"
-#include <cstdlib>
-#include <cmath>
-#include <cfloat>
+#include "alEffect.h"
#include <algorithm>
+#include <cstdint>
+#include <cstring>
+#include <iterator>
+#include <memory>
+#include <mutex>
+#include <new>
+#include <utility>
#include "AL/al.h"
#include "AL/alc.h"
+#include "AL/alext.h"
+#include "AL/efx-presets.h"
+#include "AL/efx.h"
+#include "alError.h"
#include "alMain.h"
#include "alcontext.h"
-#include "alEffect.h"
-#include "alError.h"
#include "alexcpt.h"
-
+#include "almalloc.h"
+#include "alnumeric.h"
#include "effects/base.h"
+#include "logging.h"
+#include "opthelpers.h"
+#include "vector.h"
const EffectList gEffectList[15]{
@@ -539,8 +550,6 @@ EffectStateFactory *getFactoryByType(ALenum type)
}
-#include "AL/efx-presets.h"
-
#define DECL(x) { #x, EFX_REVERB_PRESET_##x }
static const struct {
const char name[32];
diff --git a/OpenAL32/alError.cpp b/OpenAL32/alError.cpp
index a7895fb9..092784c9 100644
--- a/OpenAL32/alError.cpp
+++ b/OpenAL32/alError.cpp
@@ -20,19 +20,32 @@
#include "config.h"
+#include "alError.h"
+
+#include <atomic>
#include <csignal>
#include <cstdarg>
#include <cstdio>
+#include <cstring>
+#include <mutex>
#ifdef HAVE_WINDOWS_H
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
+#include "AL/al.h"
+#include "AL/alc.h"
+
#include "alMain.h"
#include "alcontext.h"
-#include "alError.h"
#include "alexcpt.h"
+#include "almalloc.h"
+#include "inprogext.h"
+#include "logging.h"
+#include "opthelpers.h"
+#include "vector.h"
+
bool TrapALError{false};
diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp
index 498875bf..22c9e2d2 100644
--- a/OpenAL32/alSource.cpp
+++ b/OpenAL32/alSource.cpp
@@ -20,35 +20,56 @@
#include "config.h"
-#include <cstdlib>
-#include <climits>
-#include <cfloat>
+#include "alSource.h"
+#include <algorithm>
+#include <array>
+#include <atomic>
+#include <cassert>
+#include <chrono>
+#include <climits>
#include <cmath>
-#include <thread>
+#include <cstdint>
+#include <cstdlib>
+#include <functional>
+#include <iterator>
#include <limits>
+#include <memory>
+#include <mutex>
+#include <new>
#include <numeric>
-#include <algorithm>
-#include <functional>
+#include <thread>
+#include <type_traits>
+#include <utility>
#include "AL/al.h"
#include "AL/alc.h"
+#include "AL/alext.h"
+#include "AL/efx.h"
-#include "alMain.h"
-#include "alcontext.h"
-#include "alError.h"
-#include "alSource.h"
+#include "alAuxEffectSlot.h"
#include "alBuffer.h"
+#include "alError.h"
#include "alFilter.h"
-#include "alAuxEffectSlot.h"
-#include "ringbuffer.h"
-#include "bformatdec.h"
-
-#include "backends/base.h"
-
-#include "threads.h"
+#include "alMain.h"
+#include "alcontext.h"
#include "alexcpt.h"
#include "almalloc.h"
+#include "alnumeric.h"
+#include "alu.h"
+#include "ambidefs.h"
+#include "atomic.h"
+#include "backends/base.h"
+#include "bformatdec.h"
+#include "filters/nfc.h"
+#include "filters/splitter.h"
+#include "inprogext.h"
+#include "logging.h"
+#include "math_defs.h"
+#include "opthelpers.h"
+#include "ringbuffer.h"
+#include "threads.h"
+#include "vector.h"
namespace {
diff --git a/OpenAL32/alState.cpp b/OpenAL32/alState.cpp
index 0c447645..f2c38bb2 100644
--- a/OpenAL32/alState.cpp
+++ b/OpenAL32/alState.cpp
@@ -22,17 +22,26 @@
#include "version.h"
-#include <stdlib.h>
+#include <atomic>
#include <cmath>
+#include <cstdlib>
+#include <cstring>
+#include <mutex>
+#include "AL/al.h"
+#include "AL/alc.h"
+#include "AL/alext.h"
+
+#include "alError.h"
#include "alMain.h"
#include "alcontext.h"
-#include "alu.h"
-#include "alError.h"
#include "alexcpt.h"
+#include "almalloc.h"
#include "alspan.h"
-
-#include "backends/base.h"
+#include "alu.h"
+#include "atomic.h"
+#include "inprogext.h"
+#include "opthelpers.h"
namespace {
diff --git a/OpenAL32/event.cpp b/OpenAL32/event.cpp
index 2ee296b0..dfffea9f 100644
--- a/OpenAL32/event.cpp
+++ b/OpenAL32/event.cpp
@@ -2,18 +2,30 @@
#include "config.h"
#include <algorithm>
+#include <atomic>
+#include <cstring>
+#include <exception>
+#include <memory>
+#include <mutex>
+#include <new>
+#include <string>
+#include <thread>
-#include "AL/alc.h"
#include "AL/al.h"
-#include "AL/alext.h"
+#include "AL/alc.h"
+#include "alError.h"
#include "alMain.h"
+#include "albyte.h"
#include "alcontext.h"
-#include "alError.h"
-#include "alAuxEffectSlot.h"
+#include "alexcpt.h"
+#include "almalloc.h"
+#include "effects/base.h"
+#include "inprogext.h"
+#include "logging.h"
+#include "opthelpers.h"
#include "ringbuffer.h"
#include "threads.h"
-#include "alexcpt.h"
static int EventThread(ALCcontext *context)
diff --git a/include/AL/efx.h b/include/AL/efx.h
index 57766983..34085651 100644
--- a/include/AL/efx.h
+++ b/include/AL/efx.h
@@ -1,6 +1,7 @@
#ifndef AL_EFX_H
#define AL_EFX_H
+#include <float.h>
#include "alc.h"
#include "al.h"