aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
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 /OpenAL32
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.
Diffstat (limited to 'OpenAL32')
-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
8 files changed, 164 insertions, 111 deletions
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)