summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AudioFormat.cxx2
-rw-r--r--src/AudioFormat.hxx3
-rw-r--r--src/CheckAudioFormat.cxx4
-rw-r--r--src/CommandLine.cxx6
-rw-r--r--src/IcyMetaDataParser.cxx2
-rw-r--r--src/Instance.cxx4
-rw-r--r--src/Listen.cxx2
-rw-r--r--src/LocateUri.hxx1
-rw-r--r--src/Main.cxx4
-rw-r--r--src/Main.hxx4
-rw-r--r--src/MusicPipe.cxx2
-rw-r--r--src/MusicPipe.hxx2
-rw-r--r--src/Partition.hxx1
-rw-r--r--src/Permission.cxx2
-rw-r--r--src/PlaylistFile.cxx4
-rw-r--r--src/PlaylistPrint.cxx5
-rw-r--r--src/PlaylistSave.cxx2
-rw-r--r--src/ReplayGainGlobal.cxx2
-rw-r--r--src/SongPrint.cxx3
-rw-r--r--src/SongUpdate.cxx2
-rw-r--r--src/StateFile.cxx2
-rw-r--r--src/StateFile.hxx2
-rw-r--r--src/Stats.cxx5
-rw-r--r--src/TagFile.cxx2
-rw-r--r--src/TagStream.cxx2
-rw-r--r--src/TimePrint.hxx2
-rw-r--r--src/client/Client.cxx1
-rw-r--r--src/client/Read.cxx1
-rw-r--r--src/client/Subscribe.cxx2
-rw-r--r--src/command/AllCommands.cxx1
-rw-r--r--src/command/CommandError.cxx2
-rw-r--r--src/command/CommandError.hxx2
-rw-r--r--src/command/DatabaseCommands.cxx4
-rw-r--r--src/command/FileCommands.cxx1
-rw-r--r--src/command/OtherCommands.cxx4
-rw-r--r--src/command/PlayerCommands.cxx3
-rw-r--r--src/command/PlaylistCommands.cxx1
-rw-r--r--src/command/QueueCommands.cxx2
-rw-r--r--src/command/StickerCommands.cxx1
-rw-r--r--src/command/StorageCommands.cxx4
-rw-r--r--src/command/TagCommands.cxx2
-rw-r--r--src/config/Block.cxx1
-rw-r--r--src/config/Block.hxx1
-rw-r--r--src/config/Check.hxx3
-rw-r--r--src/config/Data.hxx2
-rw-r--r--src/config/Path.cxx1
-rw-r--r--src/db/DatabaseGlue.cxx1
-rw-r--r--src/db/DatabasePlaylist.cxx1
-rw-r--r--src/db/DatabasePrint.cxx5
-rw-r--r--src/db/DatabasePrint.hxx2
-rw-r--r--src/db/DatabaseSong.hxx2
-rw-r--r--src/db/UniqueTags.hxx3
-rw-r--r--src/db/VHelper.cxx3
-rw-r--r--src/db/VHelper.hxx1
-rw-r--r--src/db/plugins/ProxyDatabasePlugin.cxx1
-rw-r--r--src/db/plugins/simple/DatabaseSave.cxx1
-rw-r--r--src/db/plugins/simple/SimpleDatabasePlugin.cxx1
-rw-r--r--src/db/plugins/upnp/ContentDirectoryService.cxx3
-rw-r--r--src/db/plugins/upnp/Directory.cxx1
-rw-r--r--src/db/plugins/upnp/UpnpDatabasePlugin.cxx4
-rw-r--r--src/db/update/Editor.hxx1
-rw-r--r--src/db/update/ExcludeList.cxx4
-rw-r--r--src/db/update/InotifySource.cxx1
-rw-r--r--src/db/update/InotifySource.hxx3
-rw-r--r--src/db/update/InotifyUpdate.hxx2
-rw-r--r--src/db/update/Remove.hxx2
-rw-r--r--src/db/update/UpdateIO.cxx2
-rw-r--r--src/db/update/Walk.cxx2
-rw-r--r--src/decoder/DecoderAPI.hxx2
-rw-r--r--src/decoder/Reader.hxx1
-rw-r--r--src/decoder/Thread.cxx1
-rw-r--r--src/decoder/plugins/DsdLib.cxx2
-rw-r--r--src/decoder/plugins/DsdiffDecoderPlugin.cxx1
-rw-r--r--src/decoder/plugins/DsfDecoderPlugin.cxx1
-rw-r--r--src/decoder/plugins/FaadDecoderPlugin.cxx1
-rw-r--r--src/decoder/plugins/FfmpegDecoderPlugin.cxx1
-rw-r--r--src/decoder/plugins/FfmpegIo.cxx2
-rw-r--r--src/decoder/plugins/MadDecoderPlugin.cxx4
-rw-r--r--src/decoder/plugins/MpcdecDecoderPlugin.cxx2
-rw-r--r--src/decoder/plugins/OggDecoder.cxx2
-rw-r--r--src/decoder/plugins/OpusTags.cxx2
-rw-r--r--src/decoder/plugins/PcmDecoderPlugin.cxx1
-rw-r--r--src/decoder/plugins/WavpackDecoderPlugin.cxx2
-rw-r--r--src/decoder/plugins/WildmidiDecoderPlugin.cxx1
-rw-r--r--src/encoder/plugins/FlacEncoderPlugin.cxx1
-rw-r--r--src/encoder/plugins/LameEncoderPlugin.cxx1
-rw-r--r--src/encoder/plugins/OpusEncoderPlugin.cxx1
-rw-r--r--src/encoder/plugins/ShineEncoderPlugin.cxx1
-rw-r--r--src/encoder/plugins/TwolameEncoderPlugin.cxx1
-rw-r--r--src/event/BufferedSocket.cxx2
-rw-r--r--src/event/Call.cxx1
-rw-r--r--src/event/MultiSocketMonitor.hxx1
-rw-r--r--src/event/ServerSocket.cxx3
-rw-r--r--src/event/SocketMonitor.cxx8
-rw-r--r--src/filter/plugins/AutoConvertFilterPlugin.cxx1
-rw-r--r--src/filter/plugins/ConvertFilterPlugin.cxx2
-rw-r--r--src/filter/plugins/FfmpegFilterPlugin.cxx2
-rw-r--r--src/filter/plugins/NullFilterPlugin.cxx1
-rw-r--r--src/filter/plugins/RouteFilterPlugin.cxx3
-rw-r--r--src/filter/plugins/VolumeFilterPlugin.cxx2
-rw-r--r--src/fs/AllocatedPath.cxx5
-rw-r--r--src/fs/Charset.cxx1
-rw-r--r--src/fs/CheckFile.cxx2
-rw-r--r--src/fs/io/GunzipReader.hxx1
-rw-r--r--src/fs/io/GzipOutputStream.hxx1
-rw-r--r--src/fs/io/PeekReader.hxx1
-rw-r--r--src/fs/io/TextFile.hxx1
-rw-r--r--src/input/BufferedInputStream.cxx2
-rw-r--r--src/input/BufferingInputStream.cxx2
-rw-r--r--src/input/BufferingInputStream.hxx2
-rw-r--r--src/input/ProxyInputStream.cxx2
-rw-r--r--src/input/Reader.hxx2
-rw-r--r--src/input/TextInputStream.cxx3
-rw-r--r--src/input/cache/Item.cxx1
-rw-r--r--src/input/cache/Item.hxx2
-rw-r--r--src/input/cache/Manager.hxx1
-rw-r--r--src/input/plugins/AlsaInputPlugin.cxx2
-rw-r--r--src/input/plugins/CdioParanoiaInputPlugin.cxx2
-rw-r--r--src/input/plugins/CurlInputPlugin.cxx3
-rw-r--r--src/input/plugins/FfmpegInputPlugin.cxx8
-rw-r--r--src/input/plugins/FileInputPlugin.cxx1
-rw-r--r--src/input/plugins/MmsInputPlugin.cxx1
-rw-r--r--src/input/plugins/NfsInputPlugin.cxx1
-rw-r--r--src/input/plugins/QobuzInputPlugin.cxx3
-rw-r--r--src/input/plugins/QobuzLoginRequest.cxx1
-rw-r--r--src/input/plugins/QobuzTrackRequest.cxx1
-rw-r--r--src/input/plugins/SmbclientInputPlugin.cxx1
-rw-r--r--src/input/plugins/TidalInputPlugin.cxx1
-rw-r--r--src/input/plugins/TidalSessionManager.cxx1
-rw-r--r--src/input/plugins/TidalSessionManager.hxx3
-rw-r--r--src/lib/alsa/Version.cxx2
-rw-r--r--src/lib/curl/Init.cxx2
-rw-r--r--src/lib/dbus/Connection.hxx3
-rw-r--r--src/lib/dbus/Message.hxx2
-rw-r--r--src/lib/dbus/Watch.hxx1
-rw-r--r--src/lib/ffmpeg/Init.cxx1
-rw-r--r--src/lib/ffmpeg/LogCallback.cxx2
-rw-r--r--src/lib/gcrypt/MD5.cxx2
-rw-r--r--src/lib/nfs/Connection.hxx1
-rw-r--r--src/lib/pcre/UniqueRegex.hxx3
-rw-r--r--src/lib/sqlite/Util.hxx1
-rw-r--r--src/lib/upnp/ContentDirectoryService.cxx3
-rw-r--r--src/lib/upnp/Discovery.hxx2
-rw-r--r--src/lib/upnp/Util.cxx2
-rw-r--r--src/lib/upnp/ixmlwrap.hxx2
-rw-r--r--src/lib/xiph/FlacIOHandle.hxx1
-rw-r--r--src/lib/xiph/FlacStreamMetadata.hxx2
-rw-r--r--src/lib/xiph/OggVisitor.hxx2
-rw-r--r--src/mixer/MixerAll.cxx3
-rw-r--r--src/mixer/MixerType.hxx2
-rw-r--r--src/mixer/plugins/PulseMixerPlugin.cxx1
-rw-r--r--src/mixer/plugins/SndioMixerPlugin.cxx3
-rw-r--r--src/neighbor/Glue.cxx1
-rw-r--r--src/neighbor/plugins/SmbclientNeighborPlugin.cxx2
-rw-r--r--src/neighbor/plugins/UdisksNeighborPlugin.cxx2
-rw-r--r--src/neighbor/plugins/UpnpNeighborPlugin.cxx2
-rw-r--r--src/net/AddressInfo.hxx1
-rw-r--r--src/net/AllocatedSocketAddress.cxx8
-rw-r--r--src/net/AllocatedSocketAddress.hxx2
-rw-r--r--src/net/Resolver.hxx1
-rw-r--r--src/net/StaticSocketAddress.cxx8
-rw-r--r--src/output/Control.cxx4
-rw-r--r--src/output/Control.hxx5
-rw-r--r--src/output/Filtered.hxx2
-rw-r--r--src/output/Init.cxx4
-rw-r--r--src/output/Interface.hxx1
-rw-r--r--src/output/MultipleOutputs.cxx1
-rw-r--r--src/output/OutputCommand.cxx2
-rw-r--r--src/output/OutputPlugin.hxx6
-rw-r--r--src/output/Print.cxx1
-rw-r--r--src/output/Source.hxx1
-rw-r--r--src/output/State.cxx1
-rw-r--r--src/output/Thread.cxx1
-rw-r--r--src/output/Timer.cxx2
-rw-r--r--src/output/plugins/AlsaOutputPlugin.cxx1
-rw-r--r--src/output/plugins/JackOutputPlugin.cxx1
-rw-r--r--src/output/plugins/PulseOutputPlugin.cxx2
-rw-r--r--src/output/plugins/RecorderOutputPlugin.cxx1
-rw-r--r--src/output/plugins/ShoutOutputPlugin.cxx1
-rw-r--r--src/output/plugins/httpd/HttpdOutputPlugin.cxx4
-rw-r--r--src/pcm/ConfiguredResampler.cxx1
-rw-r--r--src/pcm/Export.cxx1
-rw-r--r--src/pcm/Export.hxx1
-rw-r--r--src/pcm/FallbackResampler.hxx1
-rw-r--r--src/pcm/FloatConvert.hxx1
-rw-r--r--src/pcm/GlueResampler.cxx1
-rw-r--r--src/pcm/GlueResampler.hxx3
-rw-r--r--src/pcm/LibsamplerateResampler.hxx1
-rw-r--r--src/pcm/PcmFormat.cxx1
-rw-r--r--src/pcm/SoxrResampler.hxx1
-rw-r--r--src/pcm/dsd2pcm/dsd2pcm.h1
-rw-r--r--src/playlist/MemorySongEnumerator.hxx1
-rw-r--r--src/playlist/PlaylistAny.cxx1
-rw-r--r--src/playlist/PlaylistRegistry.cxx1
-rw-r--r--src/playlist/plugins/AsxPlaylistPlugin.cxx1
-rw-r--r--src/playlist/plugins/RssPlaylistPlugin.cxx1
-rw-r--r--src/playlist/plugins/XspfPlaylistPlugin.cxx1
-rw-r--r--src/protocol/Ack.hxx1
-rw-r--r--src/queue/PlaylistEdit.cxx2
-rw-r--r--src/queue/Queue.hxx2
-rw-r--r--src/song/BaseSongFilter.hxx1
-rw-r--r--src/song/Filter.cxx7
-rw-r--r--src/song/StringFilter.cxx2
-rw-r--r--src/song/TagSongFilter.hxx2
-rw-r--r--src/sticker/Database.hxx1
-rw-r--r--src/storage/Configured.cxx3
-rw-r--r--src/storage/Registry.cxx1
-rw-r--r--src/storage/plugins/CurlStorage.cxx5
-rw-r--r--src/storage/plugins/UdisksStorage.cxx1
-rw-r--r--src/system/Clock.hxx4
-rw-r--r--src/system/EpollFD.hxx2
-rw-r--r--src/system/EventPipe.cxx1
-rw-r--r--src/tag/Builder.cxx1
-rw-r--r--src/tag/Generic.cxx2
-rw-r--r--src/tag/Handler.cxx1
-rw-r--r--src/tag/ReplayGain.cxx1
-rw-r--r--src/tag/Tag.hxx2
-rw-r--r--src/time/ISO8601.hxx1
-rw-r--r--src/unix/Daemon.cxx1
-rw-r--r--src/util/AllocatedString.hxx1
-rw-r--r--src/util/DivideString.hxx2
-rw-r--r--src/util/Exception.hxx1
-rw-r--r--src/util/HexFormat.hxx1
-rw-r--r--src/util/OptionParser.cxx2
-rw-r--r--src/util/PrintException.hxx2
-rw-r--r--src/util/SplitString.cxx2
-rw-r--r--src/zeroconf/AvahiPoll.hxx2
227 files changed, 67 insertions, 392 deletions
diff --git a/src/AudioFormat.cxx b/src/AudioFormat.cxx
index 3469bd9a9..f7688063a 100644
--- a/src/AudioFormat.cxx
+++ b/src/AudioFormat.cxx
@@ -19,9 +19,9 @@
#include "AudioFormat.hxx"
#include "util/StringBuffer.hxx"
-#include "util/StringFormat.hxx"
#include <assert.h>
+#include <stdio.h>
void
AudioFormat::ApplyMask(AudioFormat mask) noexcept
diff --git a/src/AudioFormat.hxx b/src/AudioFormat.hxx
index 2968d2584..46bc05bd2 100644
--- a/src/AudioFormat.hxx
+++ b/src/AudioFormat.hxx
@@ -24,9 +24,8 @@
#include "pcm/ChannelDefs.hxx"
#include "util/Compiler.h"
-#include <chrono>
+#include <cstdint>
-#include <stdint.h>
#include <stddef.h>
template<size_t CAPACITY> class StringBuffer;
diff --git a/src/CheckAudioFormat.cxx b/src/CheckAudioFormat.cxx
index bfdc9bae2..53e38c474 100644
--- a/src/CheckAudioFormat.cxx
+++ b/src/CheckAudioFormat.cxx
@@ -21,10 +21,6 @@
#include "AudioFormat.hxx"
#include "util/RuntimeError.hxx"
-#include <stdexcept>
-
-#include <assert.h>
-
void
CheckSampleRate(unsigned long sample_rate)
{
diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx
index eef3a9771..ac53cf53a 100644
--- a/src/CommandLine.cxx
+++ b/src/CommandLine.cxx
@@ -36,13 +36,15 @@
#include "fs/Traits.hxx"
#include "fs/FileSystem.hxx"
#include "fs/StandardDirectory.hxx"
-#include "system/Error.hxx"
#include "util/Macros.hxx"
-#include "util/RuntimeError.hxx"
#include "util/Domain.hxx"
#include "util/OptionDef.hxx"
#include "util/OptionParser.hxx"
+#ifdef _WIN32
+#include "system/Error.hxx"
+#endif
+
#ifdef ENABLE_DATABASE
#include "db/Registry.hxx"
#include "db/DatabasePlugin.hxx"
diff --git a/src/IcyMetaDataParser.cxx b/src/IcyMetaDataParser.cxx
index 98b30e208..e41d9e1e5 100644
--- a/src/IcyMetaDataParser.cxx
+++ b/src/IcyMetaDataParser.cxx
@@ -24,6 +24,8 @@
#include "util/StringView.hxx"
#include "Log.hxx"
+#include <algorithm>
+
#include <assert.h>
#include <string.h>
diff --git a/src/Instance.cxx b/src/Instance.cxx
index 7510a2781..e0a40f6e2 100644
--- a/src/Instance.cxx
+++ b/src/Instance.cxx
@@ -20,7 +20,7 @@
#include "config.h"
#include "Instance.hxx"
#include "Partition.hxx"
-#include "Idle.hxx"
+#include "IdleFlags.hxx"
#include "Stats.hxx"
#include "client/List.hxx"
#include "input/cache/Manager.hxx"
@@ -46,8 +46,6 @@
#endif
#endif
-#include <exception>
-
Instance::Instance()
:rtio_thread(true),
#ifdef ENABLE_SYSTEMD_DAEMON
diff --git a/src/Listen.cxx b/src/Listen.cxx
index 14b7cbee7..27d07392c 100644
--- a/src/Listen.cxx
+++ b/src/Listen.cxx
@@ -34,8 +34,6 @@
#include "fs/XDG.hxx"
#include <sys/stat.h>
-#include <string.h>
-#include <assert.h>
#ifdef ENABLE_SYSTEMD_DAEMON
#include <systemd/sd-daemon.h>
diff --git a/src/LocateUri.hxx b/src/LocateUri.hxx
index 047d06205..411cb5248 100644
--- a/src/LocateUri.hxx
+++ b/src/LocateUri.hxx
@@ -21,7 +21,6 @@
#define MPD_LOCATE_URI_HXX
#include "config.h"
-#include "util/Compiler.h"
#include "fs/AllocatedPath.hxx"
#ifdef _WIN32
diff --git a/src/Main.cxx b/src/Main.cxx
index 1de0c622d..614702ac5 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -34,7 +34,7 @@
#include "Partition.hxx"
#include "tag/Config.hxx"
#include "ReplayGainGlobal.hxx"
-#include "Idle.hxx"
+#include "IdleFlags.hxx"
#include "Log.hxx"
#include "LogInit.hxx"
#include "input/Init.hxx"
@@ -52,7 +52,6 @@
#include "thread/Slack.hxx"
#include "net/Init.hxx"
#include "lib/icu/Init.hxx"
-#include "config/File.hxx"
#include "config/Check.hxx"
#include "config/Data.hxx"
#include "config/Param.hxx"
@@ -98,6 +97,7 @@
#include "android/Environment.hxx"
#include "android/Context.hxx"
#include "android/LogListener.hxx"
+#include "config/File.hxx"
#include "fs/FileSystem.hxx"
#include "org_musicpd_Bridge.h"
#endif
diff --git a/src/Main.hxx b/src/Main.hxx
index aa77d06bc..0f67f61e8 100644
--- a/src/Main.hxx
+++ b/src/Main.hxx
@@ -20,14 +20,12 @@
#ifndef MPD_MAIN_HXX
#define MPD_MAIN_HXX
-class EventLoop;
-class Context;
struct Instance;
#ifdef ANDROID
#include "android/LogListener.hxx"
-extern Context *context;
+extern class Context *context;
extern LogListener *logListener;
#endif
diff --git a/src/MusicPipe.cxx b/src/MusicPipe.cxx
index 2c6af04c0..b5bd025f5 100644
--- a/src/MusicPipe.cxx
+++ b/src/MusicPipe.cxx
@@ -20,6 +20,8 @@
#include "MusicPipe.hxx"
#include "MusicChunk.hxx"
+#include <assert.h>
+
#ifndef NDEBUG
bool
diff --git a/src/MusicPipe.hxx b/src/MusicPipe.hxx
index d98d6a738..859aa19f5 100644
--- a/src/MusicPipe.hxx
+++ b/src/MusicPipe.hxx
@@ -28,8 +28,6 @@
#include "AudioFormat.hxx"
#endif
-#include <assert.h>
-
/**
* A queue of #MusicChunk objects. One party appends chunks at the
* tail, and the other consumes them from the head.
diff --git a/src/Partition.hxx b/src/Partition.hxx
index d38000cd6..0bbe017df 100644
--- a/src/Partition.hxx
+++ b/src/Partition.hxx
@@ -30,7 +30,6 @@
#include "ReplayGainMode.hxx"
#include "SingleMode.hxx"
#include "Chrono.hxx"
-#include "util/Compiler.h"
#include "config.h"
#include <string>
diff --git a/src/Permission.cxx b/src/Permission.cxx
index 8d28db8c6..ad3be88d1 100644
--- a/src/Permission.cxx
+++ b/src/Permission.cxx
@@ -26,9 +26,9 @@
#include "util/RuntimeError.hxx"
#include "util/StringView.hxx"
-#include <algorithm>
#include <map>
#include <string>
+#include <utility>
#include <assert.h>
#include <string.h>
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx
index 2ca70d9e2..51955b3cc 100644
--- a/src/PlaylistFile.cxx
+++ b/src/PlaylistFile.cxx
@@ -39,15 +39,11 @@
#include "fs/FileSystem.hxx"
#include "fs/FileInfo.hxx"
#include "fs/DirectoryReader.hxx"
-#include "util/Macros.hxx"
#include "util/StringCompare.hxx"
#include "util/UriUtil.hxx"
-#include <memory>
-
#include <assert.h>
#include <string.h>
-#include <errno.h>
static const char PLAYLIST_COMMENT = '#';
diff --git a/src/PlaylistPrint.cxx b/src/PlaylistPrint.cxx
index 65e1adef3..d30ac5d41 100644
--- a/src/PlaylistPrint.cxx
+++ b/src/PlaylistPrint.cxx
@@ -22,11 +22,6 @@
#include "PlaylistError.hxx"
#include "queue/Playlist.hxx"
#include "queue/QueuePrint.hxx"
-#include "SongPrint.hxx"
-#include "Partition.hxx"
-#include "Instance.hxx"
-#include "db/Interface.hxx"
-#include "client/Response.hxx"
#define SONG_FILE "file: "
#define SONG_TIME "Time: "
diff --git a/src/PlaylistSave.cxx b/src/PlaylistSave.cxx
index 54fa80d9d..cca47e0ba 100644
--- a/src/PlaylistSave.cxx
+++ b/src/PlaylistSave.cxx
@@ -32,8 +32,6 @@
#include "fs/io/BufferedOutputStream.hxx"
#include "util/UriUtil.hxx"
-#include <exception>
-
static void
playlist_print_path(BufferedOutputStream &os, const Path path)
{
diff --git a/src/ReplayGainGlobal.cxx b/src/ReplayGainGlobal.cxx
index 1ae0fb7b2..09291f588 100644
--- a/src/ReplayGainGlobal.cxx
+++ b/src/ReplayGainGlobal.cxx
@@ -19,9 +19,7 @@
#include "ReplayGainGlobal.hxx"
#include "ReplayGainConfig.hxx"
-#include "config/Param.hxx"
#include "config/Data.hxx"
-#include "util/RuntimeError.hxx"
#include <assert.h>
#include <stdlib.h>
diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx
index 34f0c41b6..4377f3b42 100644
--- a/src/SongPrint.cxx
+++ b/src/SongPrint.cxx
@@ -19,9 +19,6 @@
#include "SongPrint.hxx"
#include "song/LightSong.hxx"
-#include "Partition.hxx"
-#include "Instance.hxx"
-#include "storage/StorageInterface.hxx"
#include "song/DetachedSong.hxx"
#include "TimePrint.hxx"
#include "TagPrint.hxx"
diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx
index e82384677..d843f5ed2 100644
--- a/src/SongUpdate.cxx
+++ b/src/SongUpdate.cxx
@@ -34,8 +34,6 @@
#include "TagArchive.hxx"
#endif
-#include <exception>
-
#include <assert.h>
#include <string.h>
diff --git a/src/StateFile.cxx b/src/StateFile.cxx
index 52cc0f067..2854351d3 100644
--- a/src/StateFile.cxx
+++ b/src/StateFile.cxx
@@ -34,8 +34,6 @@
#include <exception>
-#include <string.h>
-
static constexpr Domain state_file_domain("state_file");
StateFile::StateFile(StateFileConfig &&_config,
diff --git a/src/StateFile.hxx b/src/StateFile.hxx
index 7e266caf8..87fdb6806 100644
--- a/src/StateFile.hxx
+++ b/src/StateFile.hxx
@@ -22,12 +22,10 @@
#include "StateFileConfig.hxx"
#include "event/TimerEvent.hxx"
-#include "fs/AllocatedPath.hxx"
#include "util/Compiler.h"
#include "config.h"
#include <string>
-#include <chrono>
struct Partition;
class OutputStream;
diff --git a/src/Stats.cxx b/src/Stats.cxx
index 8169ac344..392f2c7a1 100644
--- a/src/Stats.cxx
+++ b/src/Stats.cxx
@@ -26,10 +26,13 @@
#include "db/Selection.hxx"
#include "db/Interface.hxx"
#include "db/Stats.hxx"
-#include "system/Clock.hxx"
#include "Log.hxx"
#include "time/ChronoUtil.hxx"
+#ifdef _WIN32
+#include "system/Clock.hxx"
+#endif
+
#include <chrono>
#include <cmath>
diff --git a/src/TagFile.cxx b/src/TagFile.cxx
index dd8b1c417..c633422ea 100644
--- a/src/TagFile.cxx
+++ b/src/TagFile.cxx
@@ -27,8 +27,6 @@
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
-#include <exception>
-
#include <assert.h>
class TagFileScan {
diff --git a/src/TagStream.cxx b/src/TagStream.cxx
index 5c5615c3a..9e23d9e8b 100644
--- a/src/TagStream.cxx
+++ b/src/TagStream.cxx
@@ -28,8 +28,6 @@
#include "input/InputStream.hxx"
#include "thread/Mutex.hxx"
-#include <exception>
-
#include <assert.h>
/**
diff --git a/src/TimePrint.hxx b/src/TimePrint.hxx
index 2ae516928..830d80f97 100644
--- a/src/TimePrint.hxx
+++ b/src/TimePrint.hxx
@@ -22,8 +22,6 @@
#include <chrono>
-#include <time.h>
-
class Response;
/**
diff --git a/src/client/Client.cxx b/src/client/Client.cxx
index 7a976c0de..f0f8984d2 100644
--- a/src/client/Client.cxx
+++ b/src/client/Client.cxx
@@ -22,7 +22,6 @@
#include "Partition.hxx"
#include "Instance.hxx"
#include "BackgroundCommand.hxx"
-#include "util/Domain.hxx"
#include "config.h"
Client::~Client() noexcept
diff --git a/src/client/Read.cxx b/src/client/Read.cxx
index cb5a89718..f7fa66036 100644
--- a/src/client/Read.cxx
+++ b/src/client/Read.cxx
@@ -21,7 +21,6 @@
#include "Config.hxx"
#include "Partition.hxx"
#include "Instance.hxx"
-#include "event/Loop.hxx"
#include "util/StringStrip.hxx"
#include <string.h>
diff --git a/src/client/Subscribe.cxx b/src/client/Subscribe.cxx
index c6a7d24a1..25d3cbfef 100644
--- a/src/client/Subscribe.cxx
+++ b/src/client/Subscribe.cxx
@@ -19,7 +19,7 @@
#include "Client.hxx"
#include "Partition.hxx"
-#include "Idle.hxx"
+#include "IdleFlags.hxx"
#include <assert.h>
diff --git a/src/command/AllCommands.cxx b/src/command/AllCommands.cxx
index 0d5803773..be039f22f 100644
--- a/src/command/AllCommands.cxx
+++ b/src/command/AllCommands.cxx
@@ -47,7 +47,6 @@
#ifdef ENABLE_SQLITE
#include "StickerCommands.hxx"
-#include "sticker/Database.hxx"
#endif
#include <assert.h>
diff --git a/src/command/CommandError.cxx b/src/command/CommandError.cxx
index 6f81f6b41..091984a29 100644
--- a/src/command/CommandError.cxx
+++ b/src/command/CommandError.cxx
@@ -27,8 +27,6 @@
#include <system_error>
-#include <assert.h>
-
gcc_const
static enum ack
ToAck(PlaylistResult result) noexcept
diff --git a/src/command/CommandError.hxx b/src/command/CommandError.hxx
index faeb8848e..aacf4f7fe 100644
--- a/src/command/CommandError.hxx
+++ b/src/command/CommandError.hxx
@@ -20,8 +20,6 @@
#ifndef MPD_COMMAND_ERROR_HXX
#define MPD_COMMAND_ERROR_HXX
-#include "CommandResult.hxx"
-
#include <exception>
class Response;
diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx
index 2b62c54a9..fcd4ac66c 100644
--- a/src/command/DatabaseCommands.cxx
+++ b/src/command/DatabaseCommands.cxx
@@ -24,20 +24,18 @@
#include "db/DatabasePrint.hxx"
#include "db/Count.hxx"
#include "db/Selection.hxx"
-#include "CommandError.hxx"
#include "protocol/RangeArg.hxx"
#include "client/Client.hxx"
#include "client/Response.hxx"
#include "tag/ParseName.hxx"
-#include "tag/Mask.hxx"
#include "util/ConstBuffer.hxx"
#include "util/Exception.hxx"
#include "util/StringAPI.hxx"
#include "util/ASCII.hxx"
#include "song/Filter.hxx"
-#include "BulkEdit.hxx"
#include <memory>
+#include <vector>
CommandResult
handle_listfiles_db(Client &client, Response &r, const char *uri)
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx
index f164618ab..e19adb648 100644
--- a/src/command/FileCommands.cxx
+++ b/src/command/FileCommands.cxx
@@ -22,7 +22,6 @@
#include "config.h"
#include "FileCommands.hxx"
#include "Request.hxx"
-#include "CommandError.hxx"
#include "protocol/Ack.hxx"
#include "client/Client.hxx"
#include "client/Response.hxx"
diff --git a/src/command/OtherCommands.cxx b/src/command/OtherCommands.cxx
index 6d19d4b2b..95a45f712 100644
--- a/src/command/OtherCommands.cxx
+++ b/src/command/OtherCommands.cxx
@@ -22,7 +22,6 @@
#include "Request.hxx"
#include "FileCommands.hxx"
#include "StorageCommands.hxx"
-#include "CommandError.hxx"
#include "db/Uri.hxx"
#include "storage/StorageInterface.hxx"
#include "LocateUri.hxx"
@@ -47,7 +46,7 @@
#include "client/Response.hxx"
#include "Partition.hxx"
#include "Instance.hxx"
-#include "Idle.hxx"
+#include "IdleFlags.hxx"
#include "Log.hxx"
#ifdef ENABLE_DATABASE
@@ -57,7 +56,6 @@
#endif
#include <assert.h>
-#include <string.h>
static void
print_spl_list(Response &r, const PlaylistVector &list)
diff --git a/src/command/PlayerCommands.cxx b/src/command/PlayerCommands.cxx
index 1c6d25596..5769f8f42 100644
--- a/src/command/PlayerCommands.cxx
+++ b/src/command/PlayerCommands.cxx
@@ -20,7 +20,6 @@
#include "config.h"
#include "PlayerCommands.hxx"
#include "Request.hxx"
-#include "CommandError.hxx"
#include "queue/Playlist.hxx"
#include "PlaylistPrint.hxx"
#include "SingleMode.hxx"
@@ -29,7 +28,7 @@
#include "mixer/Volume.hxx"
#include "Partition.hxx"
#include "Instance.hxx"
-#include "Idle.hxx"
+#include "IdleFlags.hxx"
#include "AudioFormat.hxx"
#include "util/StringBuffer.hxx"
#include "util/ScopeExit.hxx"
diff --git a/src/command/PlaylistCommands.cxx b/src/command/PlaylistCommands.cxx
index 6ea345e72..1aa630085 100644
--- a/src/command/PlaylistCommands.cxx
+++ b/src/command/PlaylistCommands.cxx
@@ -23,7 +23,6 @@
#include "Instance.hxx"
#include "db/Selection.hxx"
#include "db/DatabasePlaylist.hxx"
-#include "CommandError.hxx"
#include "PlaylistSave.hxx"
#include "PlaylistFile.hxx"
#include "PlaylistError.hxx"
diff --git a/src/command/QueueCommands.cxx b/src/command/QueueCommands.cxx
index e5b53dd9f..47dcbe0de 100644
--- a/src/command/QueueCommands.cxx
+++ b/src/command/QueueCommands.cxx
@@ -20,7 +20,6 @@
#include "config.h"
#include "QueueCommands.hxx"
#include "Request.hxx"
-#include "CommandError.hxx"
#include "protocol/RangeArg.hxx"
#include "db/DatabaseQueue.hxx"
#include "db/Selection.hxx"
@@ -40,7 +39,6 @@
#include "util/StringAPI.hxx"
#include "util/NumberParser.hxx"
-#include <memory>
#include <limits>
static void
diff --git a/src/command/StickerCommands.cxx b/src/command/StickerCommands.cxx
index 77856bbad..1af1c420d 100644
--- a/src/command/StickerCommands.cxx
+++ b/src/command/StickerCommands.cxx
@@ -24,7 +24,6 @@
#include "sticker/Sticker.hxx"
#include "sticker/SongSticker.hxx"
#include "sticker/Print.hxx"
-#include "sticker/Database.hxx"
#include "client/Client.hxx"
#include "client/Response.hxx"
#include "Partition.hxx"
diff --git a/src/command/StorageCommands.cxx b/src/command/StorageCommands.cxx
index c011646d4..2fc772bd9 100644
--- a/src/command/StorageCommands.cxx
+++ b/src/command/StorageCommands.cxx
@@ -22,14 +22,12 @@
#include "config.h"
#include "StorageCommands.hxx"
#include "Request.hxx"
-#include "CommandError.hxx"
#include "time/ChronoUtil.hxx"
#include "util/UriUtil.hxx"
#include "util/ConstBuffer.hxx"
#include "fs/Traits.hxx"
#include "client/Client.hxx"
#include "client/Response.hxx"
-#include "Partition.hxx"
#include "Instance.hxx"
#include "storage/Registry.hxx"
#include "storage/CompositeStorage.hxx"
@@ -37,7 +35,7 @@
#include "db/plugins/simple/SimpleDatabasePlugin.hxx"
#include "db/update/Service.hxx"
#include "TimePrint.hxx"
-#include "Idle.hxx"
+#include "IdleFlags.hxx"
#include <memory>
diff --git a/src/command/TagCommands.cxx b/src/command/TagCommands.cxx
index 860c3c272..4db7af9e1 100644
--- a/src/command/TagCommands.cxx
+++ b/src/command/TagCommands.cxx
@@ -22,7 +22,7 @@
#include "client/Client.hxx"
#include "client/Response.hxx"
#include "tag/ParseName.hxx"
-#include "Partition.hxx"
+#include "queue/Playlist.hxx"
#include "util/ConstBuffer.hxx"
CommandResult
diff --git a/src/config/Block.cxx b/src/config/Block.cxx
index ea57c0ad2..19d4f50cc 100644
--- a/src/config/Block.cxx
+++ b/src/config/Block.cxx
@@ -23,7 +23,6 @@
#include "fs/AllocatedPath.hxx"
#include "util/RuntimeError.hxx"
-#include <assert.h>
#include <stdlib.h>
void
diff --git a/src/config/Block.hxx b/src/config/Block.hxx
index 86a8c5d82..dd6e40cf6 100644
--- a/src/config/Block.hxx
+++ b/src/config/Block.hxx
@@ -20,7 +20,6 @@
#ifndef MPD_CONFIG_BLOCK_HXX
#define MPD_CONFIG_BLOCK_HXX
-#include "Param.hxx"
#include "util/Compiler.h"
#include <string>
diff --git a/src/config/Check.hxx b/src/config/Check.hxx
index 22e21c727..556ce96f4 100644
--- a/src/config/Check.hxx
+++ b/src/config/Check.hxx
@@ -20,9 +20,6 @@
#ifndef MPD_CONFIG_CHECK_HXX
#define MPD_CONFIG_CHECK_HXX
-#include "Option.hxx"
-#include "util/Compiler.h"
-
struct ConfigData;
/**
diff --git a/src/config/Data.hxx b/src/config/Data.hxx
index 0a485748c..2b86735e0 100644
--- a/src/config/Data.hxx
+++ b/src/config/Data.hxx
@@ -28,8 +28,6 @@
#include <chrono>
#include <forward_list>
-struct ConfigParam;
-struct ConfigBlock;
class AllocatedPath;
struct ConfigData {
diff --git a/src/config/Path.cxx b/src/config/Path.cxx
index 2d9b619fe..c3c1671bb 100644
--- a/src/config/Path.cxx
+++ b/src/config/Path.cxx
@@ -21,7 +21,6 @@
#include "Data.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/Traits.hxx"
-#include "fs/Domain.hxx"
#include "fs/StandardDirectory.hxx"
#include "util/RuntimeError.hxx"
diff --git a/src/db/DatabaseGlue.cxx b/src/db/DatabaseGlue.cxx
index faedcb6de..e67b4ae65 100644
--- a/src/db/DatabaseGlue.cxx
+++ b/src/db/DatabaseGlue.cxx
@@ -20,7 +20,6 @@
#include "DatabaseGlue.hxx"
#include "Interface.hxx"
#include "Registry.hxx"
-#include "DatabaseError.hxx"
#include "util/RuntimeError.hxx"
#include "config/Block.hxx"
#include "DatabasePlugin.hxx"
diff --git a/src/db/DatabasePlaylist.cxx b/src/db/DatabasePlaylist.cxx
index 53c9f55f9..19ff73e62 100644
--- a/src/db/DatabasePlaylist.cxx
+++ b/src/db/DatabasePlaylist.cxx
@@ -19,7 +19,6 @@
#include "DatabasePlaylist.hxx"
#include "DatabaseSong.hxx"
-#include "Selection.hxx"
#include "PlaylistFile.hxx"
#include "Interface.hxx"
#include "song/DetachedSong.hxx"
diff --git a/src/db/DatabasePrint.cxx b/src/db/DatabasePrint.cxx
index 1a8567b88..8a63d69f0 100644
--- a/src/db/DatabasePrint.cxx
+++ b/src/db/DatabasePrint.cxx
@@ -21,15 +21,10 @@
#include "Selection.hxx"
#include "SongPrint.hxx"
#include "TimePrint.hxx"
-#include "TagPrint.hxx"
#include "client/Response.hxx"
-#include "protocol/RangeArg.hxx"
#include "Partition.hxx"
-#include "song/DetachedSong.hxx"
-#include "song/Filter.hxx"
#include "song/LightSong.hxx"
#include "tag/Tag.hxx"
-#include "tag/Mask.hxx"
#include "LightDirectory.hxx"
#include "PlaylistInfo.hxx"
#include "Interface.hxx"
diff --git a/src/db/DatabasePrint.hxx b/src/db/DatabasePrint.hxx
index dbfb2a8d9..67e0d264c 100644
--- a/src/db/DatabasePrint.hxx
+++ b/src/db/DatabasePrint.hxx
@@ -24,10 +24,8 @@
template<typename T> struct ConstBuffer;
enum TagType : uint8_t;
-class TagMask;
class SongFilter;
struct DatabaseSelection;
-struct RangeArg;
struct Partition;
class Response;
diff --git a/src/db/DatabaseSong.hxx b/src/db/DatabaseSong.hxx
index 8238eeeb2..a4d41ca9d 100644
--- a/src/db/DatabaseSong.hxx
+++ b/src/db/DatabaseSong.hxx
@@ -20,8 +20,6 @@
#ifndef MPD_DATABASE_SONG_HXX
#define MPD_DATABASE_SONG_HXX
-#include "util/Compiler.h"
-
struct LightSong;
class Database;
class Storage;
diff --git a/src/db/UniqueTags.hxx b/src/db/UniqueTags.hxx
index fb368e206..d2a7eb734 100644
--- a/src/db/UniqueTags.hxx
+++ b/src/db/UniqueTags.hxx
@@ -22,11 +22,8 @@
#include "tag/Type.h"
-#include <map>
-#include <set>
#include <string>
-class TagMask;
class Database;
struct DatabaseSelection;
template<typename Key> class RecursiveMap;
diff --git a/src/db/VHelper.cxx b/src/db/VHelper.cxx
index 97a84ecd7..0ebebbbc1 100644
--- a/src/db/VHelper.cxx
+++ b/src/db/VHelper.cxx
@@ -18,9 +18,12 @@
*/
#include "VHelper.hxx"
+#include "song/DetachedSong.hxx"
#include "song/LightSong.hxx"
#include "song/Filter.hxx"
+#include <algorithm>
+
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/db/VHelper.hxx b/src/db/VHelper.hxx
index 71ddbb012..50b1e3454 100644
--- a/src/db/VHelper.hxx
+++ b/src/db/VHelper.hxx
@@ -22,7 +22,6 @@
#include "Visitor.hxx"
#include "Selection.hxx"
-#include "song/DetachedSong.hxx"
#include <vector>
diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx
index 1c571fd77..fa940f24e 100644
--- a/src/db/plugins/ProxyDatabasePlugin.cxx
+++ b/src/db/plugins/ProxyDatabasePlugin.cxx
@@ -36,7 +36,6 @@
#include "config/Block.hxx"
#include "tag/Builder.hxx"
#include "tag/Tag.hxx"
-#include "tag/Mask.hxx"
#include "tag/ParseName.hxx"
#include "util/ConstBuffer.hxx"
#include "util/RecursiveMap.hxx"
diff --git a/src/db/plugins/simple/DatabaseSave.cxx b/src/db/plugins/simple/DatabaseSave.cxx
index 11248f951..bb36d4812 100644
--- a/src/db/plugins/simple/DatabaseSave.cxx
+++ b/src/db/plugins/simple/DatabaseSave.cxx
@@ -19,7 +19,6 @@
#include "DatabaseSave.hxx"
#include "db/DatabaseLock.hxx"
-#include "Directory.hxx"
#include "DirectorySave.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/TextFile.hxx"
diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.cxx b/src/db/plugins/simple/SimpleDatabasePlugin.cxx
index ebb34ee14..07e2c359e 100644
--- a/src/db/plugins/simple/SimpleDatabasePlugin.cxx
+++ b/src/db/plugins/simple/SimpleDatabasePlugin.cxx
@@ -33,7 +33,6 @@
#include "DatabaseSave.hxx"
#include "db/DatabaseLock.hxx"
#include "db/DatabaseError.hxx"
-#include "tag/Mask.hxx"
#include "fs/io/TextFile.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/FileOutputStream.hxx"
diff --git a/src/db/plugins/upnp/ContentDirectoryService.cxx b/src/db/plugins/upnp/ContentDirectoryService.cxx
index f2eba08bd..8df6eaaa0 100644
--- a/src/db/plugins/upnp/ContentDirectoryService.cxx
+++ b/src/db/plugins/upnp/ContentDirectoryService.cxx
@@ -23,13 +23,10 @@
#include "lib/upnp/Action.hxx"
#include "Directory.hxx"
#include "util/NumberParser.hxx"
-#include "util/UriUtil.hxx"
#include "util/RuntimeError.hxx"
#include "util/ScopeExit.hxx"
#include "util/StringFormat.hxx"
-#include <stdio.h>
-
static void
ReadResultTag(UPnPDirContent &dirbuf, IXML_Document *response)
{
diff --git a/src/db/plugins/upnp/Directory.cxx b/src/db/plugins/upnp/Directory.cxx
index 91f244dd0..0d4865f06 100644
--- a/src/db/plugins/upnp/Directory.cxx
+++ b/src/db/plugins/upnp/Directory.cxx
@@ -18,7 +18,6 @@
*/
#include "Directory.hxx"
-#include "lib/upnp/Util.hxx"
#include "lib/expat/ExpatParser.hxx"
#include "Tags.hxx"
#include "tag/Builder.hxx"
diff --git a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx
index c3fc32e27..6e42bd412 100644
--- a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx
+++ b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx
@@ -34,12 +34,8 @@
#include "song/Filter.hxx"
#include "song/TagSongFilter.hxx"
#include "db/Stats.hxx"
-#include "config/Block.hxx"
-#include "tag/Builder.hxx"
#include "tag/Table.hxx"
-#include "tag/Mask.hxx"
#include "fs/Traits.hxx"
-#include "Log.hxx"
#include "util/ConstBuffer.hxx"
#include "util/RecursiveMap.hxx"
#include "util/SplitString.hxx"
diff --git a/src/db/update/Editor.hxx b/src/db/update/Editor.hxx
index 4b200c63b..4e63d4b17 100644
--- a/src/db/update/Editor.hxx
+++ b/src/db/update/Editor.hxx
@@ -21,7 +21,6 @@
#define MPD_UPDATE_DATABASE_HXX
#include "Remove.hxx"
-#include "util/Compiler.h"
struct Directory;
struct Song;
diff --git a/src/db/update/ExcludeList.cxx b/src/db/update/ExcludeList.cxx
index a93c74ec3..e95b2c7bc 100644
--- a/src/db/update/ExcludeList.cxx
+++ b/src/db/update/ExcludeList.cxx
@@ -27,13 +27,9 @@
#include "fs/NarrowPath.hxx"
#include "input/TextInputStream.hxx"
#include "util/StringStrip.hxx"
-#include "Log.hxx"
#include "config.h"
-#include <exception>
-
#include <assert.h>
-#include <string.h>
#ifdef HAVE_CLASS_GLOB
diff --git a/src/db/update/InotifySource.cxx b/src/db/update/InotifySource.cxx
index 3d851d811..285ce7a34 100644
--- a/src/db/update/InotifySource.cxx
+++ b/src/db/update/InotifySource.cxx
@@ -25,7 +25,6 @@
#include "Log.hxx"
#include <sys/inotify.h>
-#include <unistd.h>
#include <errno.h>
#include <stdint.h>
#include <limits.h>
diff --git a/src/db/update/InotifySource.hxx b/src/db/update/InotifySource.hxx
index 3e19e7a45..51cba9427 100644
--- a/src/db/update/InotifySource.hxx
+++ b/src/db/update/InotifySource.hxx
@@ -21,9 +21,6 @@
#define MPD_INOTIFY_SOURCE_HXX
#include "event/SocketMonitor.hxx"
-#include "util/Compiler.h"
-
-class FileDescriptor;
typedef void (*mpd_inotify_callback_t)(int wd, unsigned mask,
const char *name, void *ctx);
diff --git a/src/db/update/InotifyUpdate.hxx b/src/db/update/InotifyUpdate.hxx
index e9b0eec3c..f6f5aad49 100644
--- a/src/db/update/InotifyUpdate.hxx
+++ b/src/db/update/InotifyUpdate.hxx
@@ -20,8 +20,6 @@
#ifndef MPD_INOTIFY_UPDATE_HXX
#define MPD_INOTIFY_UPDATE_HXX
-#include "util/Compiler.h"
-
class EventLoop;
class Storage;
class UpdateService;
diff --git a/src/db/update/Remove.hxx b/src/db/update/Remove.hxx
index 0035a0b0d..83f8ab9d2 100644
--- a/src/db/update/Remove.hxx
+++ b/src/db/update/Remove.hxx
@@ -22,12 +22,10 @@
#include "event/DeferEvent.hxx"
#include "thread/Mutex.hxx"
-#include "util/Compiler.h"
#include <forward_list>
#include <string>
-struct Song;
class DatabaseListener;
/**
diff --git a/src/db/update/UpdateIO.cxx b/src/db/update/UpdateIO.cxx
index 8f00ae784..d79e50f4a 100644
--- a/src/db/update/UpdateIO.cxx
+++ b/src/db/update/UpdateIO.cxx
@@ -26,8 +26,6 @@
#include "fs/AllocatedPath.hxx"
#include "Log.hxx"
-#include <stdexcept>
-
#include <errno.h>
bool
diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx
index 27d168f29..23db623e5 100644
--- a/src/db/update/Walk.cxx
+++ b/src/db/update/Walk.cxx
@@ -40,7 +40,7 @@
#include "util/UriUtil.hxx"
#include "Log.hxx"
-#include <stdexcept>
+#include <exception>
#include <memory>
#include <assert.h>
diff --git a/src/decoder/DecoderAPI.hxx b/src/decoder/DecoderAPI.hxx
index 33ac82c67..ea8374f93 100644
--- a/src/decoder/DecoderAPI.hxx
+++ b/src/decoder/DecoderAPI.hxx
@@ -44,8 +44,6 @@
#include <stdint.h>
-class DecoderClient;
-
/**
* Throw an instance of this class to stop decoding the current song
* (successfully). It can be used to jump out of all of a decoder's
diff --git a/src/decoder/Reader.hxx b/src/decoder/Reader.hxx
index 4cdc6e50f..4b69f9097 100644
--- a/src/decoder/Reader.hxx
+++ b/src/decoder/Reader.hxx
@@ -21,7 +21,6 @@
#define MPD_DECODER_READER_HXX
#include "fs/io/Reader.hxx"
-#include "util/Compiler.h"
class DecoderClient;
class InputStream;
diff --git a/src/decoder/Thread.cxx b/src/decoder/Thread.cxx
index dd439b925..a37090ffe 100644
--- a/src/decoder/Thread.cxx
+++ b/src/decoder/Thread.cxx
@@ -35,7 +35,6 @@
#include "util/RuntimeError.hxx"
#include "util/Domain.hxx"
#include "util/ScopeExit.hxx"
-#include "util/StringCompare.hxx"
#include "thread/Name.hxx"
#include "tag/ApeReplayGain.hxx"
#include "Log.hxx"
diff --git a/src/decoder/plugins/DsdLib.cxx b/src/decoder/plugins/DsdLib.cxx
index 90adca1dc..97750e9a1 100644
--- a/src/decoder/plugins/DsdLib.cxx
+++ b/src/decoder/plugins/DsdLib.cxx
@@ -33,8 +33,6 @@
#include <id3tag.h>
#endif
-#include <stdexcept>
-
#include <string.h>
#include <stdlib.h>
diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
index 73d5a35cf..f7d925046 100644
--- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
@@ -36,7 +36,6 @@
#include "util/StringView.hxx"
#include "tag/Handler.hxx"
#include "DsdLib.hxx"
-#include "Log.hxx"
struct DsdiffHeader {
DsdId id;
diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx
index 8129f7365..9a1b04cbb 100644
--- a/src/decoder/plugins/DsfDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsfDecoderPlugin.cxx
@@ -36,7 +36,6 @@
#include "util/ByteOrder.hxx"
#include "DsdLib.hxx"
#include "tag/Handler.hxx"
-#include "Log.hxx"
#include <string.h>
diff --git a/src/decoder/plugins/FaadDecoderPlugin.cxx b/src/decoder/plugins/FaadDecoderPlugin.cxx
index 906c8eb50..408d38d0e 100644
--- a/src/decoder/plugins/FaadDecoderPlugin.cxx
+++ b/src/decoder/plugins/FaadDecoderPlugin.cxx
@@ -31,7 +31,6 @@
#include <neaacdec.h>
#include <cmath>
-#include <exception>
#include <assert.h>
#include <string.h>
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 1d11d9d9a..e6066afa7 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -24,7 +24,6 @@
#include "FfmpegDecoderPlugin.hxx"
#include "lib/ffmpeg/Domain.hxx"
#include "lib/ffmpeg/Error.hxx"
-#include "lib/ffmpeg/LogError.hxx"
#include "lib/ffmpeg/Init.hxx"
#include "lib/ffmpeg/Buffer.hxx"
#include "lib/ffmpeg/Frame.hxx"
diff --git a/src/decoder/plugins/FfmpegIo.cxx b/src/decoder/plugins/FfmpegIo.cxx
index 0e8d96312..fc4dc2ded 100644
--- a/src/decoder/plugins/FfmpegIo.cxx
+++ b/src/decoder/plugins/FfmpegIo.cxx
@@ -24,8 +24,6 @@
#include "../DecoderAPI.hxx"
#include "input/InputStream.hxx"
-#include <exception>
-
AvioStream::~AvioStream()
{
if (io != nullptr) {
diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx
index 17af15a23..1c4ae017c 100644
--- a/src/decoder/plugins/MadDecoderPlugin.cxx
+++ b/src/decoder/plugins/MadDecoderPlugin.cxx
@@ -21,10 +21,8 @@
#include "MadDecoderPlugin.hxx"
#include "../DecoderAPI.hxx"
#include "input/InputStream.hxx"
-#include "config/Block.hxx"
#include "tag/Id3Scan.hxx"
#include "tag/Id3ReplayGain.hxx"
-#include "tag/Rva2.hxx"
#include "tag/Handler.hxx"
#include "tag/ReplayGain.hxx"
#include "tag/MixRamp.hxx"
@@ -40,8 +38,6 @@
#include <id3tag.h>
#endif
-#include <stdexcept>
-
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/decoder/plugins/MpcdecDecoderPlugin.cxx b/src/decoder/plugins/MpcdecDecoderPlugin.cxx
index 7094179b6..42f965bd9 100644
--- a/src/decoder/plugins/MpcdecDecoderPlugin.cxx
+++ b/src/decoder/plugins/MpcdecDecoderPlugin.cxx
@@ -31,8 +31,6 @@
#include <mpc/mpcdec.h>
-#include <exception>
-
#include <math.h>
struct mpc_decoder_data {
diff --git a/src/decoder/plugins/OggDecoder.cxx b/src/decoder/plugins/OggDecoder.cxx
index 606fdb856..abf153419 100644
--- a/src/decoder/plugins/OggDecoder.cxx
+++ b/src/decoder/plugins/OggDecoder.cxx
@@ -21,8 +21,6 @@
#include "lib/xiph/OggFind.hxx"
#include "input/InputStream.hxx"
-#include <exception>
-
/**
* Load the end-of-stream packet and restore the previous file
* position.
diff --git a/src/decoder/plugins/OpusTags.cxx b/src/decoder/plugins/OpusTags.cxx
index c9b462dba..d0daf4c70 100644
--- a/src/decoder/plugins/OpusTags.cxx
+++ b/src/decoder/plugins/OpusTags.cxx
@@ -26,8 +26,6 @@
#include "util/NumberParser.hxx"
#include "util/StringView.hxx"
-#include <string>
-
#include <stdint.h>
gcc_pure
diff --git a/src/decoder/plugins/PcmDecoderPlugin.cxx b/src/decoder/plugins/PcmDecoderPlugin.cxx
index 01dfb5db6..fb3454bc8 100644
--- a/src/decoder/plugins/PcmDecoderPlugin.cxx
+++ b/src/decoder/plugins/PcmDecoderPlugin.cxx
@@ -38,7 +38,6 @@
#include <exception>
-#include <assert.h>
#include <string.h>
static constexpr Domain pcm_decoder_domain("pcm_decoder");
diff --git a/src/decoder/plugins/WavpackDecoderPlugin.cxx b/src/decoder/plugins/WavpackDecoderPlugin.cxx
index b0004d4ac..4f5657220 100644
--- a/src/decoder/plugins/WavpackDecoderPlugin.cxx
+++ b/src/decoder/plugins/WavpackDecoderPlugin.cxx
@@ -31,7 +31,7 @@
#include <wavpack/wavpack.h>
-#include <stdexcept>
+#include <algorithm>
#include <memory>
#include <cstdlib>
diff --git a/src/decoder/plugins/WildmidiDecoderPlugin.cxx b/src/decoder/plugins/WildmidiDecoderPlugin.cxx
index 021ac4eb1..15af3384f 100644
--- a/src/decoder/plugins/WildmidiDecoderPlugin.cxx
+++ b/src/decoder/plugins/WildmidiDecoderPlugin.cxx
@@ -25,7 +25,6 @@
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
#include "fs/Path.hxx"
-#include "Log.hxx"
#include "PluginUnavailable.hxx"
extern "C" {
diff --git a/src/encoder/plugins/FlacEncoderPlugin.cxx b/src/encoder/plugins/FlacEncoderPlugin.cxx
index c42b6df50..0da621afd 100644
--- a/src/encoder/plugins/FlacEncoderPlugin.cxx
+++ b/src/encoder/plugins/FlacEncoderPlugin.cxx
@@ -21,7 +21,6 @@
#include "../EncoderAPI.hxx"
#include "AudioFormat.hxx"
#include "pcm/Buffer.hxx"
-#include "config/Domain.hxx"
#include "util/DynamicFifoBuffer.hxx"
#include "util/RuntimeError.hxx"
diff --git a/src/encoder/plugins/LameEncoderPlugin.cxx b/src/encoder/plugins/LameEncoderPlugin.cxx
index 8bbab6504..18ae61dab 100644
--- a/src/encoder/plugins/LameEncoderPlugin.cxx
+++ b/src/encoder/plugins/LameEncoderPlugin.cxx
@@ -20,7 +20,6 @@
#include "LameEncoderPlugin.hxx"
#include "../EncoderAPI.hxx"
#include "AudioFormat.hxx"
-#include "config/Domain.hxx"
#include "util/NumberParser.hxx"
#include "util/ReusableArray.hxx"
#include "util/RuntimeError.hxx"
diff --git a/src/encoder/plugins/OpusEncoderPlugin.cxx b/src/encoder/plugins/OpusEncoderPlugin.cxx
index 472f954f2..fd70c5747 100644
--- a/src/encoder/plugins/OpusEncoderPlugin.cxx
+++ b/src/encoder/plugins/OpusEncoderPlugin.cxx
@@ -20,7 +20,6 @@
#include "OpusEncoderPlugin.hxx"
#include "OggEncoder.hxx"
#include "AudioFormat.hxx"
-#include "config/Domain.hxx"
#include "util/ByteOrder.hxx"
#include "util/StringUtil.hxx"
diff --git a/src/encoder/plugins/ShineEncoderPlugin.cxx b/src/encoder/plugins/ShineEncoderPlugin.cxx
index eaf9d48fd..b13755ddd 100644
--- a/src/encoder/plugins/ShineEncoderPlugin.cxx
+++ b/src/encoder/plugins/ShineEncoderPlugin.cxx
@@ -20,7 +20,6 @@
#include "ShineEncoderPlugin.hxx"
#include "../EncoderAPI.hxx"
#include "AudioFormat.hxx"
-#include "config/Domain.hxx"
#include "util/DynamicFifoBuffer.hxx"
#include "util/RuntimeError.hxx"
diff --git a/src/encoder/plugins/TwolameEncoderPlugin.cxx b/src/encoder/plugins/TwolameEncoderPlugin.cxx
index 496c6f79a..1e2ec18b1 100644
--- a/src/encoder/plugins/TwolameEncoderPlugin.cxx
+++ b/src/encoder/plugins/TwolameEncoderPlugin.cxx
@@ -20,7 +20,6 @@
#include "TwolameEncoderPlugin.hxx"
#include "../EncoderAPI.hxx"
#include "AudioFormat.hxx"
-#include "config/Domain.hxx"
#include "util/NumberParser.hxx"
#include "util/RuntimeError.hxx"
#include "util/Domain.hxx"
diff --git a/src/event/BufferedSocket.cxx b/src/event/BufferedSocket.cxx
index c4ac37193..ef3b414e5 100644
--- a/src/event/BufferedSocket.cxx
+++ b/src/event/BufferedSocket.cxx
@@ -21,7 +21,7 @@
#include "net/SocketError.hxx"
#include "util/Compiler.h"
-#include <algorithm>
+#include <stdexcept>
BufferedSocket::ssize_t
BufferedSocket::DirectRead(void *data, size_t length) noexcept
diff --git a/src/event/Call.cxx b/src/event/Call.cxx
index 0f6414360..c2630eabd 100644
--- a/src/event/Call.cxx
+++ b/src/event/Call.cxx
@@ -22,7 +22,6 @@
#include "DeferEvent.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
-#include "util/Compiler.h"
#include <exception>
diff --git a/src/event/MultiSocketMonitor.hxx b/src/event/MultiSocketMonitor.hxx
index 0118c4a96..d8f4ac635 100644
--- a/src/event/MultiSocketMonitor.hxx
+++ b/src/event/MultiSocketMonitor.hxx
@@ -23,7 +23,6 @@
#include "IdleMonitor.hxx"
#include "TimerEvent.hxx"
#include "SocketMonitor.hxx"
-#include "util/Compiler.h"
#include <forward_list>
#include <iterator>
diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx
index 7a0ef0a09..301760f65 100644
--- a/src/event/ServerSocket.cxx
+++ b/src/event/ServerSocket.cxx
@@ -23,7 +23,6 @@
#include "net/IPv6Address.hxx"
#include "net/StaticSocketAddress.hxx"
#include "net/AllocatedSocketAddress.hxx"
-#include "net/SocketAddress.hxx"
#include "net/SocketUtil.hxx"
#include "net/SocketError.hxx"
#include "net/UniqueSocketDescriptor.hxx"
@@ -37,7 +36,7 @@
#include "Log.hxx"
#include <string>
-#include <algorithm>
+#include <utility>
#include <assert.h>
diff --git a/src/event/SocketMonitor.cxx b/src/event/SocketMonitor.cxx
index 995d4b888..76f550094 100644
--- a/src/event/SocketMonitor.cxx
+++ b/src/event/SocketMonitor.cxx
@@ -20,13 +20,9 @@
#include "SocketMonitor.hxx"
#include "Loop.hxx"
-#include <assert.h>
+#include <utility>
-#ifdef _WIN32
-#include <winsock2.h>
-#else
-#include <sys/socket.h>
-#endif
+#include <assert.h>
void
SocketMonitor::Dispatch(unsigned flags) noexcept
diff --git a/src/filter/plugins/AutoConvertFilterPlugin.cxx b/src/filter/plugins/AutoConvertFilterPlugin.cxx
index 239814a9f..4c54ff3a9 100644
--- a/src/filter/plugins/AutoConvertFilterPlugin.cxx
+++ b/src/filter/plugins/AutoConvertFilterPlugin.cxx
@@ -19,7 +19,6 @@
#include "AutoConvertFilterPlugin.hxx"
#include "ConvertFilterPlugin.hxx"
-#include "filter/FilterPlugin.hxx"
#include "filter/Filter.hxx"
#include "filter/Prepared.hxx"
#include "AudioFormat.hxx"
diff --git a/src/filter/plugins/ConvertFilterPlugin.cxx b/src/filter/plugins/ConvertFilterPlugin.cxx
index dd66838c6..417e3acc7 100644
--- a/src/filter/plugins/ConvertFilterPlugin.cxx
+++ b/src/filter/plugins/ConvertFilterPlugin.cxx
@@ -21,11 +21,9 @@
#include "filter/Filter.hxx"
#include "filter/Prepared.hxx"
#include "pcm/Convert.hxx"
-#include "util/Manual.hxx"
#include "util/ConstBuffer.hxx"
#include "AudioFormat.hxx"
-#include <stdexcept>
#include <memory>
#include <assert.h>
diff --git a/src/filter/plugins/FfmpegFilterPlugin.cxx b/src/filter/plugins/FfmpegFilterPlugin.cxx
index 6efca1398..6206d8991 100644
--- a/src/filter/plugins/FfmpegFilterPlugin.cxx
+++ b/src/filter/plugins/FfmpegFilterPlugin.cxx
@@ -22,10 +22,8 @@
#include "filter/FilterPlugin.hxx"
#include "filter/Filter.hxx"
#include "filter/Prepared.hxx"
-#include "filter/FilterRegistry.hxx"
#include "lib/ffmpeg/Filter.hxx"
#include "config/Block.hxx"
-#include "AudioFormat.hxx"
class PreparedFfmpegFilter final : public PreparedFilter {
const char *const graph_string;
diff --git a/src/filter/plugins/NullFilterPlugin.cxx b/src/filter/plugins/NullFilterPlugin.cxx
index b88e3771d..c73820197 100644
--- a/src/filter/plugins/NullFilterPlugin.cxx
+++ b/src/filter/plugins/NullFilterPlugin.cxx
@@ -28,7 +28,6 @@
#include "filter/FilterPlugin.hxx"
#include "filter/NullFilter.hxx"
#include "filter/Prepared.hxx"
-#include "AudioFormat.hxx"
#include "util/Compiler.h"
class PreparedNullFilter final : public PreparedFilter {
diff --git a/src/filter/plugins/RouteFilterPlugin.cxx b/src/filter/plugins/RouteFilterPlugin.cxx
index 159bc053b..e7f3f32cf 100644
--- a/src/filter/plugins/RouteFilterPlugin.cxx
+++ b/src/filter/plugins/RouteFilterPlugin.cxx
@@ -40,7 +40,6 @@
*/
#include "RouteFilterPlugin.hxx"
-#include "config/Domain.hxx"
#include "config/Block.hxx"
#include "AudioFormat.hxx"
#include "filter/FilterPlugin.hxx"
@@ -53,8 +52,8 @@
#include "util/ConstBuffer.hxx"
#include "util/WritableBuffer.hxx"
-#include <algorithm>
#include <array>
+#include <stdexcept>
#include <string.h>
#include <stdint.h>
diff --git a/src/filter/plugins/VolumeFilterPlugin.cxx b/src/filter/plugins/VolumeFilterPlugin.cxx
index f9064ae31..d10f5d1b4 100644
--- a/src/filter/plugins/VolumeFilterPlugin.cxx
+++ b/src/filter/plugins/VolumeFilterPlugin.cxx
@@ -24,8 +24,6 @@
#include "AudioFormat.hxx"
#include "util/ConstBuffer.hxx"
-#include <stdexcept>
-
class VolumeFilter final : public Filter {
PcmVolume pv;
diff --git a/src/fs/AllocatedPath.cxx b/src/fs/AllocatedPath.cxx
index e199d6728..87d349bee 100644
--- a/src/fs/AllocatedPath.cxx
+++ b/src/fs/AllocatedPath.cxx
@@ -18,13 +18,8 @@
*/
#include "AllocatedPath.hxx"
-#include "Domain.hxx"
#include "Charset.hxx"
#include "Features.hxx"
-#include "util/Compiler.h"
-#include "config.h"
-
-#include <exception>
/* no inlining, please */
AllocatedPath::~AllocatedPath() noexcept = default;
diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx
index 799b883c4..d38c37468 100644
--- a/src/fs/Charset.cxx
+++ b/src/fs/Charset.cxx
@@ -31,7 +31,6 @@
#endif
#include <algorithm>
-#include <stdexcept>
#include <assert.h>
#include <string.h>
diff --git a/src/fs/CheckFile.cxx b/src/fs/CheckFile.cxx
index a7b1e157a..6169e3c65 100644
--- a/src/fs/CheckFile.cxx
+++ b/src/fs/CheckFile.cxx
@@ -26,8 +26,6 @@
#include "DirectoryReader.hxx"
#include "system/Error.hxx"
-#include <errno.h>
-
void
CheckDirectoryReadable(Path path_fs)
try {
diff --git a/src/fs/io/GunzipReader.hxx b/src/fs/io/GunzipReader.hxx
index 784b0c421..775ab399a 100644
--- a/src/fs/io/GunzipReader.hxx
+++ b/src/fs/io/GunzipReader.hxx
@@ -22,7 +22,6 @@
#include "Reader.hxx"
#include "util/StaticFifoBuffer.hxx"
-#include "util/Compiler.h"
#include <zlib.h>
diff --git a/src/fs/io/GzipOutputStream.hxx b/src/fs/io/GzipOutputStream.hxx
index bfbeebdbd..d141f30ff 100644
--- a/src/fs/io/GzipOutputStream.hxx
+++ b/src/fs/io/GzipOutputStream.hxx
@@ -31,7 +31,6 @@
#define GZIP_OUTPUT_STREAM_HXX
#include "OutputStream.hxx"
-#include "util/Compiler.h"
#include <zlib.h>
diff --git a/src/fs/io/PeekReader.hxx b/src/fs/io/PeekReader.hxx
index 8c4cb4945..850fcfa89 100644
--- a/src/fs/io/PeekReader.hxx
+++ b/src/fs/io/PeekReader.hxx
@@ -21,7 +21,6 @@
#define MPD_PEEK_READER_HXX
#include "Reader.hxx"
-#include "util/Compiler.h"
#include <stdint.h>
diff --git a/src/fs/io/TextFile.hxx b/src/fs/io/TextFile.hxx
index ca956e028..d07b1c454 100644
--- a/src/fs/io/TextFile.hxx
+++ b/src/fs/io/TextFile.hxx
@@ -20,7 +20,6 @@
#ifndef MPD_TEXT_FILE_HXX
#define MPD_TEXT_FILE_HXX
-#include "util/Compiler.h"
#include "config.h"
#include <memory>
diff --git a/src/input/BufferedInputStream.cxx b/src/input/BufferedInputStream.cxx
index d5896e6a4..67fef0617 100644
--- a/src/input/BufferedInputStream.cxx
+++ b/src/input/BufferedInputStream.cxx
@@ -18,8 +18,6 @@
*/
#include "BufferedInputStream.hxx"
-#include "thread/Cond.hxx"
-#include "thread/Name.hxx"
#include <string.h>
diff --git a/src/input/BufferingInputStream.cxx b/src/input/BufferingInputStream.cxx
index 9bdb91b49..bcfdce7fd 100644
--- a/src/input/BufferingInputStream.cxx
+++ b/src/input/BufferingInputStream.cxx
@@ -18,7 +18,7 @@
*/
#include "BufferingInputStream.hxx"
-#include "thread/Cond.hxx"
+#include "InputStream.hxx"
#include "thread/Name.hxx"
#include <string.h>
diff --git a/src/input/BufferingInputStream.hxx b/src/input/BufferingInputStream.hxx
index 84277b07a..eee98401d 100644
--- a/src/input/BufferingInputStream.hxx
+++ b/src/input/BufferingInputStream.hxx
@@ -20,10 +20,10 @@
#ifndef MPD_BUFFERING_INPUT_STREAM_BUFFER_HXX
#define MPD_BUFFERING_INPUT_STREAM_BUFFER_HXX
-#include "InputStream.hxx"
#include "Ptr.hxx"
#include "Handler.hxx"
#include "thread/Thread.hxx"
+#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "util/SparseBuffer.hxx"
diff --git a/src/input/ProxyInputStream.cxx b/src/input/ProxyInputStream.cxx
index 49846685d..fc38a4459 100644
--- a/src/input/ProxyInputStream.cxx
+++ b/src/input/ProxyInputStream.cxx
@@ -20,7 +20,7 @@
#include "ProxyInputStream.hxx"
#include "tag/Tag.hxx"
-#include <stdexcept>
+#include <utility>
ProxyInputStream::ProxyInputStream(InputStreamPtr _input) noexcept
:InputStream(_input->GetURI(), _input->mutex),
diff --git a/src/input/Reader.hxx b/src/input/Reader.hxx
index b8a160e82..dea62891c 100644
--- a/src/input/Reader.hxx
+++ b/src/input/Reader.hxx
@@ -21,9 +21,7 @@
#define MPD_INPUT_READER_HXX
#include "fs/io/Reader.hxx"
-#include "util/Compiler.h"
-struct Decoder;
class InputStream;
/**
diff --git a/src/input/TextInputStream.cxx b/src/input/TextInputStream.cxx
index c2a16c6ed..1baaa7fb3 100644
--- a/src/input/TextInputStream.cxx
+++ b/src/input/TextInputStream.cxx
@@ -20,9 +20,6 @@
#include "TextInputStream.hxx"
#include "InputStream.hxx"
#include "util/TextFile.hxx"
-#include "Log.hxx"
-
-#include <stdexcept>
#include <assert.h>
diff --git a/src/input/cache/Item.cxx b/src/input/cache/Item.cxx
index 5decaaced..9faefe062 100644
--- a/src/input/cache/Item.cxx
+++ b/src/input/cache/Item.cxx
@@ -19,6 +19,7 @@
#include "Item.hxx"
#include "Lease.hxx"
+#include "input/InputStream.hxx"
#include <assert.h>
diff --git a/src/input/cache/Item.hxx b/src/input/cache/Item.hxx
index 53b9668a1..5fb11aeac 100644
--- a/src/input/cache/Item.hxx
+++ b/src/input/cache/Item.hxx
@@ -22,12 +22,10 @@
#include "input/BufferingInputStream.hxx"
#include "thread/Mutex.hxx"
-#include "util/SparseBuffer.hxx"
#include <boost/intrusive/list.hpp>
#include <boost/intrusive/set_hook.hpp>
-#include <memory>
#include <string>
class InputCacheLease;
diff --git a/src/input/cache/Manager.hxx b/src/input/cache/Manager.hxx
index 6fba1fbb3..267d1bdce 100644
--- a/src/input/cache/Manager.hxx
+++ b/src/input/cache/Manager.hxx
@@ -20,7 +20,6 @@
#ifndef MPD_INPUT_CACHE_MANAGER_HXX
#define MPD_INPUT_CACHE_MANAGER_HXX
-#include "input/Offset.hxx"
#include "thread/Mutex.hxx"
#include "util/Compiler.h"
diff --git a/src/input/plugins/AlsaInputPlugin.cxx b/src/input/plugins/AlsaInputPlugin.cxx
index 552fe8fd0..9a88c4aa1 100644
--- a/src/input/plugins/AlsaInputPlugin.cxx
+++ b/src/input/plugins/AlsaInputPlugin.cxx
@@ -30,11 +30,9 @@
#include "../InputPlugin.hxx"
#include "../AsyncInputStream.hxx"
#include "event/Call.hxx"
-#include "thread/Cond.hxx"
#include "config/Block.hxx"
#include "util/Domain.hxx"
#include "util/RuntimeError.hxx"
-#include "util/StringCompare.hxx"
#include "util/ASCII.hxx"
#include "util/DivideString.hxx"
#include "AudioParser.hxx"
diff --git a/src/input/plugins/CdioParanoiaInputPlugin.cxx b/src/input/plugins/CdioParanoiaInputPlugin.cxx
index 166feb935..f7b3687ef 100644
--- a/src/input/plugins/CdioParanoiaInputPlugin.cxx
+++ b/src/input/plugins/CdioParanoiaInputPlugin.cxx
@@ -21,7 +21,6 @@
* CD-Audio handling (requires libcdio_paranoia)
*/
-#include "config.h"
#include "CdioParanoiaInputPlugin.hxx"
#include "lib/cdio/Paranoia.hxx"
#include "../InputStream.hxx"
@@ -34,7 +33,6 @@
#include "fs/AllocatedPath.hxx"
#include "Log.hxx"
#include "config/Block.hxx"
-#include "config/Domain.hxx"
#include <stdio.h>
#include <stdint.h>
diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx
index f43da9a84..21d83c1d9 100644
--- a/src/input/plugins/CurlInputPlugin.cxx
+++ b/src/input/plugins/CurlInputPlugin.cxx
@@ -19,7 +19,6 @@
#include "CurlInputPlugin.hxx"
#include "lib/curl/Error.hxx"
-#include "lib/curl/Easy.hxx"
#include "lib/curl/Global.hxx"
#include "lib/curl/Init.hxx"
#include "lib/curl/Request.hxx"
@@ -36,10 +35,8 @@
#include "event/Call.hxx"
#include "event/Loop.hxx"
#include "util/ASCII.hxx"
-#include "util/StringUtil.hxx"
#include "util/StringFormat.hxx"
#include "util/NumberParser.hxx"
-#include "util/RuntimeError.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
#include "PluginUnavailable.hxx"
diff --git a/src/input/plugins/FfmpegInputPlugin.cxx b/src/input/plugins/FfmpegInputPlugin.cxx
index e3ef77fc3..c8847e223 100644
--- a/src/input/plugins/FfmpegInputPlugin.cxx
+++ b/src/input/plugins/FfmpegInputPlugin.cxx
@@ -23,15 +23,9 @@
#include "FfmpegInputPlugin.hxx"
#include "lib/ffmpeg/IOContext.hxx"
#include "lib/ffmpeg/Init.hxx"
-#include "lib/ffmpeg/Error.hxx"
#include "../InputStream.hxx"
#include "PluginUnavailable.hxx"
-#include "util/StringAPI.hxx"
#include "../InputPlugin.hxx"
-#include <iostream>
-#include <exception>
-#include <typeinfo>
-#include <stdexcept>
class FfmpegInputStream final : public InputStream {
Ffmpeg::IOContext io;
@@ -90,7 +84,7 @@ input_ffmpeg_protocols() {
protocols.emplace(schema);
}
}
-
+
return protocols;
}
diff --git a/src/input/plugins/FileInputPlugin.cxx b/src/input/plugins/FileInputPlugin.cxx
index 95ac60de0..2464866aa 100644
--- a/src/input/plugins/FileInputPlugin.cxx
+++ b/src/input/plugins/FileInputPlugin.cxx
@@ -19,7 +19,6 @@
#include "FileInputPlugin.hxx"
#include "../InputStream.hxx"
-#include "../InputPlugin.hxx"
#include "fs/Path.hxx"
#include "fs/FileInfo.hxx"
#include "fs/io/FileReader.hxx"
diff --git a/src/input/plugins/MmsInputPlugin.cxx b/src/input/plugins/MmsInputPlugin.cxx
index 11e2c98c4..7312dec5f 100644
--- a/src/input/plugins/MmsInputPlugin.cxx
+++ b/src/input/plugins/MmsInputPlugin.cxx
@@ -21,7 +21,6 @@
#include "input/ThreadInputStream.hxx"
#include "input/InputPlugin.hxx"
#include "system/Error.hxx"
-#include "util/ASCII.hxx"
#include <libmms/mmsx.h>
diff --git a/src/input/plugins/NfsInputPlugin.cxx b/src/input/plugins/NfsInputPlugin.cxx
index 9ab91397f..f710cce84 100644
--- a/src/input/plugins/NfsInputPlugin.cxx
+++ b/src/input/plugins/NfsInputPlugin.cxx
@@ -22,7 +22,6 @@
#include "../InputPlugin.hxx"
#include "lib/nfs/Glue.hxx"
#include "lib/nfs/FileReader.hxx"
-#include "util/ASCII.hxx"
/**
* Do not buffer more than this number of bytes. It should be a
diff --git a/src/input/plugins/QobuzInputPlugin.cxx b/src/input/plugins/QobuzInputPlugin.cxx
index 8053f5638..cf53ec15c 100644
--- a/src/input/plugins/QobuzInputPlugin.cxx
+++ b/src/input/plugins/QobuzInputPlugin.cxx
@@ -31,11 +31,8 @@
#include "thread/Mutex.hxx"
#include "util/StringCompare.hxx"
-#include <stdexcept>
#include <memory>
-#include <time.h>
-
static QobuzClient *qobuz_client;
class QobuzInputStream final
diff --git a/src/input/plugins/QobuzLoginRequest.cxx b/src/input/plugins/QobuzLoginRequest.cxx
index 84feee59a..0e3dac385 100644
--- a/src/input/plugins/QobuzLoginRequest.cxx
+++ b/src/input/plugins/QobuzLoginRequest.cxx
@@ -22,7 +22,6 @@
#include "QobuzSession.hxx"
#include "lib/curl/Form.hxx"
#include "lib/yajl/Callbacks.hxx"
-#include "util/RuntimeError.hxx"
using Wrapper = Yajl::CallbacksWrapper<QobuzLoginRequest::ResponseParser>;
static constexpr yajl_callbacks parse_callbacks = {
diff --git a/src/input/plugins/QobuzTrackRequest.cxx b/src/input/plugins/QobuzTrackRequest.cxx
index ec132d73c..634ab6f38 100644
--- a/src/input/plugins/QobuzTrackRequest.cxx
+++ b/src/input/plugins/QobuzTrackRequest.cxx
@@ -21,7 +21,6 @@
#include "QobuzErrorParser.hxx"
#include "QobuzClient.hxx"
#include "lib/yajl/Callbacks.hxx"
-#include "util/RuntimeError.hxx"
using Wrapper = Yajl::CallbacksWrapper<QobuzTrackRequest::ResponseParser>;
static constexpr yajl_callbacks parse_callbacks = {
diff --git a/src/input/plugins/SmbclientInputPlugin.cxx b/src/input/plugins/SmbclientInputPlugin.cxx
index 7a20820ad..06a96a478 100644
--- a/src/input/plugins/SmbclientInputPlugin.cxx
+++ b/src/input/plugins/SmbclientInputPlugin.cxx
@@ -25,7 +25,6 @@
#include "../MaybeBufferedInputStream.hxx"
#include "PluginUnavailable.hxx"
#include "system/Error.hxx"
-#include "util/ASCII.hxx"
#include <libsmbclient.h>
diff --git a/src/input/plugins/TidalInputPlugin.cxx b/src/input/plugins/TidalInputPlugin.cxx
index c2c89af4f..9501301a9 100644
--- a/src/input/plugins/TidalInputPlugin.cxx
+++ b/src/input/plugins/TidalInputPlugin.cxx
@@ -34,7 +34,6 @@
#include "util/StringCompare.hxx"
#include "Log.hxx"
-#include <stdexcept>
#include <memory>
static constexpr Domain tidal_domain("tidal");
diff --git a/src/input/plugins/TidalSessionManager.cxx b/src/input/plugins/TidalSessionManager.cxx
index 7b2b61b32..a11a64802 100644
--- a/src/input/plugins/TidalSessionManager.cxx
+++ b/src/input/plugins/TidalSessionManager.cxx
@@ -18,7 +18,6 @@
*/
#include "TidalSessionManager.hxx"
-#include "lib/curl/Global.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
diff --git a/src/input/plugins/TidalSessionManager.hxx b/src/input/plugins/TidalSessionManager.hxx
index 8af20b4aa..c3dd1f40f 100644
--- a/src/input/plugins/TidalSessionManager.hxx
+++ b/src/input/plugins/TidalSessionManager.hxx
@@ -30,9 +30,6 @@
#include <memory>
#include <string>
-class CurlRequest;
-class TidalLoginRequest;
-
/**
* Callback class for #TidalSessionManager.
*
diff --git a/src/lib/alsa/Version.cxx b/src/lib/alsa/Version.cxx
index 97915a8ab..0fa1436ac 100644
--- a/src/lib/alsa/Version.cxx
+++ b/src/lib/alsa/Version.cxx
@@ -21,6 +21,8 @@
#include <alsa/asoundlib.h>
+#include <stdlib.h>
+
gcc_pure
static uint_least32_t
ParseAlsaVersion(const char *p) noexcept
diff --git a/src/lib/curl/Init.cxx b/src/lib/curl/Init.cxx
index 31b9b6744..9c7af46eb 100644
--- a/src/lib/curl/Init.cxx
+++ b/src/lib/curl/Init.cxx
@@ -32,8 +32,6 @@
#include "event/Call.hxx"
#include "thread/Mutex.hxx"
-#include <atomic>
-
#include <assert.h>
Mutex CurlInit::mutex;
diff --git a/src/lib/dbus/Connection.hxx b/src/lib/dbus/Connection.hxx
index b42b9d582..135272da7 100644
--- a/src/lib/dbus/Connection.hxx
+++ b/src/lib/dbus/Connection.hxx
@@ -35,8 +35,7 @@
#include <dbus/dbus.h>
-#include <algorithm>
-#include <stdexcept>
+#include <utility>
namespace ODBus {
diff --git a/src/lib/dbus/Message.hxx b/src/lib/dbus/Message.hxx
index f759ddac9..545abf2a1 100644
--- a/src/lib/dbus/Message.hxx
+++ b/src/lib/dbus/Message.hxx
@@ -35,8 +35,8 @@
#include <dbus/dbus.h>
-#include <algorithm>
#include <stdexcept>
+#include <utility>
namespace ODBus {
diff --git a/src/lib/dbus/Watch.hxx b/src/lib/dbus/Watch.hxx
index 87fbf5217..351ce46f9 100644
--- a/src/lib/dbus/Watch.hxx
+++ b/src/lib/dbus/Watch.hxx
@@ -36,7 +36,6 @@
#include "Connection.hxx"
#include "event/SocketMonitor.hxx"
#include "event/DeferEvent.hxx"
-#include "util/Compiler.h"
#include <dbus/dbus.h>
diff --git a/src/lib/ffmpeg/Init.cxx b/src/lib/ffmpeg/Init.cxx
index 3dda4ce38..8daf6d254 100644
--- a/src/lib/ffmpeg/Init.cxx
+++ b/src/lib/ffmpeg/Init.cxx
@@ -37,4 +37,3 @@ FfmpegInit()
av_register_all();
#endif
}
-
diff --git a/src/lib/ffmpeg/LogCallback.cxx b/src/lib/ffmpeg/LogCallback.cxx
index d248b0712..46a673d69 100644
--- a/src/lib/ffmpeg/LogCallback.cxx
+++ b/src/lib/ffmpeg/LogCallback.cxx
@@ -30,8 +30,6 @@ extern "C" {
#include <libavutil/log.h>
}
-#include <stdio.h>
-
gcc_const
static LogLevel
FfmpegImportLogLevel(int level) noexcept
diff --git a/src/lib/gcrypt/MD5.cxx b/src/lib/gcrypt/MD5.cxx
index e31fa67a8..09508a060 100644
--- a/src/lib/gcrypt/MD5.cxx
+++ b/src/lib/gcrypt/MD5.cxx
@@ -31,8 +31,6 @@
#include "Hash.hxx"
#include "util/HexFormat.hxx"
-#include <stdio.h>
-
std::array<uint8_t, 16>
MD5(ConstBuffer<void> input) noexcept
{
diff --git a/src/lib/nfs/Connection.hxx b/src/lib/nfs/Connection.hxx
index c31b53e19..d135eef1f 100644
--- a/src/lib/nfs/Connection.hxx
+++ b/src/lib/nfs/Connection.hxx
@@ -24,6 +24,7 @@
#include "event/SocketMonitor.hxx"
#include "event/TimerEvent.hxx"
#include "event/DeferEvent.hxx"
+#include "util/Compiler.h"
#include <string>
#include <list>
diff --git a/src/lib/pcre/UniqueRegex.hxx b/src/lib/pcre/UniqueRegex.hxx
index 3be166f18..0d513bd86 100644
--- a/src/lib/pcre/UniqueRegex.hxx
+++ b/src/lib/pcre/UniqueRegex.hxx
@@ -34,9 +34,8 @@
#define UNIQUE_REGEX_HXX
#include "RegexPointer.hxx"
-#include "util/StringView.hxx"
-#include <algorithm>
+#include <utility>
#include <pcre.h>
diff --git a/src/lib/sqlite/Util.hxx b/src/lib/sqlite/Util.hxx
index 61745479b..06907f2e6 100644
--- a/src/lib/sqlite/Util.hxx
+++ b/src/lib/sqlite/Util.hxx
@@ -20,6 +20,7 @@
#ifndef MPD_SQLITE_UTIL_HXX
#define MPD_SQLITE_UTIL_HXX
+#include "util/Compiler.h"
#include "Error.hxx"
#include <sqlite3.h>
diff --git a/src/lib/upnp/ContentDirectoryService.cxx b/src/lib/upnp/ContentDirectoryService.cxx
index 4eadb981c..9ea43ec03 100644
--- a/src/lib/upnp/ContentDirectoryService.cxx
+++ b/src/lib/upnp/ContentDirectoryService.cxx
@@ -21,11 +21,12 @@
#include "UniqueIxml.hxx"
#include "Device.hxx"
#include "ixmlwrap.hxx"
-#include "Action.hxx"
#include "util/UriUtil.hxx"
#include "util/RuntimeError.hxx"
#include "util/SplitString.hxx"
+#include <upnptools.h>
+
ContentDirectoryService::ContentDirectoryService(const UPnPDevice &device,
const UPnPService &service) noexcept
:m_actionURL(uri_apply_base(service.controlURL, device.URLBase)),
diff --git a/src/lib/upnp/Discovery.hxx b/src/lib/upnp/Discovery.hxx
index 8c8451818..c77f18343 100644
--- a/src/lib/upnp/Discovery.hxx
+++ b/src/lib/upnp/Discovery.hxx
@@ -28,7 +28,6 @@
#include "lib/curl/Request.hxx"
#include "thread/Mutex.hxx"
#include "event/DeferEvent.hxx"
-#include "util/Compiler.h"
#include <upnp.h>
@@ -37,7 +36,6 @@
#include <list>
#include <vector>
#include <string>
-#include <memory>
#include <chrono>
#if UPNP_VERSION < 10800
diff --git a/src/lib/upnp/Util.cxx b/src/lib/upnp/Util.cxx
index 9289f3f58..1a8f16b32 100644
--- a/src/lib/upnp/Util.cxx
+++ b/src/lib/upnp/Util.cxx
@@ -19,8 +19,6 @@
#include "Util.hxx"
-#include <assert.h>
-
/** Get rid of white space at both ends */
void
trimstring(std::string &s, const char *ws) noexcept
diff --git a/src/lib/upnp/ixmlwrap.hxx b/src/lib/upnp/ixmlwrap.hxx
index 73a0ce83f..4d4cb0794 100644
--- a/src/lib/upnp/ixmlwrap.hxx
+++ b/src/lib/upnp/ixmlwrap.hxx
@@ -19,8 +19,6 @@
#include <ixml.h>
-#include <string>
-
namespace ixmlwrap {
/**
* Retrieve the text content for the first element of given
diff --git a/src/lib/xiph/FlacIOHandle.hxx b/src/lib/xiph/FlacIOHandle.hxx
index 07e334dba..36e10f099 100644
--- a/src/lib/xiph/FlacIOHandle.hxx
+++ b/src/lib/xiph/FlacIOHandle.hxx
@@ -20,7 +20,6 @@
#ifndef MPD_FLAC_IO_HANDLE_HXX
#define MPD_FLAC_IO_HANDLE_HXX
-#include "util/Compiler.h"
#include "input/InputStream.hxx"
#include <FLAC/callback.h>
diff --git a/src/lib/xiph/FlacStreamMetadata.hxx b/src/lib/xiph/FlacStreamMetadata.hxx
index a0c6ab90c..9edadd404 100644
--- a/src/lib/xiph/FlacStreamMetadata.hxx
+++ b/src/lib/xiph/FlacStreamMetadata.hxx
@@ -20,7 +20,7 @@
#ifndef MPD_FLAC_STREAM_METADATA_HXX
#define MPD_FLAC_STREAM_METADATA_HXX
-#include <FLAC/metadata.h>
+#include <FLAC/format.h>
class TagHandler;
class MixRampInfo;
diff --git a/src/lib/xiph/OggVisitor.hxx b/src/lib/xiph/OggVisitor.hxx
index 356ae3645..37f37003e 100644
--- a/src/lib/xiph/OggVisitor.hxx
+++ b/src/lib/xiph/OggVisitor.hxx
@@ -25,8 +25,6 @@
#include <ogg/ogg.h>
-#include <stddef.h>
-
class Reader;
/**
diff --git a/src/mixer/MixerAll.cxx b/src/mixer/MixerAll.cxx
index 93733b88b..7338cc291 100644
--- a/src/mixer/MixerAll.cxx
+++ b/src/mixer/MixerAll.cxx
@@ -21,12 +21,9 @@
#include "MixerControl.hxx"
#include "MixerInternal.hxx"
#include "MixerList.hxx"
-#include "output/Filtered.hxx"
#include "pcm/Volume.hxx"
#include "Log.hxx"
-#include <stdexcept>
-
#include <assert.h>
gcc_pure
diff --git a/src/mixer/MixerType.hxx b/src/mixer/MixerType.hxx
index aa1292428..cd575aaaa 100644
--- a/src/mixer/MixerType.hxx
+++ b/src/mixer/MixerType.hxx
@@ -20,8 +20,6 @@
#ifndef MPD_MIXER_TYPE_HXX
#define MPD_MIXER_TYPE_HXX
-#include "util/Compiler.h"
-
enum class MixerType {
/** mixer disabled */
NONE,
diff --git a/src/mixer/plugins/PulseMixerPlugin.cxx b/src/mixer/plugins/PulseMixerPlugin.cxx
index 6b28aa695..69ba86b6c 100644
--- a/src/mixer/plugins/PulseMixerPlugin.cxx
+++ b/src/mixer/plugins/PulseMixerPlugin.cxx
@@ -18,7 +18,6 @@
*/
#include "PulseMixerPlugin.hxx"
-#include "lib/pulse/Domain.hxx"
#include "lib/pulse/LogError.hxx"
#include "lib/pulse/LockGuard.hxx"
#include "mixer/MixerInternal.hxx"
diff --git a/src/mixer/plugins/SndioMixerPlugin.cxx b/src/mixer/plugins/SndioMixerPlugin.cxx
index ce5ee3cf1..c80fad411 100644
--- a/src/mixer/plugins/SndioMixerPlugin.cxx
+++ b/src/mixer/plugins/SndioMixerPlugin.cxx
@@ -17,11 +17,8 @@
*/
#include "mixer/MixerInternal.hxx"
-#include "mixer/Listener.hxx"
#include "output/plugins/SndioOutputPlugin.hxx"
-#include <sndio.h>
-
class SndioMixer final : public Mixer {
SndioOutput &output;
diff --git a/src/neighbor/Glue.cxx b/src/neighbor/Glue.cxx
index 099fe1873..9e95a203e 100644
--- a/src/neighbor/Glue.cxx
+++ b/src/neighbor/Glue.cxx
@@ -23,7 +23,6 @@
#include "NeighborPlugin.hxx"
#include "Info.hxx"
#include "config/Data.hxx"
-#include "config/Domain.hxx"
#include "config/Block.hxx"
#include "util/RuntimeError.hxx"
diff --git a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
index 6a30e7436..59ffc0727 100644
--- a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
+++ b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
@@ -33,7 +33,7 @@
#include <libsmbclient.h>
-#include <algorithm>
+#include <utility>
class SmbclientNeighborExplorer final : public NeighborExplorer {
struct Server {
diff --git a/src/neighbor/plugins/UdisksNeighborPlugin.cxx b/src/neighbor/plugins/UdisksNeighborPlugin.cxx
index 42a2409b1..762fa915e 100644
--- a/src/neighbor/plugins/UdisksNeighborPlugin.cxx
+++ b/src/neighbor/plugins/UdisksNeighborPlugin.cxx
@@ -36,9 +36,7 @@
#include "util/Manual.hxx"
#include "Log.hxx"
-#include <stdexcept>
#include <string>
-#include <list>
#include <map>
static NeighborInfo
diff --git a/src/neighbor/plugins/UpnpNeighborPlugin.cxx b/src/neighbor/plugins/UpnpNeighborPlugin.cxx
index c22c67373..3d99dd3a1 100644
--- a/src/neighbor/plugins/UpnpNeighborPlugin.cxx
+++ b/src/neighbor/plugins/UpnpNeighborPlugin.cxx
@@ -27,8 +27,6 @@
#include "neighbor/Info.hxx"
#include "Log.hxx"
-#include <stdexcept>
-
class UpnpNeighborExplorer final
: public NeighborExplorer, UPnPDiscoveryListener {
struct Server {
diff --git a/src/net/AddressInfo.hxx b/src/net/AddressInfo.hxx
index 8beab84a4..5c9ff28c8 100644
--- a/src/net/AddressInfo.hxx
+++ b/src/net/AddressInfo.hxx
@@ -32,7 +32,6 @@
#include "SocketAddress.hxx"
-#include <algorithm>
#include <utility>
#ifdef _WIN32
diff --git a/src/net/AllocatedSocketAddress.cxx b/src/net/AllocatedSocketAddress.cxx
index 503aae04d..c1a754641 100644
--- a/src/net/AllocatedSocketAddress.cxx
+++ b/src/net/AllocatedSocketAddress.cxx
@@ -39,14 +39,6 @@
#include <sys/un.h>
#endif
-#ifdef HAVE_TCP
-#ifdef _WIN32
-#include <ws2tcpip.h>
-#else
-#include <netinet/in.h>
-#endif
-#endif
-
AllocatedSocketAddress &
AllocatedSocketAddress::operator=(SocketAddress src) noexcept
{
diff --git a/src/net/AllocatedSocketAddress.hxx b/src/net/AllocatedSocketAddress.hxx
index f8462f835..002281685 100644
--- a/src/net/AllocatedSocketAddress.hxx
+++ b/src/net/AllocatedSocketAddress.hxx
@@ -34,7 +34,7 @@
#include "Features.hxx"
#include "util/Compiler.h"
-#include <algorithm>
+#include <utility>
#include <stdlib.h>
diff --git a/src/net/Resolver.hxx b/src/net/Resolver.hxx
index 548d6cc0f..bd427cdda 100644
--- a/src/net/Resolver.hxx
+++ b/src/net/Resolver.hxx
@@ -33,7 +33,6 @@
#ifndef NET_RESOLVER_HXX
#define NET_RESOLVER_HXX
-struct addrinfo;
class AddressInfoList;
/**
diff --git a/src/net/StaticSocketAddress.cxx b/src/net/StaticSocketAddress.cxx
index ba7b06a15..ee20d8070 100644
--- a/src/net/StaticSocketAddress.cxx
+++ b/src/net/StaticSocketAddress.cxx
@@ -37,14 +37,6 @@
#include <string.h>
-#ifdef HAVE_TCP
-#ifdef _WIN32
-#include <ws2tcpip.h>
-#else
-#include <netinet/in.h>
-#endif
-#endif
-
StaticSocketAddress &
StaticSocketAddress::operator=(SocketAddress other) noexcept
{
diff --git a/src/output/Control.cxx b/src/output/Control.cxx
index 78db1bd4f..63b4e4b9d 100644
--- a/src/output/Control.cxx
+++ b/src/output/Control.cxx
@@ -19,14 +19,10 @@
#include "Control.hxx"
#include "Filtered.hxx"
-#include "Domain.hxx"
#include "mixer/MixerControl.hxx"
-#include "filter/plugins/ReplayGainFilterPlugin.hxx"
#include "config/Block.hxx"
#include "Log.hxx"
-#include <stdexcept>
-
#include <assert.h>
/** after a failure, wait this duration before
diff --git a/src/output/Control.hxx b/src/output/Control.hxx
index ca89a6db0..4d803fd97 100644
--- a/src/output/Control.hxx
+++ b/src/output/Control.hxx
@@ -28,16 +28,11 @@
#include "system/PeriodClock.hxx"
#include "util/Compiler.h"
-#include <utility>
#include <exception>
#include <memory>
#include <string>
#include <map>
-#ifndef NDEBUG
-#include <assert.h>
-#endif
-
#include <stdint.h>
enum class ReplayGainMode : uint8_t;
diff --git a/src/output/Filtered.hxx b/src/output/Filtered.hxx
index 43aa11bf8..a35408dac 100644
--- a/src/output/Filtered.hxx
+++ b/src/output/Filtered.hxx
@@ -30,12 +30,10 @@
class FilterFactory;
class PreparedFilter;
-class MusicPipe;
class EventLoop;
class Mixer;
class MixerListener;
struct MixerPlugin;
-struct MusicChunk;
struct ConfigBlock;
class AudioOutput;
struct AudioOutputDefaults;
diff --git a/src/output/Init.cxx b/src/output/Init.cxx
index 009e04e25..7374b1429 100644
--- a/src/output/Init.cxx
+++ b/src/output/Init.cxx
@@ -26,7 +26,6 @@
#include "mixer/MixerList.hxx"
#include "mixer/MixerType.hxx"
#include "mixer/MixerControl.hxx"
-#include "mixer/plugins/SoftwareMixerPlugin.hxx"
#include "filter/LoadChain.hxx"
#include "filter/Prepared.hxx"
#include "filter/plugins/AutoConvertFilterPlugin.hxx"
@@ -35,9 +34,6 @@
#include "filter/plugins/ChainFilterPlugin.hxx"
#include "filter/plugins/VolumeFilterPlugin.hxx"
#include "filter/plugins/NormalizeFilterPlugin.hxx"
-#include "config/Domain.hxx"
-#include "config/Option.hxx"
-#include "config/Block.hxx"
#include "util/RuntimeError.hxx"
#include "util/StringFormat.hxx"
#include "Log.hxx"
diff --git a/src/output/Interface.hxx b/src/output/Interface.hxx
index 36767a4d7..8a26d2817 100644
--- a/src/output/Interface.hxx
+++ b/src/output/Interface.hxx
@@ -23,7 +23,6 @@
#include <map>
#include <string>
#include <chrono>
-#include <stdexcept>
struct AudioFormat;
struct Tag;
diff --git a/src/output/MultipleOutputs.cxx b/src/output/MultipleOutputs.cxx
index bdbd183fe..7cdb0ef7f 100644
--- a/src/output/MultipleOutputs.cxx
+++ b/src/output/MultipleOutputs.cxx
@@ -20,7 +20,6 @@
#include "MultipleOutputs.hxx"
#include "Filtered.hxx"
#include "Defaults.hxx"
-#include "Domain.hxx"
#include "MusicPipe.hxx"
#include "MusicChunk.hxx"
#include "filter/Factory.hxx"
diff --git a/src/output/OutputCommand.cxx b/src/output/OutputCommand.cxx
index fcaa333c3..6e1fc4650 100644
--- a/src/output/OutputCommand.cxx
+++ b/src/output/OutputCommand.cxx
@@ -26,9 +26,7 @@
#include "OutputCommand.hxx"
#include "MultipleOutputs.hxx"
-#include "Filtered.hxx"
#include "Client.hxx"
-#include "player/Control.hxx"
#include "mixer/MixerControl.hxx"
#include "mixer/Volume.hxx"
#include "Idle.hxx"
diff --git a/src/output/OutputPlugin.hxx b/src/output/OutputPlugin.hxx
index 4b425f695..903264824 100644
--- a/src/output/OutputPlugin.hxx
+++ b/src/output/OutputPlugin.hxx
@@ -22,13 +22,7 @@
#include "util/Compiler.h"
-#include <chrono>
-
-#include <stddef.h>
-
struct ConfigBlock;
-struct AudioFormat;
-struct Tag;
class AudioOutput;
struct MixerPlugin;
class EventLoop;
diff --git a/src/output/Print.cxx b/src/output/Print.cxx
index 71ee9cfd9..714fb42fb 100644
--- a/src/output/Print.cxx
+++ b/src/output/Print.cxx
@@ -24,7 +24,6 @@
#include "Print.hxx"
#include "MultipleOutputs.hxx"
-#include "Filtered.hxx"
#include "client/Response.hxx"
void
diff --git a/src/output/Source.hxx b/src/output/Source.hxx
index 5e8766520..c7ebec984 100644
--- a/src/output/Source.hxx
+++ b/src/output/Source.hxx
@@ -20,7 +20,6 @@
#ifndef AUDIO_OUTPUT_SOURCE_HXX
#define AUDIO_OUTPUT_SOURCE_HXX
-#include "util/Compiler.h"
#include "SharedPipeConsumer.hxx"
#include "AudioFormat.hxx"
#include "ReplayGainMode.hxx"
diff --git a/src/output/State.cxx b/src/output/State.cxx
index e9cc3be81..32a749c24 100644
--- a/src/output/State.cxx
+++ b/src/output/State.cxx
@@ -24,7 +24,6 @@
#include "State.hxx"
#include "MultipleOutputs.hxx"
-#include "Filtered.hxx"
#include "Domain.hxx"
#include "Log.hxx"
#include "fs/io/BufferedOutputStream.hxx"
diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx
index 597a50a1e..ffe57ed10 100644
--- a/src/output/Thread.cxx
+++ b/src/output/Thread.cxx
@@ -21,7 +21,6 @@
#include "Filtered.hxx"
#include "Client.hxx"
#include "Domain.hxx"
-#include "mixer/MixerInternal.hxx"
#include "thread/Util.hxx"
#include "thread/Slack.hxx"
#include "thread/Name.hxx"
diff --git a/src/output/Timer.cxx b/src/output/Timer.cxx
index d45b6ca9f..35a252379 100644
--- a/src/output/Timer.cxx
+++ b/src/output/Timer.cxx
@@ -20,8 +20,6 @@
#include "Timer.hxx"
#include "AudioFormat.hxx"
-#include <limits>
-
#include <assert.h>
Timer::Timer(const AudioFormat af)
diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx
index 284117c97..1dfb90b7a 100644
--- a/src/output/plugins/AlsaOutputPlugin.cxx
+++ b/src/output/plugins/AlsaOutputPlugin.cxx
@@ -34,7 +34,6 @@
#include "util/RuntimeError.hxx"
#include "util/Domain.hxx"
#include "util/ConstBuffer.hxx"
-#include "util/ScopeExit.hxx"
#include "util/StringView.hxx"
#include "event/MultiSocketMonitor.hxx"
#include "event/DeferEvent.hxx"
diff --git a/src/output/plugins/JackOutputPlugin.cxx b/src/output/plugins/JackOutputPlugin.cxx
index fef0af713..8b02ff3a8 100644
--- a/src/output/plugins/JackOutputPlugin.cxx
+++ b/src/output/plugins/JackOutputPlugin.cxx
@@ -20,7 +20,6 @@
#include "config.h"
#include "JackOutputPlugin.hxx"
#include "../OutputAPI.hxx"
-#include "config/Domain.hxx"
#include "util/ScopeExit.hxx"
#include "util/ConstBuffer.hxx"
#include "util/IterableSplitString.hxx"
diff --git a/src/output/plugins/PulseOutputPlugin.cxx b/src/output/plugins/PulseOutputPlugin.cxx
index 6cb92fdec..1fbcd17bf 100644
--- a/src/output/plugins/PulseOutputPlugin.cxx
+++ b/src/output/plugins/PulseOutputPlugin.cxx
@@ -18,7 +18,6 @@
*/
#include "PulseOutputPlugin.hxx"
-#include "lib/pulse/Domain.hxx"
#include "lib/pulse/Error.hxx"
#include "lib/pulse/LogError.hxx"
#include "lib/pulse/LockGuard.hxx"
@@ -26,7 +25,6 @@
#include "mixer/MixerList.hxx"
#include "mixer/plugins/PulseMixerPlugin.hxx"
#include "util/ScopeExit.hxx"
-#include "Log.hxx"
#include <pulse/thread-mainloop.h>
#include <pulse/context.h>
diff --git a/src/output/plugins/RecorderOutputPlugin.cxx b/src/output/plugins/RecorderOutputPlugin.cxx
index 62dc5d91c..a80bc5d17 100644
--- a/src/output/plugins/RecorderOutputPlugin.cxx
+++ b/src/output/plugins/RecorderOutputPlugin.cxx
@@ -23,7 +23,6 @@
#include "encoder/ToOutputStream.hxx"
#include "encoder/EncoderInterface.hxx"
#include "encoder/Configured.hxx"
-#include "config/Domain.hxx"
#include "config/Path.hxx"
#include "Log.hxx"
#include "fs/AllocatedPath.hxx"
diff --git a/src/output/plugins/ShoutOutputPlugin.cxx b/src/output/plugins/ShoutOutputPlugin.cxx
index 9fd648ab7..a4b7678e3 100644
--- a/src/output/plugins/ShoutOutputPlugin.cxx
+++ b/src/output/plugins/ShoutOutputPlugin.cxx
@@ -34,7 +34,6 @@
#include <memory>
#include <assert.h>
-#include <stdlib.h>
#include <string.h>
#include <stdio.h>
diff --git a/src/output/plugins/httpd/HttpdOutputPlugin.cxx b/src/output/plugins/httpd/HttpdOutputPlugin.cxx
index c2414dfe8..1c86dbd7b 100644
--- a/src/output/plugins/httpd/HttpdOutputPlugin.cxx
+++ b/src/output/plugins/httpd/HttpdOutputPlugin.cxx
@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "config.h"
#include "HttpdOutputPlugin.hxx"
#include "HttpdInternal.hxx"
#include "HttpdClient.hxx"
@@ -26,19 +25,16 @@
#include "encoder/Configured.hxx"
#include "net/UniqueSocketDescriptor.hxx"
#include "net/SocketAddress.hxx"
-#include "net/ToString.hxx"
#include "Page.hxx"
#include "IcyMetaDataServer.hxx"
#include "event/Call.hxx"
#include "util/Domain.hxx"
#include "util/DeleteDisposer.hxx"
-#include "Log.hxx"
#include "config/Net.hxx"
#include <assert.h>
#include <string.h>
-#include <errno.h>
const Domain httpd_output_domain("httpd_output");
diff --git a/src/pcm/ConfiguredResampler.cxx b/src/pcm/ConfiguredResampler.cxx
index 0be1f556b..4f647009c 100644
--- a/src/pcm/ConfiguredResampler.cxx
+++ b/src/pcm/ConfiguredResampler.cxx
@@ -21,7 +21,6 @@
#include "FallbackResampler.hxx"
#include "config/Data.hxx"
#include "config/Option.hxx"
-#include "config/Domain.hxx"
#include "config/Block.hxx"
#include "config/Param.hxx"
#include "util/RuntimeError.hxx"
diff --git a/src/pcm/Export.cxx b/src/pcm/Export.cxx
index 0bced9580..24f0a0656 100644
--- a/src/pcm/Export.cxx
+++ b/src/pcm/Export.cxx
@@ -18,7 +18,6 @@
*/
#include "Export.hxx"
-#include "AudioFormat.hxx"
#include "Order.hxx"
#include "Pack.hxx"
#include "Silence.hxx"
diff --git a/src/pcm/Export.hxx b/src/pcm/Export.hxx
index e09a70fde..4ccf6f5dc 100644
--- a/src/pcm/Export.hxx
+++ b/src/pcm/Export.hxx
@@ -33,7 +33,6 @@
#include <stdint.h>
template<typename T> struct ConstBuffer;
-struct AudioFormat;
/**
* An object that handles export of PCM samples to some instance
diff --git a/src/pcm/FallbackResampler.hxx b/src/pcm/FallbackResampler.hxx
index 97bb1042e..108bc0a34 100644
--- a/src/pcm/FallbackResampler.hxx
+++ b/src/pcm/FallbackResampler.hxx
@@ -23,7 +23,6 @@
#include "Resampler.hxx"
#include "Buffer.hxx"
#include "AudioFormat.hxx"
-#include "util/Compiler.h"
/**
* A naive resampler that is used when no external library was found
diff --git a/src/pcm/FloatConvert.hxx b/src/pcm/FloatConvert.hxx
index 45cc1489d..0b534bf78 100644
--- a/src/pcm/FloatConvert.hxx
+++ b/src/pcm/FloatConvert.hxx
@@ -21,6 +21,7 @@
#define MPD_PCM_FLOAT_CONVERT_HXX
#include "Traits.hxx"
+#include "Clamp.hxx"
/**
* Convert from float to an integer sample format.
diff --git a/src/pcm/GlueResampler.cxx b/src/pcm/GlueResampler.cxx
index d8d8d9975..2d08e6455 100644
--- a/src/pcm/GlueResampler.cxx
+++ b/src/pcm/GlueResampler.cxx
@@ -20,6 +20,7 @@
#include "GlueResampler.hxx"
#include "ConfiguredResampler.hxx"
#include "Resampler.hxx"
+#include "AudioFormat.hxx"
#include <assert.h>
diff --git a/src/pcm/GlueResampler.hxx b/src/pcm/GlueResampler.hxx
index 7963267d1..8d65268eb 100644
--- a/src/pcm/GlueResampler.hxx
+++ b/src/pcm/GlueResampler.hxx
@@ -20,9 +20,10 @@
#ifndef MPD_GLUE_RESAMPLER_HXX
#define MPD_GLUE_RESAMPLER_HXX
-#include "AudioFormat.hxx"
+#include "SampleFormat.hxx"
#include "FormatConverter.hxx"
+struct AudioFormat;
class PcmResampler;
template<typename T> struct ConstBuffer;
diff --git a/src/pcm/LibsamplerateResampler.hxx b/src/pcm/LibsamplerateResampler.hxx
index db2d087f7..11e68fc67 100644
--- a/src/pcm/LibsamplerateResampler.hxx
+++ b/src/pcm/LibsamplerateResampler.hxx
@@ -23,7 +23,6 @@
#include "Resampler.hxx"
#include "Buffer.hxx"
#include "AudioFormat.hxx"
-#include "util/Compiler.h"
#include <samplerate.h>
diff --git a/src/pcm/PcmFormat.cxx b/src/pcm/PcmFormat.cxx
index 66c86c4f7..0bb70851a 100644
--- a/src/pcm/PcmFormat.cxx
+++ b/src/pcm/PcmFormat.cxx
@@ -19,7 +19,6 @@
#include "PcmFormat.hxx"
#include "Buffer.hxx"
-#include "Clamp.hxx"
#include "Traits.hxx"
#include "FloatConvert.hxx"
#include "ShiftConvert.hxx"
diff --git a/src/pcm/SoxrResampler.hxx b/src/pcm/SoxrResampler.hxx
index 834b18982..044741e08 100644
--- a/src/pcm/SoxrResampler.hxx
+++ b/src/pcm/SoxrResampler.hxx
@@ -22,7 +22,6 @@
#include "Resampler.hxx"
#include "Buffer.hxx"
-#include "util/Compiler.h"
struct AudioFormat;
struct ConfigBlock;
diff --git a/src/pcm/dsd2pcm/dsd2pcm.h b/src/pcm/dsd2pcm/dsd2pcm.h
index df1f4a33d..4267b42c3 100644
--- a/src/pcm/dsd2pcm/dsd2pcm.h
+++ b/src/pcm/dsd2pcm/dsd2pcm.h
@@ -32,7 +32,6 @@ or implied, of Sebastian Gesemann.
#define DSD2PCM_H_INCLUDED
#include <stddef.h>
-#include <string.h>
#ifdef __cplusplus
extern "C" {
diff --git a/src/playlist/MemorySongEnumerator.hxx b/src/playlist/MemorySongEnumerator.hxx
index 062fdd5c2..487d0d76e 100644
--- a/src/playlist/MemorySongEnumerator.hxx
+++ b/src/playlist/MemorySongEnumerator.hxx
@@ -22,7 +22,6 @@
#include "SongEnumerator.hxx"
#include "song/DetachedSong.hxx"
-#include "util/Compiler.h"
#include <forward_list>
diff --git a/src/playlist/PlaylistAny.cxx b/src/playlist/PlaylistAny.cxx
index 38b75ac3a..014f79169 100644
--- a/src/playlist/PlaylistAny.cxx
+++ b/src/playlist/PlaylistAny.cxx
@@ -22,7 +22,6 @@
#include "PlaylistStream.hxx"
#include "PlaylistMapper.hxx"
#include "SongEnumerator.hxx"
-#include "util/UriUtil.hxx"
#include "config.h"
std::unique_ptr<SongEnumerator>
diff --git a/src/playlist/PlaylistRegistry.cxx b/src/playlist/PlaylistRegistry.cxx
index efcc77e17..1866229bc 100644
--- a/src/playlist/PlaylistRegistry.cxx
+++ b/src/playlist/PlaylistRegistry.cxx
@@ -41,7 +41,6 @@
#include "config/Block.hxx"
#include <assert.h>
-#include <string.h>
const struct playlist_plugin *const playlist_plugins[] = {
&extm3u_playlist_plugin,
diff --git a/src/playlist/plugins/AsxPlaylistPlugin.cxx b/src/playlist/plugins/AsxPlaylistPlugin.cxx
index 48f228696..7c9751b5e 100644
--- a/src/playlist/plugins/AsxPlaylistPlugin.cxx
+++ b/src/playlist/plugins/AsxPlaylistPlugin.cxx
@@ -24,7 +24,6 @@
#include "util/ASCII.hxx"
#include "util/StringView.hxx"
#include "lib/expat/ExpatParser.hxx"
-#include "Log.hxx"
/**
* This is the state object for our XML parser.
diff --git a/src/playlist/plugins/RssPlaylistPlugin.cxx b/src/playlist/plugins/RssPlaylistPlugin.cxx
index 666cfec07..ae5a8c949 100644
--- a/src/playlist/plugins/RssPlaylistPlugin.cxx
+++ b/src/playlist/plugins/RssPlaylistPlugin.cxx
@@ -24,7 +24,6 @@
#include "util/ASCII.hxx"
#include "util/StringView.hxx"
#include "lib/expat/ExpatParser.hxx"
-#include "Log.hxx"
/**
* This is the state object for the our XML parser.
diff --git a/src/playlist/plugins/XspfPlaylistPlugin.cxx b/src/playlist/plugins/XspfPlaylistPlugin.cxx
index 41cff8613..f0dd11ac7 100644
--- a/src/playlist/plugins/XspfPlaylistPlugin.cxx
+++ b/src/playlist/plugins/XspfPlaylistPlugin.cxx
@@ -25,7 +25,6 @@
#include "tag/Builder.hxx"
#include "util/StringView.hxx"
#include "lib/expat/ExpatParser.hxx"
-#include "Log.hxx"
#include <string.h>
diff --git a/src/protocol/Ack.hxx b/src/protocol/Ack.hxx
index cc8454082..7539ad3f9 100644
--- a/src/protocol/Ack.hxx
+++ b/src/protocol/Ack.hxx
@@ -23,6 +23,7 @@
#include "util/StringFormat.hxx"
#include <stdexcept>
+#include <utility>
class Domain;
diff --git a/src/queue/PlaylistEdit.cxx b/src/queue/PlaylistEdit.cxx
index b3b85e5e6..d6ab55d15 100644
--- a/src/queue/PlaylistEdit.cxx
+++ b/src/queue/PlaylistEdit.cxx
@@ -30,8 +30,6 @@
#include "song/DetachedSong.hxx"
#include "SongLoader.hxx"
-#include <memory>
-
#include <stdlib.h>
void
diff --git a/src/queue/Queue.hxx b/src/queue/Queue.hxx
index 051827a83..231559233 100644
--- a/src/queue/Queue.hxx
+++ b/src/queue/Queue.hxx
@@ -25,7 +25,7 @@
#include "SingleMode.hxx"
#include "util/LazyRandomEngine.hxx"
-#include <algorithm>
+#include <utility>
#include <assert.h>
#include <stdint.h>
diff --git a/src/song/BaseSongFilter.hxx b/src/song/BaseSongFilter.hxx
index 0c8ed7688..8dc44cbd4 100644
--- a/src/song/BaseSongFilter.hxx
+++ b/src/song/BaseSongFilter.hxx
@@ -21,7 +21,6 @@
#define MPD_BASE_SONG_FILTER_HXX
#include "ISongFilter.hxx"
-#include "util/Compiler.h"
class BaseSongFilter final : public ISongFilter {
std::string value;
diff --git a/src/song/Filter.cxx b/src/song/Filter.cxx
index 49ef4de7d..57e557047 100644
--- a/src/song/Filter.cxx
+++ b/src/song/Filter.cxx
@@ -25,24 +25,17 @@
#include "TagSongFilter.hxx"
#include "ModifiedSinceSongFilter.hxx"
#include "AudioFormatSongFilter.hxx"
-#include "LightSong.hxx"
#include "AudioParser.hxx"
#include "tag/ParseName.hxx"
-#include "tag/Tag.hxx"
-#include "time/ChronoUtil.hxx"
#include "time/ISO8601.hxx"
#include "util/CharUtil.hxx"
#include "util/ConstBuffer.hxx"
#include "util/RuntimeError.hxx"
-#include "util/StringAPI.hxx"
#include "util/StringCompare.hxx"
#include "util/StringStrip.hxx"
#include "util/StringView.hxx"
#include "util/ASCII.hxx"
#include "util/UriUtil.hxx"
-#include "lib/icu/CaseFold.hxx"
-
-#include <exception>
#include <assert.h>
#include <stdlib.h>
diff --git a/src/song/StringFilter.cxx b/src/song/StringFilter.cxx
index b379b352f..71cab4d4e 100644
--- a/src/song/StringFilter.cxx
+++ b/src/song/StringFilter.cxx
@@ -18,7 +18,7 @@
*/
#include "StringFilter.hxx"
-#include "util/StringCompare.hxx"
+#include "util/StringAPI.hxx"
#include <assert.h>
diff --git a/src/song/TagSongFilter.hxx b/src/song/TagSongFilter.hxx
index dc054a855..59d7a1398 100644
--- a/src/song/TagSongFilter.hxx
+++ b/src/song/TagSongFilter.hxx
@@ -25,10 +25,8 @@
#include <stdint.h>
-template<typename T> struct ConstBuffer;
enum TagType : uint8_t;
struct Tag;
-struct TagItem;
struct LightSong;
class TagSongFilter final : public ISongFilter {
diff --git a/src/sticker/Database.hxx b/src/sticker/Database.hxx
index 61a908d81..47ab17b53 100644
--- a/src/sticker/Database.hxx
+++ b/src/sticker/Database.hxx
@@ -44,7 +44,6 @@
#include "Match.hxx"
#include "lib/sqlite/Database.hxx"
-#include "util/Compiler.h"
#include <sqlite3.h>
diff --git a/src/storage/Configured.cxx b/src/storage/Configured.cxx
index 5d975efef..e89a492dd 100644
--- a/src/storage/Configured.cxx
+++ b/src/storage/Configured.cxx
@@ -22,14 +22,11 @@
#include "StorageInterface.hxx"
#include "plugins/LocalStorage.hxx"
#include "config/Data.hxx"
-#include "config/Domain.hxx"
#include "fs/StandardDirectory.hxx"
#include "fs/CheckFile.hxx"
#include "util/UriUtil.hxx"
#include "util/RuntimeError.hxx"
-#include <assert.h>
-
static std::unique_ptr<Storage>
CreateConfiguredStorageUri(EventLoop &event_loop, const char *uri)
{
diff --git a/src/storage/Registry.cxx b/src/storage/Registry.cxx
index 4aef78bef..7b80554dc 100644
--- a/src/storage/Registry.cxx
+++ b/src/storage/Registry.cxx
@@ -27,7 +27,6 @@
#include "plugins/CurlStorage.hxx"
#include "config.h"
-#include <assert.h>
#include <string.h>
const StoragePlugin *const storage_plugins[] = {
diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx
index 97df52691..4d67b526e 100644
--- a/src/storage/plugins/CurlStorage.cxx
+++ b/src/storage/plugins/CurlStorage.cxx
@@ -29,11 +29,9 @@
#include "lib/curl/Handler.hxx"
#include "lib/expat/ExpatParser.hxx"
#include "fs/Traits.hxx"
-#include "event/Call.hxx"
#include "event/DeferEvent.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
-#include "time/ChronoUtil.hxx"
#include "time/Parser.hxx"
#include "util/ASCII.hxx"
#include "util/IterableSplitString.hxx"
@@ -42,10 +40,9 @@
#include "util/StringFormat.hxx"
#include "util/UriUtil.hxx"
-#include <algorithm>
#include <memory>
#include <string>
-#include <list>
+#include <utility>
#include <assert.h>
diff --git a/src/storage/plugins/UdisksStorage.cxx b/src/storage/plugins/UdisksStorage.cxx
index 4965c703e..0564e3711 100644
--- a/src/storage/plugins/UdisksStorage.cxx
+++ b/src/storage/plugins/UdisksStorage.cxx
@@ -25,7 +25,6 @@
#include "lib/dbus/Glue.hxx"
#include "lib/dbus/AsyncRequest.hxx"
#include "lib/dbus/Message.hxx"
-#include "lib/dbus/PendingCall.hxx"
#include "lib/dbus/AppendIter.hxx"
#include "lib/dbus/ReadIter.hxx"
#include "lib/dbus/ObjectManager.hxx"
diff --git a/src/system/Clock.hxx b/src/system/Clock.hxx
index 62a7f7aba..da7c89a4b 100644
--- a/src/system/Clock.hxx
+++ b/src/system/Clock.hxx
@@ -20,12 +20,12 @@
#ifndef MPD_CLOCK_H
#define MPD_CLOCK_H
+#ifdef _WIN32
+
#include "util/Compiler.h"
#include <chrono>
-#ifdef _WIN32
-
/**
* Returns the uptime of the current process in seconds.
*/
diff --git a/src/system/EpollFD.hxx b/src/system/EpollFD.hxx
index ff07c038c..14dc6ddfb 100644
--- a/src/system/EpollFD.hxx
+++ b/src/system/EpollFD.hxx
@@ -35,8 +35,6 @@
#include <sys/epoll.h>
#include <stdint.h>
-struct epoll_event;
-
/**
* A class that wraps Linux epoll.
*/
diff --git a/src/system/EventPipe.cxx b/src/system/EventPipe.cxx
index 297a0f722..f312f9e38 100644
--- a/src/system/EventPipe.cxx
+++ b/src/system/EventPipe.cxx
@@ -20,7 +20,6 @@
#include "EventPipe.hxx"
#include "FileDescriptor.hxx"
#include "system/Error.hxx"
-#include "util/ScopeExit.hxx"
#include "util/Compiler.h"
#include <assert.h>
diff --git a/src/tag/Builder.cxx b/src/tag/Builder.cxx
index 0eb47966c..448733428 100644
--- a/src/tag/Builder.cxx
+++ b/src/tag/Builder.cxx
@@ -25,6 +25,7 @@
#include "util/WritableBuffer.hxx"
#include "util/StringView.hxx"
+#include <algorithm>
#include <array>
#include <assert.h>
diff --git a/src/tag/Generic.cxx b/src/tag/Generic.cxx
index cba710e08..ab645177a 100644
--- a/src/tag/Generic.cxx
+++ b/src/tag/Generic.cxx
@@ -26,8 +26,6 @@
#include "input/LocalOpen.hxx"
#include "config.h"
-#include <exception>
-
bool
ScanGenericTags(InputStream &is, TagHandler &handler)
{
diff --git a/src/tag/Handler.cxx b/src/tag/Handler.cxx
index 9731a7878..137c221a0 100644
--- a/src/tag/Handler.cxx
+++ b/src/tag/Handler.cxx
@@ -20,7 +20,6 @@
#include "Handler.hxx"
#include "Builder.hxx"
#include "AudioFormat.hxx"
-#include "util/ASCII.hxx"
#include "util/CharUtil.hxx"
#include "util/StringView.hxx"
diff --git a/src/tag/ReplayGain.cxx b/src/tag/ReplayGain.cxx
index ecb1ce240..92eb7c925 100644
--- a/src/tag/ReplayGain.cxx
+++ b/src/tag/ReplayGain.cxx
@@ -24,7 +24,6 @@
#include "util/NumberParser.hxx"
#include <assert.h>
-#include <stdlib.h>
template<typename T>
static bool
diff --git a/src/tag/Tag.hxx b/src/tag/Tag.hxx
index f85667969..a6348b3f4 100644
--- a/src/tag/Tag.hxx
+++ b/src/tag/Tag.hxx
@@ -25,8 +25,8 @@
#include "Chrono.hxx"
#include "util/Compiler.h"
-#include <algorithm>
#include <memory>
+#include <utility>
/**
* The meta information about a song file. It is a MPD specific
diff --git a/src/time/ISO8601.hxx b/src/time/ISO8601.hxx
index 1e13f17be..b6788a458 100644
--- a/src/time/ISO8601.hxx
+++ b/src/time/ISO8601.hxx
@@ -35,7 +35,6 @@
#include "util/Compiler.h"
-#include <string>
#include <chrono>
#include <stddef.h>
diff --git a/src/unix/Daemon.cxx b/src/unix/Daemon.cxx
index 16b0634ce..3fd145c93 100644
--- a/src/unix/Daemon.cxx
+++ b/src/unix/Daemon.cxx
@@ -21,7 +21,6 @@
#include "Daemon.hxx"
#include "system/Error.hxx"
#include "fs/AllocatedPath.hxx"
-#include "fs/FileSystem.hxx"
#include "util/RuntimeError.hxx"
#ifndef _WIN32
diff --git a/src/util/AllocatedString.hxx b/src/util/AllocatedString.hxx
index 477639802..4a9e9dee4 100644
--- a/src/util/AllocatedString.hxx
+++ b/src/util/AllocatedString.hxx
@@ -32,7 +32,6 @@
#include "StringPointer.hxx"
-#include <utility>
#include <algorithm>
/**
diff --git a/src/util/DivideString.hxx b/src/util/DivideString.hxx
index 9ef3e30f1..01ae3129d 100644
--- a/src/util/DivideString.hxx
+++ b/src/util/DivideString.hxx
@@ -20,8 +20,6 @@
#ifndef MPD_DIVIDE_STRING_HXX
#define MPD_DIVIDE_STRING_HXX
-#include "Compiler.h"
-
#include <assert.h>
/**
diff --git a/src/util/Exception.hxx b/src/util/Exception.hxx
index 067f4923d..fe816cffc 100644
--- a/src/util/Exception.hxx
+++ b/src/util/Exception.hxx
@@ -34,6 +34,7 @@
#include <exception>
#include <string>
+#include <utility>
/**
* Throws the specified exception. There is an overload for
diff --git a/src/util/HexFormat.hxx b/src/util/HexFormat.hxx
index d46903d3a..d0eab03e6 100644
--- a/src/util/HexFormat.hxx
+++ b/src/util/HexFormat.hxx
@@ -34,6 +34,7 @@
#include "StringBuffer.hxx"
#include "Compiler.h"
+#include <stddef.h>
#include <stdint.h>
/**
diff --git a/src/util/OptionParser.cxx b/src/util/OptionParser.cxx
index 4c7d7a709..a2e845e59 100644
--- a/src/util/OptionParser.cxx
+++ b/src/util/OptionParser.cxx
@@ -22,8 +22,6 @@
#include "util/RuntimeError.hxx"
#include "util/StringCompare.hxx"
-#include <string.h>
-
inline const char *
OptionParser::CheckShiftValue(const char *s, const OptionDef &option)
{
diff --git a/src/util/PrintException.hxx b/src/util/PrintException.hxx
index 3abd2e538..9ff8d2591 100644
--- a/src/util/PrintException.hxx
+++ b/src/util/PrintException.hxx
@@ -33,7 +33,7 @@
#ifndef PRINT_EXCEPTION_HXX
#define PRINT_EXCEPTION_HXX
-#include <stdexcept>
+#include <exception>
/**
* Print this exception (and its nested exceptions, if any) to stderr.
diff --git a/src/util/SplitString.cxx b/src/util/SplitString.cxx
index e7c50dc26..650c6e58e 100644
--- a/src/util/SplitString.cxx
+++ b/src/util/SplitString.cxx
@@ -31,8 +31,6 @@
#include "IterableSplitString.hxx"
#include "StringStrip.hxx"
-#include <string.h>
-
std::forward_list<std::string>
SplitString(const char *s, char separator, bool strip) noexcept
{
diff --git a/src/zeroconf/AvahiPoll.hxx b/src/zeroconf/AvahiPoll.hxx
index bee3c3e18..c613fa5d3 100644
--- a/src/zeroconf/AvahiPoll.hxx
+++ b/src/zeroconf/AvahiPoll.hxx
@@ -20,8 +20,6 @@
#ifndef MPD_AVAHI_POLL_HXX
#define MPD_AVAHI_POLL_HXX
-#include "util/Compiler.h"
-
#include <avahi-common/watch.h>
class EventLoop;