diff options
author | Chris Robinson <[email protected]> | 2019-07-28 11:28:36 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-07-28 11:28:36 -0700 |
commit | 5428d6acc37e33802b0b66b2f9cdc0a37dd36429 (patch) | |
tree | e8e159f6b612e246a97e23d14f47a25f1996b35d /Alc | |
parent | 659b6d4245b92a7dba3a1b1693db6de8ddf999eb (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.
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alc.cpp | 86 | ||||
-rw-r--r-- | Alc/alu.cpp | 62 | ||||
-rw-r--r-- | Alc/backends/alsa.cpp | 31 | ||||
-rw-r--r-- | Alc/backends/dsound.cpp | 5 | ||||
-rw-r--r-- | Alc/backends/null.cpp | 15 | ||||
-rw-r--r-- | Alc/backends/oss.cpp | 37 | ||||
-rw-r--r-- | Alc/backends/wasapi.cpp | 4 | ||||
-rw-r--r-- | Alc/backends/wave.cpp | 22 | ||||
-rw-r--r-- | Alc/bformatdec.cpp | 21 | ||||
-rw-r--r-- | Alc/bformatdec.h | 18 | ||||
-rw-r--r-- | Alc/effects/chorus.cpp | 21 | ||||
-rw-r--r-- | Alc/filters/biquad.cpp | 10 | ||||
-rw-r--r-- | Alc/filters/biquad.h | 1 | ||||
-rw-r--r-- | Alc/helpers.cpp | 35 | ||||
-rw-r--r-- | Alc/hrtf.cpp | 35 | ||||
-rw-r--r-- | Alc/hrtf.h | 10 | ||||
-rw-r--r-- | Alc/mixvoice.cpp | 43 |
17 files changed, 281 insertions, 175 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 { @@ -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, |