aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ArchiveFile.hxx2
-rw-r--r--src/ArchiveLookup.cxx1
-rw-r--r--src/ArchivePlugin.hxx2
-rw-r--r--src/AvahiPoll.cxx1
-rw-r--r--src/Client.hxx2
-rw-r--r--src/ClientFile.cxx3
-rw-r--r--src/ClientGlobal.cxx1
-rw-r--r--src/ClientNew.cxx2
-rw-r--r--src/ClientRead.cxx1
-rw-r--r--src/ClientSubscribe.cxx5
-rw-r--r--src/CommandLine.cxx1
-rw-r--r--src/ConfigData.cxx1
-rw-r--r--src/ConfigFile.cxx3
-rw-r--r--src/ConfigGlobal.cxx2
-rw-r--r--src/ConfigTemplates.hxx2
-rw-r--r--src/CrossFade.cxx2
-rw-r--r--src/Daemon.cxx3
-rw-r--r--src/DatabaseGlue.cxx6
-rw-r--r--src/DatabaseHelpers.hxx1
-rw-r--r--src/DatabaseLock.cxx1
-rw-r--r--src/DatabasePrint.cxx1
-rw-r--r--src/DatabasePrint.hxx1
-rw-r--r--src/DatabaseQueue.cxx1
-rw-r--r--src/DatabaseSave.cxx2
-rw-r--r--src/DecoderAPI.cxx1
-rw-r--r--src/DecoderAPI.hxx4
-rw-r--r--src/DecoderControl.cxx2
-rw-r--r--src/DecoderInternal.hxx2
-rw-r--r--src/DecoderPlugin.hxx1
-rw-r--r--src/DecoderThread.cxx1
-rw-r--r--src/DirectorySave.cxx3
-rw-r--r--src/EncoderAPI.hxx4
-rw-r--r--src/FilterConfig.cxx2
-rw-r--r--src/FilterPlugin.cxx1
-rw-r--r--src/FilterRegistry.cxx1
-rw-r--r--src/GlobalEvents.cxx1
-rw-r--r--src/IcyMetaDataServer.cxx1
-rw-r--r--src/InotifyQueue.cxx1
-rw-r--r--src/InotifySource.hxx1
-rw-r--r--src/Log.cxx15
-rw-r--r--src/LogInit.cxx6
-rw-r--r--src/LogV.hxx2
-rw-r--r--src/Main.cxx3
-rw-r--r--src/Mapper.cxx2
-rw-r--r--src/Mapper.hxx1
-rw-r--r--src/MixerControl.cxx1
-rw-r--r--src/MixerControl.hxx2
-rw-r--r--src/OutputAPI.hxx4
-rw-r--r--src/OutputAll.hxx2
-rw-r--r--src/OutputCommand.cxx1
-rw-r--r--src/OutputControl.cxx3
-rw-r--r--src/OutputControl.hxx28
-rw-r--r--src/OutputInit.cxx1
-rw-r--r--src/OutputState.cxx1
-rw-r--r--src/OutputThread.hxx3
-rw-r--r--src/Page.hxx2
-rw-r--r--src/PlayerControl.cxx3
-rw-r--r--src/PlayerThread.cxx1
-rw-r--r--src/Playlist.cxx1
-rw-r--r--src/PlaylistAny.cxx1
-rw-r--r--src/PlaylistFile.cxx3
-rw-r--r--src/PlaylistFile.hxx1
-rw-r--r--src/PlaylistGlobal.cxx1
-rw-r--r--src/PlaylistPrint.cxx2
-rw-r--r--src/PlaylistQueue.cxx1
-rw-r--r--src/PlaylistState.hxx6
-rw-r--r--src/PlaylistVector.cxx1
-rw-r--r--src/Queue.cxx2
-rw-r--r--src/QueuePrint.cxx5
-rw-r--r--src/ReplayGainConfig.cxx2
-rw-r--r--src/Song.hxx2
-rw-r--r--src/SongSave.cxx1
-rw-r--r--src/SongSort.cxx2
-rw-r--r--src/SongSort.hxx2
-rw-r--r--src/SongSticker.hxx2
-rw-r--r--src/SongUpdate.cxx6
-rw-r--r--src/StateFile.cxx2
-rw-r--r--src/StickerDatabase.hxx8
-rw-r--r--src/TagFile.hxx2
-rw-r--r--src/TextInputStream.cxx1
-rw-r--r--src/TextInputStream.hxx1
-rw-r--r--src/Timer.cxx2
-rw-r--r--src/UpdateArchive.hxx1
-rw-r--r--src/UpdateRemove.cxx1
-rw-r--r--src/UpdateSong.cxx1
-rw-r--r--src/UpdateWalk.cxx4
-rw-r--r--src/ZeroconfAvahi.cxx3
-rw-r--r--src/archive/Bzip2ArchivePlugin.cxx2
-rw-r--r--src/archive/Iso9660ArchivePlugin.cxx1
-rw-r--r--src/archive/ZzipArchivePlugin.cxx2
-rw-r--r--src/command/DatabaseCommands.cxx4
-rw-r--r--src/command/MessageCommands.cxx1
-rw-r--r--src/command/OtherCommands.cxx4
-rw-r--r--src/command/OutputCommands.cxx2
-rw-r--r--src/command/PlaylistCommands.cxx3
-rw-r--r--src/command/StickerCommands.cxx2
-rw-r--r--src/db/ProxyDatabasePlugin.cxx1
-rw-r--r--src/db/SimpleDatabasePlugin.cxx1
-rw-r--r--src/decoder/DsdLib.cxx2
-rw-r--r--src/decoder/DsdiffDecoderPlugin.cxx3
-rw-r--r--src/decoder/DsfDecoderPlugin.cxx3
-rw-r--r--src/decoder/FfmpegDecoderPlugin.cxx1
-rw-r--r--src/decoder/FfmpegMetaData.hxx4
-rw-r--r--src/decoder/FlacCommon.cxx4
-rw-r--r--src/decoder/FlacCommon.hxx1
-rw-r--r--src/decoder/FlacDecoderPlugin.cxx4
-rw-r--r--src/decoder/FlacMetadata.cxx2
-rw-r--r--src/decoder/FlacMetadata.hxx6
-rw-r--r--src/decoder/MadDecoderPlugin.cxx1
-rw-r--r--src/decoder/MikmodDecoderPlugin.cxx2
-rw-r--r--src/decoder/MpcdecDecoderPlugin.cxx2
-rw-r--r--src/decoder/Mpg123DecoderPlugin.cxx3
-rw-r--r--src/decoder/OggCodec.cxx1
-rw-r--r--src/decoder/OggCodec.hxx3
-rw-r--r--src/decoder/OggFind.hxx1
-rw-r--r--src/decoder/OpusDecoderPlugin.cxx2
-rw-r--r--src/decoder/OpusHead.cxx1
-rw-r--r--src/decoder/PcmDecoderPlugin.cxx2
-rw-r--r--src/decoder/VorbisComments.cxx2
-rw-r--r--src/decoder/VorbisComments.hxx2
-rw-r--r--src/decoder/VorbisDecoderPlugin.cxx3
-rw-r--r--src/decoder/VorbisDomain.hxx4
-rw-r--r--src/encoder/FlacEncoderPlugin.cxx1
-rw-r--r--src/encoder/VorbisEncoderPlugin.cxx2
-rw-r--r--src/event/BufferedSocket.cxx3
-rw-r--r--src/event/BufferedSocket.hxx2
-rw-r--r--src/event/FullyBufferedSocket.cxx1
-rw-r--r--src/event/FullyBufferedSocket.hxx1
-rw-r--r--src/event/IdleMonitor.cxx2
-rw-r--r--src/event/MultiSocketMonitor.hxx1
-rw-r--r--src/event/ServerSocket.cxx1
-rw-r--r--src/event/SignalMonitor.cxx2
-rw-r--r--src/event/SocketMonitor.cxx1
-rw-r--r--src/filter/ConvertFilterPlugin.cxx1
-rw-r--r--src/filter/NormalizeFilterPlugin.cxx1
-rw-r--r--src/filter/RouteFilterPlugin.cxx1
-rw-r--r--src/fs/AllocatedPath.cxx1
-rw-r--r--src/fs/AllocatedPath.hxx2
-rw-r--r--src/fs/Charset.cxx2
-rw-r--r--src/fs/Config.cxx6
-rw-r--r--src/fs/FileSystem.hxx1
-rw-r--r--src/fs/Path.hxx2
-rw-r--r--src/fs/Traits.hxx2
-rw-r--r--src/input/ArchiveInputPlugin.cxx1
-rw-r--r--src/input/FfmpegInputPlugin.cxx1
-rw-r--r--src/input/FileInputPlugin.cxx2
-rw-r--r--src/input/MmsInputPlugin.cxx3
-rw-r--r--src/input/RewindInputPlugin.cxx1
-rw-r--r--src/ls.cxx2
-rw-r--r--src/mixer/OssMixerPlugin.cxx4
-rw-r--r--src/mixer/PulseMixerPlugin.cxx2
-rw-r--r--src/mixer/PulseMixerPlugin.hxx7
-rw-r--r--src/mixer/RoarMixerPlugin.cxx2
-rw-r--r--src/output/FifoOutputPlugin.cxx3
-rw-r--r--src/output/JackOutputPlugin.cxx4
-rw-r--r--src/output/NullOutputPlugin.cxx2
-rw-r--r--src/output/PulseOutputPlugin.hxx2
-rw-r--r--src/pcm/PcmBuffer.cxx1
-rw-r--r--src/pcm/PcmConvert.hxx3
-rw-r--r--src/pcm/PcmDsd.cxx1
-rw-r--r--src/pcm/PcmDsdUsb.cxx2
-rw-r--r--src/pcm/PcmMix.cxx1
-rw-r--r--src/playlist/AsxPlaylistPlugin.cxx1
-rw-r--r--src/playlist/CuePlaylistPlugin.cxx5
-rw-r--r--src/playlist/EmbeddedCuePlaylistPlugin.cxx2
-rw-r--r--src/playlist/RssPlaylistPlugin.cxx1
-rw-r--r--src/playlist/XspfPlaylistPlugin.cxx1
-rw-r--r--src/system/EPollFD.hxx1
-rw-r--r--src/system/Resolver.cxx3
-rw-r--r--src/system/Resolver.hxx7
-rw-r--r--src/system/SignalFD.cxx1
-rw-r--r--src/system/SocketError.hxx6
-rw-r--r--src/tag/Aiff.cxx2
-rw-r--r--src/tag/ApeTag.hxx2
-rw-r--r--src/tag/Riff.cxx1
-rw-r--r--src/tag/Tag.hxx4
-rw-r--r--src/tag/TagConfig.cxx2
-rw-r--r--src/tag/TagConfig.hxx2
-rw-r--r--src/tag/TagId3.cxx1
-rw-r--r--src/tag/TagId3.hxx10
-rw-r--r--src/tag/TagRva2.cxx4
-rw-r--r--src/tag/TagRva2.hxx2
-rw-r--r--src/util/Error.hxx1
-rw-r--r--src/util/FormatString.cxx5
-rw-r--r--src/util/Tokenizer.cxx3
185 files changed, 113 insertions, 337 deletions
diff --git a/src/ArchiveFile.hxx b/src/ArchiveFile.hxx
index 4bdba62ab..154b4b297 100644
--- a/src/ArchiveFile.hxx
+++ b/src/ArchiveFile.hxx
@@ -23,6 +23,8 @@
class Mutex;
class Cond;
class Error;
+class ArchiveVisitor;
+struct InputStream;
class ArchiveFile {
public:
diff --git a/src/ArchiveLookup.cxx b/src/ArchiveLookup.cxx
index 7a93c136a..65925a6e3 100644
--- a/src/ArchiveLookup.cxx
+++ b/src/ArchiveLookup.cxx
@@ -24,7 +24,6 @@
#include <string.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <errno.h>
gcc_pure
diff --git a/src/ArchivePlugin.hxx b/src/ArchivePlugin.hxx
index 6439c7242..c23826540 100644
--- a/src/ArchivePlugin.hxx
+++ b/src/ArchivePlugin.hxx
@@ -20,9 +20,7 @@
#ifndef MPD_ARCHIVE_PLUGIN_HXX
#define MPD_ARCHIVE_PLUGIN_HXX
-struct InputStream;
class ArchiveFile;
-class ArchiveVisitor;
class Error;
struct archive_plugin {
diff --git a/src/AvahiPoll.cxx b/src/AvahiPoll.cxx
index 0d5a43dad..d6f8b9f79 100644
--- a/src/AvahiPoll.cxx
+++ b/src/AvahiPoll.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "AvahiPoll.hxx"
-#include "event/Loop.hxx"
#include "event/SocketMonitor.hxx"
#include "event/TimeoutMonitor.hxx"
diff --git a/src/Client.hxx b/src/Client.hxx
index f0bc6b0f7..c794bf0ee 100644
--- a/src/Client.hxx
+++ b/src/Client.hxx
@@ -165,7 +165,7 @@ void client_manager_init(void);
void
client_new(EventLoop &loop, Partition &partition,
- int fd, const struct sockaddr *sa, size_t sa_length, int uid);
+ int fd, const sockaddr *sa, size_t sa_length, int uid);
/**
* Write a C string to the client.
diff --git a/src/ClientFile.cxx b/src/ClientFile.cxx
index 382b76083..d1b00ebbc 100644
--- a/src/ClientFile.cxx
+++ b/src/ClientFile.cxx
@@ -24,11 +24,8 @@
#include "fs/Path.hxx"
#include "fs/FileSystem.hxx"
#include "util/Error.hxx"
-#include "util/Domain.hxx"
#include <sys/stat.h>
-#include <sys/types.h>
-#include <errno.h>
#include <unistd.h>
bool
diff --git a/src/ClientGlobal.cxx b/src/ClientGlobal.cxx
index e79f3430b..8fb1f8e49 100644
--- a/src/ClientGlobal.cxx
+++ b/src/ClientGlobal.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "ClientInternal.hxx"
-#include "ClientList.hxx"
#include "ConfigGlobal.hxx"
#define CLIENT_TIMEOUT_DEFAULT (60)
diff --git a/src/ClientNew.cxx b/src/ClientNew.cxx
index c6df5a883..1bcc2f4d3 100644
--- a/src/ClientNew.cxx
+++ b/src/ClientNew.cxx
@@ -31,13 +31,11 @@
#include <glib.h>
#include <assert.h>
-#include <sys/types.h>
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/socket.h>
#endif
-#include <unistd.h>
#ifdef HAVE_LIBWRAP
#include <tcpd.h>
diff --git a/src/ClientRead.cxx b/src/ClientRead.cxx
index 22edefe60..205884815 100644
--- a/src/ClientRead.cxx
+++ b/src/ClientRead.cxx
@@ -23,7 +23,6 @@
#include "event/Loop.hxx"
#include "util/CharUtil.hxx"
-#include <assert.h>
#include <string.h>
BufferedSocket::InputResult
diff --git a/src/ClientSubscribe.cxx b/src/ClientSubscribe.cxx
index 3a9f1b19c..f4d9ad316 100644
--- a/src/ClientSubscribe.cxx
+++ b/src/ClientSubscribe.cxx
@@ -22,11 +22,6 @@
#include "Idle.hxx"
#include <assert.h>
-#include <string.h>
-
- bool Unsubscribe(const char *channel);
- void UnsubscribeAll();
- bool PushMessage(const ClientMessage &msg);
Client::SubscribeResult
Client::Subscribe(const char *channel)
diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx
index 6c0f7e6a1..8d5b0dd31 100644
--- a/src/CommandLine.cxx
+++ b/src/CommandLine.cxx
@@ -38,7 +38,6 @@
#include "util/Domain.hxx"
#include "util/OptionDef.hxx"
#include "util/OptionParser.hxx"
-#include "system/FatalError.hxx"
#ifdef ENABLE_ENCODER
#include "EncoderList.hxx"
diff --git a/src/ConfigData.cxx b/src/ConfigData.cxx
index c6cabee6e..b3c5c75fc 100644
--- a/src/ConfigData.cxx
+++ b/src/ConfigData.cxx
@@ -26,7 +26,6 @@
#include "system/FatalError.hxx"
#include <assert.h>
-#include <string.h>
#include <stdlib.h>
int
diff --git a/src/ConfigFile.cxx b/src/ConfigFile.cxx
index 90859a89a..16b23bc0d 100644
--- a/src/ConfigFile.cxx
+++ b/src/ConfigFile.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "ConfigFile.hxx"
-#include "ConfigError.hxx"
#include "ConfigData.hxx"
#include "ConfigTemplates.hxx"
#include "util/Tokenizer.hxx"
@@ -32,9 +31,7 @@
#include "Log.hxx"
#include <assert.h>
-#include <string.h>
#include <stdio.h>
-#include <errno.h>
#define MAX_STRING_SIZE MPD_PATH_MAX+80
diff --git a/src/ConfigGlobal.cxx b/src/ConfigGlobal.cxx
index 49b9c08fb..93929ccb4 100644
--- a/src/ConfigGlobal.cxx
+++ b/src/ConfigGlobal.cxx
@@ -30,8 +30,6 @@
#include "system/FatalError.hxx"
#include "Log.hxx"
-#include <assert.h>
-#include <string.h>
#include <stdlib.h>
static ConfigData config_data;
diff --git a/src/ConfigTemplates.hxx b/src/ConfigTemplates.hxx
index 4f5460460..1fbe3b737 100644
--- a/src/ConfigTemplates.hxx
+++ b/src/ConfigTemplates.hxx
@@ -20,8 +20,6 @@
#ifndef MPD_CONFIG_TEMPLATES_HXX
#define MPD_CONFIG_TEMPLATES_HXX
-#include "ConfigOption.hxx"
-
struct ConfigTemplate {
const char *const name;
const bool repeatable;
diff --git a/src/CrossFade.cxx b/src/CrossFade.cxx
index 601d74dc2..c1dafd951 100644
--- a/src/CrossFade.cxx
+++ b/src/CrossFade.cxx
@@ -26,8 +26,6 @@
#include "Log.hxx"
#include <assert.h>
-#include <string.h>
-#include <stdlib.h>
static constexpr Domain cross_fade_domain("cross_fade");
diff --git a/src/Daemon.cxx b/src/Daemon.cxx
index 4f214517e..1061cce27 100644
--- a/src/Daemon.cxx
+++ b/src/Daemon.cxx
@@ -30,9 +30,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#ifndef WIN32
diff --git a/src/DatabaseGlue.cxx b/src/DatabaseGlue.cxx
index 013a3e329..bc99baa4f 100644
--- a/src/DatabaseGlue.cxx
+++ b/src/DatabaseGlue.cxx
@@ -21,7 +21,6 @@
#include "DatabaseGlue.hxx"
#include "DatabaseSimple.hxx"
#include "DatabaseRegistry.hxx"
-#include "DatabaseSave.hxx"
#include "DatabaseError.hxx"
#include "Directory.hxx"
#include "util/Error.hxx"
@@ -30,13 +29,8 @@
#include "DatabasePlugin.hxx"
#include "db/SimpleDatabasePlugin.hxx"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
#include <assert.h>
#include <string.h>
-#include <errno.h>
-
static Database *db;
static bool db_is_open;
diff --git a/src/DatabaseHelpers.hxx b/src/DatabaseHelpers.hxx
index d8806bc69..9dc82bcda 100644
--- a/src/DatabaseHelpers.hxx
+++ b/src/DatabaseHelpers.hxx
@@ -22,7 +22,6 @@
#include "DatabaseVisitor.hxx"
#include "tag/TagType.h"
-#include "Compiler.h"
class Error;
class Database;
diff --git a/src/DatabaseLock.cxx b/src/DatabaseLock.cxx
index d85f72d3b..660515d4e 100644
--- a/src/DatabaseLock.cxx
+++ b/src/DatabaseLock.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "DatabaseLock.hxx"
-#include "Compiler.h"
Mutex db_mutex;
diff --git a/src/DatabasePrint.cxx b/src/DatabasePrint.cxx
index 3732e98f3..e500ee0c8 100644
--- a/src/DatabasePrint.cxx
+++ b/src/DatabasePrint.cxx
@@ -21,7 +21,6 @@
#include "DatabasePrint.hxx"
#include "DatabaseSelection.hxx"
#include "SongFilter.hxx"
-#include "PlaylistVector.hxx"
#include "SongPrint.hxx"
#include "TimePrint.hxx"
#include "Directory.hxx"
diff --git a/src/DatabasePrint.hxx b/src/DatabasePrint.hxx
index 36a68d87b..0ed7ff1e7 100644
--- a/src/DatabasePrint.hxx
+++ b/src/DatabasePrint.hxx
@@ -24,7 +24,6 @@
class SongFilter;
struct DatabaseSelection;
-struct db_visitor;
class Client;
class Error;
diff --git a/src/DatabaseQueue.cxx b/src/DatabaseQueue.cxx
index 98f80c5b6..b093ce073 100644
--- a/src/DatabaseQueue.cxx
+++ b/src/DatabaseQueue.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "DatabaseQueue.hxx"
-#include "DatabaseSelection.hxx"
#include "DatabaseGlue.hxx"
#include "DatabasePlugin.hxx"
#include "Partition.hxx"
diff --git a/src/DatabaseSave.cxx b/src/DatabaseSave.cxx
index abfd4a34f..73de3b951 100644
--- a/src/DatabaseSave.cxx
+++ b/src/DatabaseSave.cxx
@@ -23,7 +23,6 @@
#include "DatabaseError.hxx"
#include "Directory.hxx"
#include "DirectorySave.hxx"
-#include "Song.hxx"
#include "TextFile.hxx"
#include "tag/Tag.hxx"
#include "tag/TagSettings.h"
@@ -33,7 +32,6 @@
#include <glib.h>
-#include <assert.h>
#include <string.h>
#include <stdlib.h>
diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx
index 1494e3f80..4c6a6f918 100644
--- a/src/DecoderAPI.cxx
+++ b/src/DecoderAPI.cxx
@@ -34,7 +34,6 @@
#include "Log.hxx"
#include <assert.h>
-#include <stdlib.h>
#include <string.h>
#include <math.h>
diff --git a/src/DecoderAPI.hxx b/src/DecoderAPI.hxx
index 2ee42483c..df1b5c40d 100644
--- a/src/DecoderAPI.hxx
+++ b/src/DecoderAPI.hxx
@@ -27,6 +27,8 @@
#ifndef MPD_DECODER_API_HXX
#define MPD_DECODER_API_HXX
+// IWYU pragma: begin_exports
+
#include "check.h"
#include "DecoderCommand.hxx"
#include "DecoderPlugin.hxx"
@@ -36,6 +38,8 @@
#include "MixRampInfo.hxx"
#include "ConfigData.hxx"
+// IWYU pragma: end_exports
+
/**
* Notify the player thread that it has finished initialization and
* that it has read the song's meta data.
diff --git a/src/DecoderControl.cxx b/src/DecoderControl.cxx
index ab460ced0..b63dba3a0 100644
--- a/src/DecoderControl.cxx
+++ b/src/DecoderControl.cxx
@@ -22,8 +22,6 @@
#include "MusicPipe.hxx"
#include "Song.hxx"
-#include <glib.h>
-
#include <assert.h>
DecoderControl::DecoderControl(Mutex &_mutex, Cond &_client_cond)
diff --git a/src/DecoderInternal.hxx b/src/DecoderInternal.hxx
index 87c6828d4..fbd613a36 100644
--- a/src/DecoderInternal.hxx
+++ b/src/DecoderInternal.hxx
@@ -20,13 +20,11 @@
#ifndef MPD_DECODER_INTERNAL_HXX
#define MPD_DECODER_INTERNAL_HXX
-#include "DecoderCommand.hxx"
#include "ReplayGainInfo.hxx"
#include "util/Error.hxx"
class PcmConvert;
struct DecoderControl;
-struct InputStream;
struct Tag;
struct Decoder {
diff --git a/src/DecoderPlugin.hxx b/src/DecoderPlugin.hxx
index 6b0340123..41e009bec 100644
--- a/src/DecoderPlugin.hxx
+++ b/src/DecoderPlugin.hxx
@@ -24,7 +24,6 @@
struct config_param;
struct InputStream;
-struct Tag;
struct tag_handler;
/**
diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx
index 2df131d19..dedc5834e 100644
--- a/src/DecoderThread.cxx
+++ b/src/DecoderThread.cxx
@@ -29,7 +29,6 @@
#include "fs/Traits.hxx"
#include "fs/AllocatedPath.hxx"
#include "DecoderAPI.hxx"
-#include "tag/Tag.hxx"
#include "InputStream.hxx"
#include "DecoderList.hxx"
#include "util/UriUtil.hxx"
diff --git a/src/DirectorySave.cxx b/src/DirectorySave.cxx
index fa330d126..5e0cec8a9 100644
--- a/src/DirectorySave.cxx
+++ b/src/DirectorySave.cxx
@@ -30,9 +30,6 @@
#include <glib.h>
-#include <assert.h>
-#include <string.h>
-
#define DIRECTORY_DIR "directory: "
#define DIRECTORY_MTIME "mtime: "
#define DIRECTORY_BEGIN "begin: "
diff --git a/src/EncoderAPI.hxx b/src/EncoderAPI.hxx
index b3397f25c..3ae1879cb 100644
--- a/src/EncoderAPI.hxx
+++ b/src/EncoderAPI.hxx
@@ -25,9 +25,13 @@
#ifndef MPD_ENCODER_API_HXX
#define MPD_ENCODER_API_HXX
+// IWYU pragma: begin_exports
+
#include "EncoderPlugin.hxx"
#include "AudioFormat.hxx"
#include "tag/Tag.hxx"
#include "ConfigData.hxx"
+// IWYU pragma: end_exports
+
#endif
diff --git a/src/FilterConfig.cxx b/src/FilterConfig.cxx
index cfac1c756..423b84086 100644
--- a/src/FilterConfig.cxx
+++ b/src/FilterConfig.cxx
@@ -21,8 +21,6 @@
#include "FilterConfig.hxx"
#include "filter/ChainFilterPlugin.hxx"
#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
-#include "FilterRegistry.hxx"
#include "ConfigData.hxx"
#include "ConfigOption.hxx"
#include "ConfigGlobal.hxx"
diff --git a/src/FilterPlugin.cxx b/src/FilterPlugin.cxx
index 608542f92..d5e3b664a 100644
--- a/src/FilterPlugin.cxx
+++ b/src/FilterPlugin.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
#include "FilterRegistry.hxx"
#include "ConfigData.hxx"
#include "ConfigError.hxx"
diff --git a/src/FilterRegistry.cxx b/src/FilterRegistry.cxx
index b3b08505e..427f4e875 100644
--- a/src/FilterRegistry.cxx
+++ b/src/FilterRegistry.cxx
@@ -21,7 +21,6 @@
#include "FilterRegistry.hxx"
#include "FilterPlugin.hxx"
-#include <stddef.h>
#include <string.h>
const struct filter_plugin *const filter_plugins[] = {
diff --git a/src/GlobalEvents.cxx b/src/GlobalEvents.cxx
index 86bfb3e2a..b7ba85286 100644
--- a/src/GlobalEvents.cxx
+++ b/src/GlobalEvents.cxx
@@ -21,7 +21,6 @@
#include "GlobalEvents.hxx"
#include "util/Manual.hxx"
#include "event/DeferredMonitor.hxx"
-#include "Compiler.h"
#include <atomic>
diff --git a/src/IcyMetaDataServer.cxx b/src/IcyMetaDataServer.cxx
index f5e981c2f..eebe8d0d4 100644
--- a/src/IcyMetaDataServer.cxx
+++ b/src/IcyMetaDataServer.cxx
@@ -25,7 +25,6 @@
#include <glib.h>
-#include <assert.h>
#include <string.h>
char*
diff --git a/src/InotifyQueue.cxx b/src/InotifyQueue.cxx
index c24816241..7a652ef01 100644
--- a/src/InotifyQueue.cxx
+++ b/src/InotifyQueue.cxx
@@ -21,7 +21,6 @@
#include "InotifyQueue.hxx"
#include "InotifyDomain.hxx"
#include "UpdateGlue.hxx"
-#include "event/Loop.hxx"
#include "Log.hxx"
#include <string.h>
diff --git a/src/InotifySource.hxx b/src/InotifySource.hxx
index f6ddea966..026b156e6 100644
--- a/src/InotifySource.hxx
+++ b/src/InotifySource.hxx
@@ -22,7 +22,6 @@
#include "event/SocketMonitor.hxx"
#include "util/FifoBuffer.hxx"
-#include "Compiler.h"
class Error;
diff --git a/src/Log.cxx b/src/Log.cxx
index a46c0ced8..44dfe14ce 100644
--- a/src/Log.cxx
+++ b/src/Log.cxx
@@ -19,28 +19,13 @@
#include "config.h"
#include "LogV.hxx"
-#include "ConfigData.hxx"
-#include "ConfigGlobal.hxx"
-#include "ConfigOption.hxx"
-#include "system/fd_util.h"
-#include "system/FatalError.hxx"
-#include "fs/Path.hxx"
-#include "fs/FileSystem.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
-#include "system/FatalError.hxx"
#include <glib.h>
#include <assert.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <fcntl.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
#include <errno.h>
static GLogLevelFlags
diff --git a/src/LogInit.cxx b/src/LogInit.cxx
index 41d13a5e8..d9f84d6a5 100644
--- a/src/LogInit.cxx
+++ b/src/LogInit.cxx
@@ -23,7 +23,6 @@
#include "ConfigData.hxx"
#include "ConfigGlobal.hxx"
#include "ConfigOption.hxx"
-#include "system/fd_util.h"
#include "system/FatalError.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
@@ -33,16 +32,11 @@
#include "system/FatalError.hxx"
#include <assert.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <string.h>
-#include <stdarg.h>
#include <fcntl.h>
#include <stdio.h>
-#include <stdlib.h>
#include <time.h>
#include <unistd.h>
-#include <errno.h>
#include <glib.h>
#ifdef HAVE_SYSLOG
diff --git a/src/LogV.hxx b/src/LogV.hxx
index 4bd4f801d..9f3687ba0 100644
--- a/src/LogV.hxx
+++ b/src/LogV.hxx
@@ -20,7 +20,7 @@
#ifndef MPD_LOGV_HXX
#define MPD_LOGV_HXX
-#include "Log.hxx"
+#include "Log.hxx" // IWYU pragma: export
#include <stdarg.h>
diff --git a/src/Main.cxx b/src/Main.cxx
index 83af5d7ea..dcf080d0d 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -80,10 +80,7 @@
#include <glib.h>
-#include <unistd.h>
#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
#ifdef HAVE_LOCALE_H
#include <locale.h>
diff --git a/src/Mapper.cxx b/src/Mapper.cxx
index cbe45daa0..2483f2fcf 100644
--- a/src/Mapper.cxx
+++ b/src/Mapper.cxx
@@ -36,9 +36,7 @@
#include <assert.h>
#include <string.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <errno.h>
-#include <dirent.h>
static constexpr Domain mapper_domain("mapper");
diff --git a/src/Mapper.hxx b/src/Mapper.hxx
index 947fd2822..aeaa15de5 100644
--- a/src/Mapper.hxx
+++ b/src/Mapper.hxx
@@ -30,7 +30,6 @@
#define PLAYLIST_FILE_SUFFIX ".m3u"
-class Path;
class AllocatedPath;
struct Directory;
struct Song;
diff --git a/src/MixerControl.cxx b/src/MixerControl.cxx
index dd4f03543..08973a698 100644
--- a/src/MixerControl.cxx
+++ b/src/MixerControl.cxx
@@ -23,7 +23,6 @@
#include "util/Error.hxx"
#include <assert.h>
-#include <stddef.h>
Mixer *
mixer_new(const struct mixer_plugin *plugin, void *ao,
diff --git a/src/MixerControl.hxx b/src/MixerControl.hxx
index c1ee01eec..e7e825e7c 100644
--- a/src/MixerControl.hxx
+++ b/src/MixerControl.hxx
@@ -31,7 +31,7 @@ struct mixer_plugin;
struct config_param;
Mixer *
-mixer_new(const struct mixer_plugin *plugin, void *ao,
+mixer_new(const mixer_plugin *plugin, void *ao,
const config_param &param,
Error &error);
diff --git a/src/OutputAPI.hxx b/src/OutputAPI.hxx
index 73cbaf183..437141c5c 100644
--- a/src/OutputAPI.hxx
+++ b/src/OutputAPI.hxx
@@ -20,10 +20,14 @@
#ifndef MPD_OUTPUT_API_HXX
#define MPD_OUTPUT_API_HxX
+// IWYU pragma: begin_exports
+
#include "OutputPlugin.hxx"
#include "OutputInternal.hxx"
#include "AudioFormat.hxx"
#include "tag/Tag.hxx"
#include "ConfigData.hxx"
+// IWYU pragma: end_exports
+
#endif
diff --git a/src/OutputAll.hxx b/src/OutputAll.hxx
index 98061c345..2d9b1477f 100644
--- a/src/OutputAll.hxx
+++ b/src/OutputAll.hxx
@@ -115,7 +115,7 @@ audio_output_all_set_replay_gain_mode(ReplayGainMode mode);
* (all closed then)
*/
bool
-audio_output_all_play(struct music_chunk *chunk, Error &error);
+audio_output_all_play(music_chunk *chunk, Error &error);
/**
* Checks if the output devices have drained their music pipe, and
diff --git a/src/OutputCommand.cxx b/src/OutputCommand.cxx
index 10b5bb322..efc8081e0 100644
--- a/src/OutputCommand.cxx
+++ b/src/OutputCommand.cxx
@@ -28,7 +28,6 @@
#include "OutputCommand.hxx"
#include "OutputAll.hxx"
#include "OutputInternal.hxx"
-#include "OutputPlugin.hxx"
#include "PlayerControl.hxx"
#include "MixerControl.hxx"
#include "Idle.hxx"
diff --git a/src/OutputControl.cxx b/src/OutputControl.cxx
index b2e9b284f..be0d2bec9 100644
--- a/src/OutputControl.cxx
+++ b/src/OutputControl.cxx
@@ -24,16 +24,13 @@
#include "OutputInternal.hxx"
#include "OutputPlugin.hxx"
#include "OutputError.hxx"
-#include "MixerPlugin.hxx"
#include "MixerControl.hxx"
#include "notify.hxx"
#include "filter/ReplayGainFilterPlugin.hxx"
-#include "FilterPlugin.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
#include <assert.h>
-#include <stdlib.h>
/** after a failure, wait this number of seconds before
automatically reopening the device */
diff --git a/src/OutputControl.hxx b/src/OutputControl.hxx
index d8f0b432d..c63383293 100644
--- a/src/OutputControl.hxx
+++ b/src/OutputControl.hxx
@@ -30,20 +30,20 @@ struct config_param;
class MusicPipe;
void
-audio_output_set_replay_gain_mode(struct audio_output *ao,
+audio_output_set_replay_gain_mode(audio_output *ao,
ReplayGainMode mode);
/**
* Enables the device.
*/
void
-audio_output_enable(struct audio_output *ao);
+audio_output_enable(audio_output *ao);
/**
* Disables the device.
*/
void
-audio_output_disable(struct audio_output *ao);
+audio_output_disable(audio_output *ao);
/**
* Opens or closes the device, depending on the "enabled" flag.
@@ -51,40 +51,44 @@ audio_output_disable(struct audio_output *ao);
* @return true if the device is open
*/
bool
-audio_output_update(struct audio_output *ao,
+audio_output_update(audio_output *ao,
AudioFormat audio_format,
const MusicPipe &mp);
void
-audio_output_play(struct audio_output *ao);
+audio_output_play(audio_output *ao);
-void audio_output_pause(struct audio_output *ao);
+void
+audio_output_pause(audio_output *ao);
void
-audio_output_drain_async(struct audio_output *ao);
+audio_output_drain_async(audio_output *ao);
/**
* Clear the "allow_play" flag and send the "CANCEL" command
* asynchronously. To finish the operation, the caller has to call
* audio_output_allow_play().
*/
-void audio_output_cancel(struct audio_output *ao);
+void
+audio_output_cancel(audio_output *ao);
/**
* Set the "allow_play" and signal the thread.
*/
void
-audio_output_allow_play(struct audio_output *ao);
+audio_output_allow_play(audio_output *ao);
-void audio_output_close(struct audio_output *ao);
+void
+audio_output_close(audio_output *ao);
/**
* Closes the audio output, but if the "always_on" flag is set, put it
* into pause mode instead.
*/
void
-audio_output_release(struct audio_output *ao);
+audio_output_release(audio_output *ao);
-void audio_output_finish(struct audio_output *ao);
+void
+audio_output_finish(audio_output *ao);
#endif
diff --git a/src/OutputInit.cxx b/src/OutputInit.cxx
index 4a7978908..c9e03e0f2 100644
--- a/src/OutputInit.cxx
+++ b/src/OutputInit.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "OutputInternal.hxx"
-#include "OutputControl.hxx"
#include "OutputList.hxx"
#include "OutputError.hxx"
#include "OutputAPI.hxx"
diff --git a/src/OutputState.cxx b/src/OutputState.cxx
index a3650413c..8705176ae 100644
--- a/src/OutputState.cxx
+++ b/src/OutputState.cxx
@@ -33,7 +33,6 @@
#include <assert.h>
#include <stdlib.h>
-#include <string.h>
#define AUDIO_DEVICE_STATE "audio_device_state:"
diff --git a/src/OutputThread.hxx b/src/OutputThread.hxx
index 1a7932162..980d203fe 100644
--- a/src/OutputThread.hxx
+++ b/src/OutputThread.hxx
@@ -22,6 +22,7 @@
struct audio_output;
-void audio_output_thread_start(struct audio_output *ao);
+void
+audio_output_thread_start(audio_output *ao);
#endif
diff --git a/src/Page.hxx b/src/Page.hxx
index 27c6092cc..4e1302ba5 100644
--- a/src/Page.hxx
+++ b/src/Page.hxx
@@ -27,8 +27,6 @@
#include "util/RefCount.hxx"
-#include <algorithm>
-
#include <stddef.h>
/**
diff --git a/src/PlayerControl.cxx b/src/PlayerControl.cxx
index f180874b0..74b4673bc 100644
--- a/src/PlayerControl.cxx
+++ b/src/PlayerControl.cxx
@@ -21,9 +21,8 @@
#include "PlayerControl.hxx"
#include "Idle.hxx"
#include "Song.hxx"
-#include "DecoderControl.hxx"
-#include <cmath>
+#include <algorithm>
#include <assert.h>
diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx
index 6fb41bf35..42c7120f0 100644
--- a/src/PlayerThread.cxx
+++ b/src/PlayerThread.cxx
@@ -25,7 +25,6 @@
#include "MusicBuffer.hxx"
#include "MusicChunk.hxx"
#include "Song.hxx"
-#include "Main.hxx"
#include "system/FatalError.hxx"
#include "CrossFade.hxx"
#include "PlayerControl.hxx"
diff --git a/src/Playlist.cxx b/src/Playlist.cxx
index 8d9ab24a3..f566527ac 100644
--- a/src/Playlist.cxx
+++ b/src/Playlist.cxx
@@ -22,7 +22,6 @@
#include "PlaylistError.hxx"
#include "PlayerControl.hxx"
#include "Song.hxx"
-#include "tag/Tag.hxx"
#include "Idle.hxx"
#include "Log.hxx"
diff --git a/src/PlaylistAny.cxx b/src/PlaylistAny.cxx
index 52304700f..dfe3bfdff 100644
--- a/src/PlaylistAny.cxx
+++ b/src/PlaylistAny.cxx
@@ -21,7 +21,6 @@
#include "PlaylistAny.hxx"
#include "PlaylistMapper.hxx"
#include "PlaylistRegistry.hxx"
-#include "PlaylistError.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "InputStream.hxx"
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx
index e7dae6258..63a0807e9 100644
--- a/src/PlaylistFile.cxx
+++ b/src/PlaylistFile.cxx
@@ -43,10 +43,7 @@
#include <glib.h>
#include <assert.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
#include <string.h>
#include <errno.h>
diff --git a/src/PlaylistFile.hxx b/src/PlaylistFile.hxx
index f04530bcc..92030b1eb 100644
--- a/src/PlaylistFile.hxx
+++ b/src/PlaylistFile.hxx
@@ -24,7 +24,6 @@
#include <string>
struct Song;
-struct PlaylistInfo;
class PlaylistVector;
class Error;
diff --git a/src/PlaylistGlobal.cxx b/src/PlaylistGlobal.cxx
index 97902275b..0e8493687 100644
--- a/src/PlaylistGlobal.cxx
+++ b/src/PlaylistGlobal.cxx
@@ -24,7 +24,6 @@
#include "config.h"
#include "PlaylistGlobal.hxx"
-#include "Playlist.hxx"
#include "Main.hxx"
#include "Instance.hxx"
#include "GlobalEvents.hxx"
diff --git a/src/PlaylistPrint.cxx b/src/PlaylistPrint.cxx
index 8e3beaa47..5f1d3c893 100644
--- a/src/PlaylistPrint.cxx
+++ b/src/PlaylistPrint.cxx
@@ -23,8 +23,6 @@
#include "PlaylistAny.hxx"
#include "PlaylistSong.hxx"
#include "Playlist.hxx"
-#include "PlaylistRegistry.hxx"
-#include "PlaylistPlugin.hxx"
#include "QueuePrint.hxx"
#include "SongEnumerator.hxx"
#include "SongPrint.hxx"
diff --git a/src/PlaylistQueue.cxx b/src/PlaylistQueue.cxx
index a8359d427..9e1295b35 100644
--- a/src/PlaylistQueue.cxx
+++ b/src/PlaylistQueue.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "PlaylistQueue.hxx"
-#include "PlaylistPlugin.hxx"
#include "PlaylistAny.hxx"
#include "PlaylistSong.hxx"
#include "Playlist.hxx"
diff --git a/src/PlaylistState.hxx b/src/PlaylistState.hxx
index 01cc94d03..408113e49 100644
--- a/src/PlaylistState.hxx
+++ b/src/PlaylistState.hxx
@@ -32,12 +32,12 @@ struct PlayerControl;
class TextFile;
void
-playlist_state_save(FILE *fp, const struct playlist &playlist,
+playlist_state_save(FILE *fp, const playlist &playlist,
PlayerControl &pc);
bool
playlist_state_restore(const char *line, TextFile &file,
- struct playlist &playlist, PlayerControl &pc);
+ playlist &playlist, PlayerControl &pc);
/**
* Generates a hash number for the current state of the playlist and
@@ -46,7 +46,7 @@ playlist_state_restore(const char *line, TextFile &file,
* be saved.
*/
unsigned
-playlist_state_get_hash(const struct playlist &playlist,
+playlist_state_get_hash(const playlist &playlist,
PlayerControl &c);
#endif
diff --git a/src/PlaylistVector.cxx b/src/PlaylistVector.cxx
index 5bb0cdf64..701edd896 100644
--- a/src/PlaylistVector.cxx
+++ b/src/PlaylistVector.cxx
@@ -24,7 +24,6 @@
#include <algorithm>
#include <assert.h>
-#include <string.h>
PlaylistVector::iterator
PlaylistVector::find(const char *name)
diff --git a/src/Queue.cxx b/src/Queue.cxx
index 451609438..92f92f77c 100644
--- a/src/Queue.cxx
+++ b/src/Queue.cxx
@@ -21,8 +21,6 @@
#include "Queue.hxx"
#include "Song.hxx"
-#include <stdlib.h>
-
queue::queue(unsigned _max_length)
:max_length(_max_length), length(0),
version(1),
diff --git a/src/QueuePrint.cxx b/src/QueuePrint.cxx
index d5651cde0..fec4a36fb 100644
--- a/src/QueuePrint.cxx
+++ b/src/QueuePrint.cxx
@@ -22,13 +22,8 @@
#include "Queue.hxx"
#include "SongFilter.hxx"
#include "SongPrint.hxx"
-#include "Mapper.hxx"
#include "Client.hxx"
-extern "C" {
-#include "Song.hxx"
-}
-
/**
* Send detailed information about a range of songs in the queue to a
* client.
diff --git a/src/ReplayGainConfig.cxx b/src/ReplayGainConfig.cxx
index 8f9b0d3f7..00ae5787f 100644
--- a/src/ReplayGainConfig.cxx
+++ b/src/ReplayGainConfig.cxx
@@ -22,12 +22,12 @@
#include "Idle.hxx"
#include "ConfigData.hxx"
#include "ConfigGlobal.hxx"
-#include "Playlist.hxx"
#include "system/FatalError.hxx"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#include <math.h>
ReplayGainMode replay_gain_mode = REPLAY_GAIN_OFF;
diff --git a/src/Song.hxx b/src/Song.hxx
index b74690e77..21e158560 100644
--- a/src/Song.hxx
+++ b/src/Song.hxx
@@ -26,7 +26,7 @@
#include <string>
#include <assert.h>
-#include <sys/time.h>
+#include <time.h>
#define SONG_FILE "file: "
#define SONG_TIME "Time: "
diff --git a/src/SongSave.cxx b/src/SongSave.cxx
index 63e279a16..c4acccc87 100644
--- a/src/SongSave.cxx
+++ b/src/SongSave.cxx
@@ -21,7 +21,6 @@
#include "SongSave.hxx"
#include "Song.hxx"
#include "TagSave.hxx"
-#include "Directory.hxx"
#include "TextFile.hxx"
#include "tag/Tag.hxx"
#include "tag/TagBuilder.hxx"
diff --git a/src/SongSort.cxx b/src/SongSort.cxx
index 4d422657a..1c2d01080 100644
--- a/src/SongSort.cxx
+++ b/src/SongSort.cxx
@@ -20,7 +20,6 @@
#include "config.h"
#include "SongSort.hxx"
#include "Song.hxx"
-#include "util/list.h"
#include "tag/Tag.hxx"
extern "C" {
@@ -29,7 +28,6 @@ extern "C" {
#include <glib.h>
-#include <assert.h>
#include <stdlib.h>
static const char *
diff --git a/src/SongSort.hxx b/src/SongSort.hxx
index b3b67b0c0..45ab3dae9 100644
--- a/src/SongSort.hxx
+++ b/src/SongSort.hxx
@@ -23,6 +23,6 @@
struct list_head;
void
-song_list_sort(struct list_head *songs);
+song_list_sort(list_head *songs);
#endif
diff --git a/src/SongSticker.hxx b/src/SongSticker.hxx
index 0923f0c3a..7a63a64b4 100644
--- a/src/SongSticker.hxx
+++ b/src/SongSticker.hxx
@@ -63,7 +63,7 @@ sticker_song_delete_value(const Song *song, const char *name);
* @param song the song object
* @return a sticker object, or NULL on error or if there is no sticker
*/
-struct sticker *
+sticker *
sticker_song_get(const Song *song);
/**
diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx
index a34734227..06742991e 100644
--- a/src/SongUpdate.cxx
+++ b/src/SongUpdate.cxx
@@ -20,14 +20,11 @@
#include "config.h" /* must be first for large file support */
#include "Song.hxx"
#include "util/UriUtil.hxx"
-#include "util/Error.hxx"
#include "Directory.hxx"
#include "Mapper.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/Traits.hxx"
#include "fs/FileSystem.hxx"
-#include "InputStream.hxx"
-#include "DecoderPlugin.hxx"
#include "DecoderList.hxx"
#include "tag/Tag.hxx"
#include "tag/TagBuilder.hxx"
@@ -35,13 +32,10 @@
#include "tag/TagId3.hxx"
#include "tag/ApeTag.hxx"
#include "TagFile.hxx"
-#include "thread/Cond.hxx"
#include <assert.h>
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <stdio.h>
Song *
Song::LoadFile(const char *path_utf8, Directory *parent)
diff --git a/src/StateFile.cxx b/src/StateFile.cxx
index 75cef2c99..e2e72c8ce 100644
--- a/src/StateFile.cxx
+++ b/src/StateFile.cxx
@@ -24,7 +24,7 @@
#include "TextFile.hxx"
#include "Partition.hxx"
#include "Volume.hxx"
-#include "event/Loop.hxx"
+
#include "fs/FileSystem.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
diff --git a/src/StickerDatabase.hxx b/src/StickerDatabase.hxx
index 42522b7b4..75f0fc77b 100644
--- a/src/StickerDatabase.hxx
+++ b/src/StickerDatabase.hxx
@@ -106,7 +106,7 @@ sticker_delete_value(const char *type, const char *uri, const char *name);
* @param sticker the sticker object to be freed
*/
void
-sticker_free(struct sticker *sticker);
+sticker_free(sticker *sticker);
/**
* Determines a single value in a sticker.
@@ -117,7 +117,7 @@ sticker_free(struct sticker *sticker);
*/
gcc_pure
const char *
-sticker_get_value(const struct sticker &sticker, const char *name);
+sticker_get_value(const sticker &sticker, const char *name);
/**
* Iterates over all sticker items in a sticker.
@@ -127,7 +127,7 @@ sticker_get_value(const struct sticker &sticker, const char *name);
* @param user_data an opaque pointer for the callback function
*/
void
-sticker_foreach(const struct sticker &sticker,
+sticker_foreach(const sticker &sticker,
void (*func)(const char *name, const char *value,
void *user_data),
void *user_data);
@@ -139,7 +139,7 @@ sticker_foreach(const struct sticker &sticker,
* @param uri the URI of the resource, e.g. the song path
* @return a sticker object, or nullptr on error or if there is no sticker
*/
-struct sticker *
+sticker *
sticker_load(const char *type, const char *uri);
/**
diff --git a/src/TagFile.hxx b/src/TagFile.hxx
index 3a49a04e1..90d21dc0f 100644
--- a/src/TagFile.hxx
+++ b/src/TagFile.hxx
@@ -31,6 +31,6 @@ struct tag_handler;
*/
bool
tag_file_scan(Path path,
- const struct tag_handler *handler, void *handler_ctx);
+ const tag_handler *handler, void *handler_ctx);
#endif
diff --git a/src/TextInputStream.cxx b/src/TextInputStream.cxx
index 36a726aa6..036da052f 100644
--- a/src/TextInputStream.cxx
+++ b/src/TextInputStream.cxx
@@ -21,7 +21,6 @@
#include "TextInputStream.hxx"
#include "InputStream.hxx"
#include "util/CharUtil.hxx"
-#include "util/fifo_buffer.h"
#include "util/Error.hxx"
#include "Log.hxx"
diff --git a/src/TextInputStream.hxx b/src/TextInputStream.hxx
index a6c15f670..350871488 100644
--- a/src/TextInputStream.hxx
+++ b/src/TextInputStream.hxx
@@ -25,7 +25,6 @@
#include <string>
struct InputStream;
-struct fifo_buffer;
class TextInputStream {
InputStream &is;
diff --git a/src/Timer.cxx b/src/Timer.cxx
index 661aa29ee..a132977f1 100644
--- a/src/Timer.cxx
+++ b/src/Timer.cxx
@@ -27,8 +27,6 @@
#include <limits>
#include <assert.h>
-#include <limits.h>
-#include <stddef.h>
Timer::Timer(const AudioFormat af)
: time(0),
diff --git a/src/UpdateArchive.hxx b/src/UpdateArchive.hxx
index 8f52ca0b6..35601a844 100644
--- a/src/UpdateArchive.hxx
+++ b/src/UpdateArchive.hxx
@@ -26,7 +26,6 @@
#include <sys/stat.h>
struct Directory;
-struct archive_plugin;
#ifdef ENABLE_ARCHIVE
diff --git a/src/UpdateRemove.cxx b/src/UpdateRemove.cxx
index f4043b2f3..555b340d3 100644
--- a/src/UpdateRemove.cxx
+++ b/src/UpdateRemove.cxx
@@ -20,7 +20,6 @@
#include "config.h" /* must be first for large file support */
#include "UpdateRemove.hxx"
#include "UpdateDomain.hxx"
-#include "Playlist.hxx"
#include "GlobalEvents.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
diff --git a/src/UpdateSong.cxx b/src/UpdateSong.cxx
index bfab5c4a0..bbfde7f4d 100644
--- a/src/UpdateSong.cxx
+++ b/src/UpdateSong.cxx
@@ -27,7 +27,6 @@
#include "DatabaseLock.hxx"
#include "Directory.hxx"
#include "Song.hxx"
-#include "DecoderPlugin.hxx"
#include "DecoderList.hxx"
#include "Log.hxx"
diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx
index d4586456b..26f96957e 100644
--- a/src/UpdateWalk.cxx
+++ b/src/UpdateWalk.cxx
@@ -44,12 +44,8 @@
#include <glib.h>
#include <assert.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
#include <string.h>
-#include <stdlib.h>
#include <errno.h>
bool walk_discard;
diff --git a/src/ZeroconfAvahi.cxx b/src/ZeroconfAvahi.cxx
index 083647b42..f486a2e31 100644
--- a/src/ZeroconfAvahi.cxx
+++ b/src/ZeroconfAvahi.cxx
@@ -29,14 +29,11 @@
#include <avahi-client/client.h>
#include <avahi-client/publish.h>
-#include <avahi-common/watch.h>
#include <avahi-common/alternative.h>
#include <avahi-common/domain.h>
#include <avahi-common/malloc.h>
#include <avahi-common/error.h>
-#include <stddef.h>
-
static constexpr Domain avahi_domain("avahi");
static char *avahiName;
diff --git a/src/archive/Bzip2ArchivePlugin.cxx b/src/archive/Bzip2ArchivePlugin.cxx
index d1e6b51af..f3e093095 100644
--- a/src/archive/Bzip2ArchivePlugin.cxx
+++ b/src/archive/Bzip2ArchivePlugin.cxx
@@ -35,9 +35,7 @@
#include <bzlib.h>
-#include <stdint.h>
#include <stddef.h>
-#include <string.h>
#ifdef HAVE_OLDER_BZIP2
#define BZ2_bzDecompressInit bzDecompressInit
diff --git a/src/archive/Iso9660ArchivePlugin.cxx b/src/archive/Iso9660ArchivePlugin.cxx
index 315d32e46..c83e38b0d 100644
--- a/src/archive/Iso9660ArchivePlugin.cxx
+++ b/src/archive/Iso9660ArchivePlugin.cxx
@@ -32,7 +32,6 @@
#include "util/Error.hxx"
#include "util/Domain.hxx"
-#include <cdio/cdio.h>
#include <cdio/iso9660.h>
#include <stdlib.h>
diff --git a/src/archive/ZzipArchivePlugin.cxx b/src/archive/ZzipArchivePlugin.cxx
index 973fe91dc..2ad4ea72e 100644
--- a/src/archive/ZzipArchivePlugin.cxx
+++ b/src/archive/ZzipArchivePlugin.cxx
@@ -34,8 +34,6 @@
#include <zzip/zzip.h>
-#include <string.h>
-
class ZzipArchiveFile final : public ArchiveFile {
public:
RefCount ref;
diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx
index b86cbdae7..55405c1ef 100644
--- a/src/command/DatabaseCommands.cxx
+++ b/src/command/DatabaseCommands.cxx
@@ -26,14 +26,10 @@
#include "CommandError.hxx"
#include "Client.hxx"
#include "tag/Tag.hxx"
-#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "SongFilter.hxx"
#include "protocol/Result.hxx"
-#include <assert.h>
-#include <string.h>
-
CommandResult
handle_lsinfo2(Client &client, int argc, char *argv[])
{
diff --git a/src/command/MessageCommands.cxx b/src/command/MessageCommands.cxx
index 7d9893e70..0c2263d59 100644
--- a/src/command/MessageCommands.cxx
+++ b/src/command/MessageCommands.cxx
@@ -24,7 +24,6 @@
#include "Instance.hxx"
#include "Main.hxx"
#include "protocol/Result.hxx"
-#include "protocol/ArgParser.hxx"
#include <set>
#include <string>
diff --git a/src/command/OtherCommands.cxx b/src/command/OtherCommands.cxx
index 7b2cb1331..0c1de8792 100644
--- a/src/command/OtherCommands.cxx
+++ b/src/command/OtherCommands.cxx
@@ -44,10 +44,6 @@
#include "Client.hxx"
#include "Idle.hxx"
-#ifdef ENABLE_SQLITE
-#include "StickerDatabase.hxx"
-#endif
-
#include <assert.h>
#include <string.h>
diff --git a/src/command/OutputCommands.cxx b/src/command/OutputCommands.cxx
index e949448af..d4d699180 100644
--- a/src/command/OutputCommands.cxx
+++ b/src/command/OutputCommands.cxx
@@ -24,8 +24,6 @@
#include "protocol/Result.hxx"
#include "protocol/ArgParser.hxx"
-#include <string.h>
-
CommandResult
handle_enableoutput(Client &client, gcc_unused int argc, char *argv[])
{
diff --git a/src/command/PlaylistCommands.cxx b/src/command/PlaylistCommands.cxx
index d178fa097..20c5a2595 100644
--- a/src/command/PlaylistCommands.cxx
+++ b/src/command/PlaylistCommands.cxx
@@ -35,9 +35,6 @@
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
-#include <assert.h>
-#include <stdlib.h>
-
static void
print_spl_list(Client &client, const PlaylistVector &list)
{
diff --git a/src/command/StickerCommands.cxx b/src/command/StickerCommands.cxx
index b65e6f607..d353a5541 100644
--- a/src/command/StickerCommands.cxx
+++ b/src/command/StickerCommands.cxx
@@ -31,8 +31,6 @@
#include "protocol/Result.hxx"
#include "util/Error.hxx"
-#include <glib.h>
-
#include <string.h>
struct sticker_song_find_data {
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx
index 00b5d445f..a4fa88edd 100644
--- a/src/db/ProxyDatabasePlugin.cxx
+++ b/src/db/ProxyDatabasePlugin.cxx
@@ -22,7 +22,6 @@
#include "DatabasePlugin.hxx"
#include "DatabaseSelection.hxx"
#include "DatabaseError.hxx"
-#include "PlaylistVector.hxx"
#include "Directory.hxx"
#include "Song.hxx"
#include "SongFilter.hxx"
diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx
index e7ea7a62d..14be91b0a 100644
--- a/src/db/SimpleDatabasePlugin.cxx
+++ b/src/db/SimpleDatabasePlugin.cxx
@@ -33,7 +33,6 @@
#include "util/Domain.hxx"
#include "Log.hxx"
-#include <sys/types.h>
#include <errno.h>
static constexpr Domain simple_db_domain("simple_db");
diff --git a/src/decoder/DsdLib.cxx b/src/decoder/DsdLib.cxx
index 67cc7e945..b0ba73126 100644
--- a/src/decoder/DsdLib.cxx
+++ b/src/decoder/DsdLib.cxx
@@ -27,8 +27,6 @@
#include "DsdLib.hxx"
#include "DecoderAPI.hxx"
#include "InputStream.hxx"
-#include "util/bit_reverse.h"
-#include "tag/TagHandler.hxx"
#include "tag/TagId3.hxx"
#include "util/Error.hxx"
diff --git a/src/decoder/DsdiffDecoderPlugin.cxx b/src/decoder/DsdiffDecoderPlugin.cxx
index a3c0149b9..bc9fc2353 100644
--- a/src/decoder/DsdiffDecoderPlugin.cxx
+++ b/src/decoder/DsdiffDecoderPlugin.cxx
@@ -38,9 +38,6 @@
#include "DsdLib.hxx"
#include "Log.hxx"
-#include <unistd.h>
-#include <stdio.h> /* for SEEK_SET, SEEK_CUR */
-
struct DsdiffHeader {
DsdId id;
DffDsdUint64 size;
diff --git a/src/decoder/DsfDecoderPlugin.cxx b/src/decoder/DsfDecoderPlugin.cxx
index 5ef94e647..ab96e8ce6 100644
--- a/src/decoder/DsfDecoderPlugin.cxx
+++ b/src/decoder/DsfDecoderPlugin.cxx
@@ -39,9 +39,6 @@
#include "tag/TagHandler.hxx"
#include "Log.hxx"
-#include <unistd.h>
-#include <stdio.h> /* for SEEK_SET, SEEK_CUR */
-
struct DsfMetaData {
unsigned sample_rate, channels;
bool bitreverse;
diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx
index 1b62eae57..bef74e367 100644
--- a/src/decoder/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/FfmpegDecoderPlugin.cxx
@@ -38,7 +38,6 @@ extern "C" {
#include <libavutil/avutil.h>
#include <libavutil/log.h>
#include <libavutil/mathematics.h>
-#include <libavutil/dict.h>
}
#include <assert.h>
diff --git a/src/decoder/FfmpegMetaData.hxx b/src/decoder/FfmpegMetaData.hxx
index 0fd73df04..998cdf5a8 100644
--- a/src/decoder/FfmpegMetaData.hxx
+++ b/src/decoder/FfmpegMetaData.hxx
@@ -21,8 +21,6 @@
#define MPD_FFMPEG_METADATA_HXX
extern "C" {
-#include <libavformat/avformat.h>
-#include <libavutil/avutil.h>
#include <libavutil/dict.h>
}
@@ -35,6 +33,6 @@ struct tag_handler;
void
ffmpeg_scan_dictionary(AVDictionary *dict,
- const struct tag_handler *handler, void *handler_ctx);
+ const tag_handler *handler, void *handler_ctx);
#endif
diff --git a/src/decoder/FlacCommon.cxx b/src/decoder/FlacCommon.cxx
index e4b906c12..e355f285a 100644
--- a/src/decoder/FlacCommon.cxx
+++ b/src/decoder/FlacCommon.cxx
@@ -25,14 +25,10 @@
#include "FlacCommon.hxx"
#include "FlacMetadata.hxx"
#include "FlacPcm.hxx"
-#include "MixRampInfo.hxx"
#include "CheckAudioFormat.hxx"
#include "util/Error.hxx"
-#include "util/Domain.hxx"
#include "Log.hxx"
-#include <assert.h>
-
flac_data::flac_data(Decoder &_decoder,
InputStream &_input_stream)
:FlacInput(_input_stream, &_decoder),
diff --git a/src/decoder/FlacCommon.hxx b/src/decoder/FlacCommon.hxx
index de000dfa1..0f6b09973 100644
--- a/src/decoder/FlacCommon.hxx
+++ b/src/decoder/FlacCommon.hxx
@@ -29,7 +29,6 @@
#include "pcm/PcmBuffer.hxx"
#include <FLAC/stream_decoder.h>
-#include <FLAC/metadata.h>
struct flac_data : public FlacInput {
PcmBuffer buffer;
diff --git a/src/decoder/FlacDecoderPlugin.cxx b/src/decoder/FlacDecoderPlugin.cxx
index 1b5734434..2c811a8e0 100644
--- a/src/decoder/FlacDecoderPlugin.cxx
+++ b/src/decoder/FlacDecoderPlugin.cxx
@@ -26,10 +26,6 @@
#include "util/Error.hxx"
#include "Log.hxx"
-#include <glib.h>
-
-#include <assert.h>
-
#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
#error libFLAC is too old
#endif
diff --git a/src/decoder/FlacMetadata.cxx b/src/decoder/FlacMetadata.cxx
index 17cc4cd8d..9cbedd67b 100644
--- a/src/decoder/FlacMetadata.cxx
+++ b/src/decoder/FlacMetadata.cxx
@@ -21,7 +21,6 @@
#include "FlacMetadata.hxx"
#include "XiphTags.hxx"
#include "MixRampInfo.hxx"
-#include "tag/Tag.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagTable.hxx"
#include "tag/TagBuilder.hxx"
@@ -30,7 +29,6 @@
#include <glib.h>
-#include <assert.h>
#include <string.h>
static bool
diff --git a/src/decoder/FlacMetadata.hxx b/src/decoder/FlacMetadata.hxx
index 96c61b8e6..137101a65 100644
--- a/src/decoder/FlacMetadata.hxx
+++ b/src/decoder/FlacMetadata.hxx
@@ -27,6 +27,7 @@
#include <assert.h>
+struct tag_handler;
class MixRampInfo;
class FlacMetadataChain {
@@ -81,7 +82,7 @@ public:
return FLAC__Metadata_ChainStatusString[GetStatus()];
}
- void Scan(const struct tag_handler *handler, void *handler_ctx);
+ void Scan(const tag_handler *handler, void *handler_ctx);
};
class FLACMetadataIterator {
@@ -110,7 +111,6 @@ public:
}
};
-struct tag_handler;
struct Tag;
struct ReplayGainInfo;
@@ -136,6 +136,6 @@ flac_vorbis_comments_to_tag(Tag &tag,
void
flac_scan_metadata(const FLAC__StreamMetadata *block,
- const struct tag_handler *handler, void *handler_ctx);
+ const tag_handler *handler, void *handler_ctx);
#endif
diff --git a/src/decoder/MadDecoderPlugin.cxx b/src/decoder/MadDecoderPlugin.cxx
index 9dd86c55f..4dfb752f0 100644
--- a/src/decoder/MadDecoderPlugin.cxx
+++ b/src/decoder/MadDecoderPlugin.cxx
@@ -32,7 +32,6 @@
#include "Log.hxx"
#include <assert.h>
-#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/decoder/MikmodDecoderPlugin.cxx b/src/decoder/MikmodDecoderPlugin.cxx
index 34381aafa..93a3cc280 100644
--- a/src/decoder/MikmodDecoderPlugin.cxx
+++ b/src/decoder/MikmodDecoderPlugin.cxx
@@ -25,8 +25,8 @@
#include "util/Domain.hxx"
#include "Log.hxx"
-#include <glib.h>
#include <mikmod.h>
+
#include <assert.h>
static constexpr Domain mikmod_domain("mikmod");
diff --git a/src/decoder/MpcdecDecoderPlugin.cxx b/src/decoder/MpcdecDecoderPlugin.cxx
index dc258623c..620bfad30 100644
--- a/src/decoder/MpcdecDecoderPlugin.cxx
+++ b/src/decoder/MpcdecDecoderPlugin.cxx
@@ -30,8 +30,6 @@
#include <mpc/mpcdec.h>
-#include <assert.h>
-#include <unistd.h>
#include <math.h>
struct mpc_decoder_data {
diff --git a/src/decoder/Mpg123DecoderPlugin.cxx b/src/decoder/Mpg123DecoderPlugin.cxx
index df23f7847..895c8b865 100644
--- a/src/decoder/Mpg123DecoderPlugin.cxx
+++ b/src/decoder/Mpg123DecoderPlugin.cxx
@@ -26,9 +26,8 @@
#include "util/Domain.hxx"
#include "Log.hxx"
-#include <glib.h>
-
#include <mpg123.h>
+
#include <stdio.h>
static constexpr Domain mpg123_domain("mpg123");
diff --git a/src/decoder/OggCodec.cxx b/src/decoder/OggCodec.cxx
index 565dbafcf..cc6cd20c0 100644
--- a/src/decoder/OggCodec.cxx
+++ b/src/decoder/OggCodec.cxx
@@ -23,6 +23,7 @@
#include "config.h"
#include "OggCodec.hxx"
+#include "DecoderAPI.hxx"
#include <string.h>
diff --git a/src/decoder/OggCodec.hxx b/src/decoder/OggCodec.hxx
index 857871607..13eab2cdb 100644
--- a/src/decoder/OggCodec.hxx
+++ b/src/decoder/OggCodec.hxx
@@ -24,7 +24,8 @@
#ifndef MPD_OGG_CODEC_HXX
#define MPD_OGG_CODEC_HXX
-#include "DecoderAPI.hxx"
+struct Decoder;
+struct InputStream;
enum ogg_codec {
OGG_CODEC_UNKNOWN,
diff --git a/src/decoder/OggFind.hxx b/src/decoder/OggFind.hxx
index ad51ccdf3..a329e42a4 100644
--- a/src/decoder/OggFind.hxx
+++ b/src/decoder/OggFind.hxx
@@ -25,7 +25,6 @@
#include <ogg/ogg.h>
-struct InputStream;
class OggSyncState;
/**
diff --git a/src/decoder/OpusDecoderPlugin.cxx b/src/decoder/OpusDecoderPlugin.cxx
index f3d7b342e..201d61d96 100644
--- a/src/decoder/OpusDecoderPlugin.cxx
+++ b/src/decoder/OpusDecoderPlugin.cxx
@@ -22,12 +22,10 @@
#include "OpusDomain.hxx"
#include "OpusHead.hxx"
#include "OpusTags.hxx"
-#include "OggUtil.hxx"
#include "OggFind.hxx"
#include "OggSyncState.hxx"
#include "DecoderAPI.hxx"
#include "OggCodec.hxx"
-#include "CheckAudioFormat.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagBuilder.hxx"
#include "InputStream.hxx"
diff --git a/src/decoder/OpusHead.cxx b/src/decoder/OpusHead.cxx
index 0417d3905..dd2b125b0 100644
--- a/src/decoder/OpusHead.cxx
+++ b/src/decoder/OpusHead.cxx
@@ -21,7 +21,6 @@
#include "OpusHead.hxx"
#include <stdint.h>
-#include <string.h>
struct OpusHead {
char signature[8];
diff --git a/src/decoder/PcmDecoderPlugin.cxx b/src/decoder/PcmDecoderPlugin.cxx
index dbc38fb76..0bef8dc69 100644
--- a/src/decoder/PcmDecoderPlugin.cxx
+++ b/src/decoder/PcmDecoderPlugin.cxx
@@ -25,8 +25,6 @@
#include "util/ByteReverse.hxx"
#include "Log.hxx"
-#include <glib.h>
-#include <unistd.h>
#include <string.h>
#include <stdio.h> /* for SEEK_SET */
diff --git a/src/decoder/VorbisComments.cxx b/src/decoder/VorbisComments.cxx
index d4f019b58..5a9e6a82e 100644
--- a/src/decoder/VorbisComments.cxx
+++ b/src/decoder/VorbisComments.cxx
@@ -20,7 +20,6 @@
#include "config.h"
#include "VorbisComments.hxx"
#include "XiphTags.hxx"
-#include "tag/Tag.hxx"
#include "tag/TagTable.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagBuilder.hxx"
@@ -29,7 +28,6 @@
#include <glib.h>
-#include <assert.h>
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
diff --git a/src/decoder/VorbisComments.hxx b/src/decoder/VorbisComments.hxx
index e5a48ef6b..f537bf30f 100644
--- a/src/decoder/VorbisComments.hxx
+++ b/src/decoder/VorbisComments.hxx
@@ -31,7 +31,7 @@ vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments);
void
vorbis_comments_scan(char **comments,
- const struct tag_handler *handler, void *handler_ctx);
+ const tag_handler *handler, void *handler_ctx);
Tag *
vorbis_comments_to_tag(char **comments);
diff --git a/src/decoder/VorbisDecoderPlugin.cxx b/src/decoder/VorbisDecoderPlugin.cxx
index 4d3e48528..a637241b1 100644
--- a/src/decoder/VorbisDecoderPlugin.cxx
+++ b/src/decoder/VorbisDecoderPlugin.cxx
@@ -25,9 +25,7 @@
#include "InputStream.hxx"
#include "OggCodec.hxx"
#include "util/Error.hxx"
-#include "util/UriUtil.hxx"
#include "util/Macros.hxx"
-#include "system/ByteOrder.hxx"
#include "CheckAudioFormat.hxx"
#include "tag/TagHandler.hxx"
#include "Log.hxx"
@@ -48,7 +46,6 @@
#define ov_time_seek_page(VF, S) (ov_time_seek_page(VF, (S)*1000))
#endif /* HAVE_TREMOR */
-#include <assert.h>
#include <errno.h>
struct vorbis_input_stream {
diff --git a/src/decoder/VorbisDomain.hxx b/src/decoder/VorbisDomain.hxx
index a35edd041..7946bf52a 100644
--- a/src/decoder/VorbisDomain.hxx
+++ b/src/decoder/VorbisDomain.hxx
@@ -22,6 +22,8 @@
#include "check.h"
-extern const class Domain vorbis_domain;
+class Domain;
+
+extern const Domain vorbis_domain;
#endif
diff --git a/src/encoder/FlacEncoderPlugin.cxx b/src/encoder/FlacEncoderPlugin.cxx
index fa7ed992d..2569ca95f 100644
--- a/src/encoder/FlacEncoderPlugin.cxx
+++ b/src/encoder/FlacEncoderPlugin.cxx
@@ -31,7 +31,6 @@ extern "C" {
#include "util/growing_fifo.h"
}
-#include <assert.h>
#include <string.h>
#include <FLAC/stream_encoder.h>
diff --git a/src/encoder/VorbisEncoderPlugin.cxx b/src/encoder/VorbisEncoderPlugin.cxx
index 5b40aaea1..830910288 100644
--- a/src/encoder/VorbisEncoderPlugin.cxx
+++ b/src/encoder/VorbisEncoderPlugin.cxx
@@ -33,8 +33,6 @@
#include <glib.h>
-#include <assert.h>
-
struct vorbis_encoder {
/** the base class */
Encoder encoder;
diff --git a/src/event/BufferedSocket.cxx b/src/event/BufferedSocket.cxx
index 92e350e85..0f71bd941 100644
--- a/src/event/BufferedSocket.cxx
+++ b/src/event/BufferedSocket.cxx
@@ -22,6 +22,9 @@
#include "system/SocketError.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
+#include "Compiler.h"
+
+#include <algorithm>
BufferedSocket::ssize_t
BufferedSocket::DirectRead(void *data, size_t length)
diff --git a/src/event/BufferedSocket.hxx b/src/event/BufferedSocket.hxx
index db920f981..9bd1b5b49 100644
--- a/src/event/BufferedSocket.hxx
+++ b/src/event/BufferedSocket.hxx
@@ -23,13 +23,13 @@
#include "check.h"
#include "SocketMonitor.hxx"
#include "util/FifoBuffer.hxx"
-#include "Compiler.h"
#include <assert.h>
#include <stdint.h>
struct fifo_buffer;
class Error;
+class EventLoop;
/**
* A #SocketMonitor specialization that adds an input buffer.
diff --git a/src/event/FullyBufferedSocket.cxx b/src/event/FullyBufferedSocket.cxx
index 8b57b1308..87d29296e 100644
--- a/src/event/FullyBufferedSocket.cxx
+++ b/src/event/FullyBufferedSocket.cxx
@@ -23,6 +23,7 @@
#include "util/fifo_buffer.h"
#include "util/Error.hxx"
#include "util/Domain.hxx"
+#include "Compiler.h"
#include <assert.h>
#include <stdint.h>
diff --git a/src/event/FullyBufferedSocket.hxx b/src/event/FullyBufferedSocket.hxx
index c50bb5f61..083fab15e 100644
--- a/src/event/FullyBufferedSocket.hxx
+++ b/src/event/FullyBufferedSocket.hxx
@@ -24,7 +24,6 @@
#include "BufferedSocket.hxx"
#include "IdleMonitor.hxx"
#include "util/PeakBuffer.hxx"
-#include "Compiler.h"
/**
* A #BufferedSocket specialization that adds an output buffer.
diff --git a/src/event/IdleMonitor.cxx b/src/event/IdleMonitor.cxx
index 8d25407b5..45f533e3f 100644
--- a/src/event/IdleMonitor.cxx
+++ b/src/event/IdleMonitor.cxx
@@ -21,6 +21,8 @@
#include "IdleMonitor.hxx"
#include "Loop.hxx"
+#include <assert.h>
+
void
IdleMonitor::Cancel()
{
diff --git a/src/event/MultiSocketMonitor.hxx b/src/event/MultiSocketMonitor.hxx
index fed6929c1..680930037 100644
--- a/src/event/MultiSocketMonitor.hxx
+++ b/src/event/MultiSocketMonitor.hxx
@@ -34,6 +34,7 @@
#endif
#include <forward_list>
+#include <iterator>
#include <assert.h>
#include <stdint.h>
diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx
index 781d29181..72320b3eb 100644
--- a/src/event/ServerSocket.cxx
+++ b/src/event/ServerSocket.cxx
@@ -38,6 +38,7 @@
#include <glib.h>
#include <string>
+#include <algorithm>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/src/event/SignalMonitor.cxx b/src/event/SignalMonitor.cxx
index 8c8527a77..0d96fb138 100644
--- a/src/event/SignalMonitor.cxx
+++ b/src/event/SignalMonitor.cxx
@@ -39,6 +39,8 @@
#include <algorithm>
+#include <assert.h>
+
class SignalMonitor final : private SocketMonitor {
#ifdef USE_SIGNALFD
SignalFD fd;
diff --git a/src/event/SocketMonitor.cxx b/src/event/SocketMonitor.cxx
index fdef0acb6..e88427d53 100644
--- a/src/event/SocketMonitor.cxx
+++ b/src/event/SocketMonitor.cxx
@@ -28,7 +28,6 @@
#ifdef WIN32
#include <winsock2.h>
#else
-#include <sys/types.h>
#include <sys/socket.h>
#endif
diff --git a/src/filter/ConvertFilterPlugin.cxx b/src/filter/ConvertFilterPlugin.cxx
index 416b6e81a..e718844e7 100644
--- a/src/filter/ConvertFilterPlugin.cxx
+++ b/src/filter/ConvertFilterPlugin.cxx
@@ -28,7 +28,6 @@
#include "poison.h"
#include <assert.h>
-#include <string.h>
class ConvertFilter final : public Filter {
/**
diff --git a/src/filter/NormalizeFilterPlugin.cxx b/src/filter/NormalizeFilterPlugin.cxx
index 6c4f6b0e5..93cca9fef 100644
--- a/src/filter/NormalizeFilterPlugin.cxx
+++ b/src/filter/NormalizeFilterPlugin.cxx
@@ -25,7 +25,6 @@
#include "AudioFormat.hxx"
#include "AudioCompress/compress.h"
-#include <assert.h>
#include <string.h>
class NormalizeFilter final : public Filter {
diff --git a/src/filter/RouteFilterPlugin.cxx b/src/filter/RouteFilterPlugin.cxx
index d9042c21f..d2dc2d563 100644
--- a/src/filter/RouteFilterPlugin.cxx
+++ b/src/filter/RouteFilterPlugin.cxx
@@ -43,7 +43,6 @@
#include "ConfigError.hxx"
#include "ConfigData.hxx"
#include "AudioFormat.hxx"
-#include "CheckAudioFormat.hxx"
#include "FilterPlugin.hxx"
#include "FilterInternal.hxx"
#include "FilterRegistry.hxx"
diff --git a/src/fs/AllocatedPath.cxx b/src/fs/AllocatedPath.cxx
index 37b79a685..c6c01376f 100644
--- a/src/fs/AllocatedPath.cxx
+++ b/src/fs/AllocatedPath.cxx
@@ -26,7 +26,6 @@
#include <glib.h>
-#include <assert.h>
#include <string.h>
inline AllocatedPath::AllocatedPath(Donate, pointer _value)
diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx
index 36d8a1598..94da284c8 100644
--- a/src/fs/AllocatedPath.hxx
+++ b/src/fs/AllocatedPath.hxx
@@ -28,8 +28,6 @@
#include <utility>
#include <string>
-#include <assert.h>
-
class Error;
/**
diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx
index dad5779f9..3f373a036 100644
--- a/src/fs/Charset.cxx
+++ b/src/fs/Charset.cxx
@@ -22,8 +22,6 @@
#include "Domain.hxx"
#include "Limits.hxx"
#include "system/FatalError.hxx"
-#include "util/Error.hxx"
-#include "util/Domain.hxx"
#include "Log.hxx"
#include <glib.h>
diff --git a/src/fs/Config.cxx b/src/fs/Config.cxx
index 63e64ef99..87e77512d 100644
--- a/src/fs/Config.cxx
+++ b/src/fs/Config.cxx
@@ -20,16 +20,10 @@
#include "config.h"
#include "Config.hxx"
#include "Charset.hxx"
-#include "Domain.hxx"
#include "ConfigGlobal.hxx"
-#include "Log.hxx"
-#include "Compiler.h"
#include <glib.h>
-#include <assert.h>
-#include <string.h>
-
#ifdef WIN32
#include <windows.h> // for GetACP()
#include <stdio.h> // for sprintf()
diff --git a/src/fs/FileSystem.hxx b/src/fs/FileSystem.hxx
index cb2f82d22..67c6eef3e 100644
--- a/src/fs/FileSystem.hxx
+++ b/src/fs/FileSystem.hxx
@@ -28,7 +28,6 @@
#include <sys/stat.h>
#include <unistd.h>
-#include <assert.h>
#include <stdio.h>
class AllocatedPath;
diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx
index 6ea954577..296f4b286 100644
--- a/src/fs/Path.hxx
+++ b/src/fs/Path.hxx
@@ -29,8 +29,6 @@
#include <assert.h>
#include <string.h>
-class Error;
-
/**
* A path name in the native file system character set.
*
diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx
index 244ab8b5c..cdbe2082a 100644
--- a/src/fs/Traits.hxx
+++ b/src/fs/Traits.hxx
@@ -31,8 +31,6 @@
#include <assert.h>
-class Error;
-
/**
* This class describes the nature of a filesystem path.
*/
diff --git a/src/input/ArchiveInputPlugin.cxx b/src/input/ArchiveInputPlugin.cxx
index 5288f2b3b..72572defc 100644
--- a/src/input/ArchiveInputPlugin.cxx
+++ b/src/input/ArchiveInputPlugin.cxx
@@ -25,7 +25,6 @@
#include "ArchivePlugin.hxx"
#include "ArchiveFile.hxx"
#include "InputPlugin.hxx"
-#include "util/Error.hxx"
#include "fs/Traits.hxx"
#include "Log.hxx"
diff --git a/src/input/FfmpegInputPlugin.cxx b/src/input/FfmpegInputPlugin.cxx
index 8f9cd0b86..c6f4afb7f 100644
--- a/src/input/FfmpegInputPlugin.cxx
+++ b/src/input/FfmpegInputPlugin.cxx
@@ -28,7 +28,6 @@
#include "util/Domain.hxx"
extern "C" {
-#include <libavutil/avutil.h>
#include <libavformat/avio.h>
#include <libavformat/avformat.h>
}
diff --git a/src/input/FileInputPlugin.cxx b/src/input/FileInputPlugin.cxx
index 26e40d609..dd6a28b97 100644
--- a/src/input/FileInputPlugin.cxx
+++ b/src/input/FileInputPlugin.cxx
@@ -30,8 +30,6 @@
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
-#include <string.h>
-#include <glib.h>
static constexpr Domain file_domain("file");
diff --git a/src/input/MmsInputPlugin.cxx b/src/input/MmsInputPlugin.cxx
index e97c1eb3f..df45f71e8 100644
--- a/src/input/MmsInputPlugin.cxx
+++ b/src/input/MmsInputPlugin.cxx
@@ -27,9 +27,6 @@
#include <glib.h>
#include <libmms/mmsx.h>
-#include <string.h>
-#include <errno.h>
-
struct MmsInputStream {
InputStream base;
diff --git a/src/input/RewindInputPlugin.cxx b/src/input/RewindInputPlugin.cxx
index e11f56631..78ab75660 100644
--- a/src/input/RewindInputPlugin.cxx
+++ b/src/input/RewindInputPlugin.cxx
@@ -21,7 +21,6 @@
#include "RewindInputPlugin.hxx"
#include "InputStream.hxx"
#include "InputPlugin.hxx"
-#include "tag/Tag.hxx"
#include <assert.h>
#include <string.h>
diff --git a/src/ls.cxx b/src/ls.cxx
index b1a636416..ec8ce6fbe 100644
--- a/src/ls.cxx
+++ b/src/ls.cxx
@@ -25,8 +25,6 @@
#include <glib.h>
#include <assert.h>
-#include <string.h>
-
/**
* file:// is not included in remoteUrlPrefixes, the connection method
diff --git a/src/mixer/OssMixerPlugin.cxx b/src/mixer/OssMixerPlugin.cxx
index 0a459bc97..7a91cfcb1 100644
--- a/src/mixer/OssMixerPlugin.cxx
+++ b/src/mixer/OssMixerPlugin.cxx
@@ -19,7 +19,7 @@
#include "config.h"
#include "MixerInternal.hxx"
-#include "OutputAPI.hxx"
+#include "ConfigData.hxx"
#include "system/fd_util.h"
#include "util/ASCII.hxx"
#include "util/Error.hxx"
@@ -28,10 +28,8 @@
#include <assert.h>
#include <string.h>
-#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
-#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/src/mixer/PulseMixerPlugin.cxx b/src/mixer/PulseMixerPlugin.cxx
index ff10256cb..84d42c392 100644
--- a/src/mixer/PulseMixerPlugin.cxx
+++ b/src/mixer/PulseMixerPlugin.cxx
@@ -26,7 +26,6 @@
#include "util/Domain.hxx"
#include "Log.hxx"
-#include <pulse/thread-mainloop.h>
#include <pulse/context.h>
#include <pulse/introspect.h>
#include <pulse/stream.h>
@@ -34,7 +33,6 @@
#include <pulse/error.h>
#include <assert.h>
-#include <string.h>
struct PulseMixer final : public Mixer {
PulseOutput *output;
diff --git a/src/mixer/PulseMixerPlugin.hxx b/src/mixer/PulseMixerPlugin.hxx
index fa73e0f5e..46bd06a01 100644
--- a/src/mixer/PulseMixerPlugin.hxx
+++ b/src/mixer/PulseMixerPlugin.hxx
@@ -20,20 +20,17 @@
#ifndef MPD_PULSE_MIXER_PLUGIN_HXX
#define MPD_PULSE_MIXER_PLUGIN_HXX
-#include <pulse/def.h>
-
struct PulseMixer;
struct pa_context;
struct pa_stream;
void
-pulse_mixer_on_connect(PulseMixer *pm, struct pa_context *context);
+pulse_mixer_on_connect(PulseMixer *pm, pa_context *context);
void
pulse_mixer_on_disconnect(PulseMixer *pm);
void
-pulse_mixer_on_change(PulseMixer *pm,
- struct pa_context *context, struct pa_stream *stream);
+pulse_mixer_on_change(PulseMixer *pm, pa_context *context, pa_stream *stream);
#endif
diff --git a/src/mixer/RoarMixerPlugin.cxx b/src/mixer/RoarMixerPlugin.cxx
index 6bd700551..75147329e 100644
--- a/src/mixer/RoarMixerPlugin.cxx
+++ b/src/mixer/RoarMixerPlugin.cxx
@@ -21,8 +21,8 @@
#include "config.h"
#include "MixerInternal.hxx"
-#include "OutputAPI.hxx"
#include "output/RoarOutputPlugin.hxx"
+#include "Compiler.h"
struct RoarMixer final : public Mixer {
/** the base mixer class */
diff --git a/src/output/FifoOutputPlugin.cxx b/src/output/FifoOutputPlugin.cxx
index aeb9a6a87..7963d8c82 100644
--- a/src/output/FifoOutputPlugin.cxx
+++ b/src/output/FifoOutputPlugin.cxx
@@ -22,7 +22,6 @@
#include "ConfigError.hxx"
#include "OutputAPI.hxx"
#include "Timer.hxx"
-#include "system/fd_util.h"
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
#include "util/Error.hxx"
@@ -30,10 +29,8 @@
#include "Log.hxx"
#include "open.h"
-#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
-#include <string.h>
#include <unistd.h>
#define FIFO_BUFFER_SIZE 65536 /* pipe capacity on Linux >= 2.6.11 */
diff --git a/src/output/JackOutputPlugin.cxx b/src/output/JackOutputPlugin.cxx
index 7ed672f95..ef06b5abf 100644
--- a/src/output/JackOutputPlugin.cxx
+++ b/src/output/JackOutputPlugin.cxx
@@ -34,10 +34,6 @@
#include <stdlib.h>
#include <string.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
enum {
MAX_PORTS = 16,
diff --git a/src/output/NullOutputPlugin.cxx b/src/output/NullOutputPlugin.cxx
index e2eec9dbc..a901b7d2a 100644
--- a/src/output/NullOutputPlugin.cxx
+++ b/src/output/NullOutputPlugin.cxx
@@ -22,8 +22,6 @@
#include "OutputAPI.hxx"
#include "Timer.hxx"
-#include <assert.h>
-
struct NullOutput {
struct audio_output base;
diff --git a/src/output/PulseOutputPlugin.hxx b/src/output/PulseOutputPlugin.hxx
index 0ed8404bc..69d6c5f99 100644
--- a/src/output/PulseOutputPlugin.hxx
+++ b/src/output/PulseOutputPlugin.hxx
@@ -41,6 +41,6 @@ pulse_output_clear_mixer(PulseOutput *po, PulseMixer *pm);
bool
pulse_output_set_volume(PulseOutput *po,
- const struct pa_cvolume *volume, Error &error);
+ const pa_cvolume *volume, Error &error);
#endif
diff --git a/src/pcm/PcmBuffer.cxx b/src/pcm/PcmBuffer.cxx
index 578c579be..5af9a978d 100644
--- a/src/pcm/PcmBuffer.cxx
+++ b/src/pcm/PcmBuffer.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "PcmBuffer.hxx"
-#include "poison.h"
void *
PcmBuffer::Get(size_t new_size)
diff --git a/src/pcm/PcmConvert.hxx b/src/pcm/PcmConvert.hxx
index 4bace1d36..02743b6cc 100644
--- a/src/pcm/PcmConvert.hxx
+++ b/src/pcm/PcmConvert.hxx
@@ -29,6 +29,7 @@
#include <stddef.h>
class Error;
+class Domain;
/**
* This object is statically allocated (within another struct), and
@@ -100,6 +101,6 @@ private:
Error &error);
};
-extern const class Domain pcm_convert_domain;
+extern const Domain pcm_convert_domain;
#endif
diff --git a/src/pcm/PcmDsd.cxx b/src/pcm/PcmDsd.cxx
index 4db274635..22b3c7ba2 100644
--- a/src/pcm/PcmDsd.cxx
+++ b/src/pcm/PcmDsd.cxx
@@ -25,7 +25,6 @@
#include <algorithm>
#include <assert.h>
-#include <string.h>
PcmDsd::PcmDsd()
{
diff --git a/src/pcm/PcmDsdUsb.cxx b/src/pcm/PcmDsdUsb.cxx
index 2d0f33a15..833d84653 100644
--- a/src/pcm/PcmDsdUsb.cxx
+++ b/src/pcm/PcmDsdUsb.cxx
@@ -22,6 +22,8 @@
#include "PcmBuffer.hxx"
#include "AudioFormat.hxx"
+#include <assert.h>
+
constexpr
static inline uint32_t
pcm_two_dsd_to_usb_marker1(uint8_t a, uint8_t b)
diff --git a/src/pcm/PcmMix.cxx b/src/pcm/PcmMix.cxx
index 001794061..21080bc5f 100644
--- a/src/pcm/PcmMix.cxx
+++ b/src/pcm/PcmMix.cxx
@@ -23,6 +23,7 @@
#include "PcmUtils.hxx"
#include "AudioFormat.hxx"
+#include <assert.h>
#include <math.h>
template<typename T, typename U, unsigned bits>
diff --git a/src/playlist/AsxPlaylistPlugin.cxx b/src/playlist/AsxPlaylistPlugin.cxx
index 94198b8c3..2f4c7af60 100644
--- a/src/playlist/AsxPlaylistPlugin.cxx
+++ b/src/playlist/AsxPlaylistPlugin.cxx
@@ -31,7 +31,6 @@
#include <glib.h>
-#include <assert.h>
#include <string.h>
static constexpr Domain asx_domain("asx");
diff --git a/src/playlist/CuePlaylistPlugin.cxx b/src/playlist/CuePlaylistPlugin.cxx
index 42a43bbad..00aa758b0 100644
--- a/src/playlist/CuePlaylistPlugin.cxx
+++ b/src/playlist/CuePlaylistPlugin.cxx
@@ -21,13 +21,10 @@
#include "CuePlaylistPlugin.hxx"
#include "PlaylistPlugin.hxx"
#include "SongEnumerator.hxx"
-#include "tag/Tag.hxx"
-#include "Song.hxx"
#include "cue/CueParser.hxx"
#include "TextInputStream.hxx"
-#include <assert.h>
-#include <string.h>
+#include <string>
class CuePlaylist final : public SongEnumerator {
InputStream &is;
diff --git a/src/playlist/EmbeddedCuePlaylistPlugin.cxx b/src/playlist/EmbeddedCuePlaylistPlugin.cxx
index d758650eb..f0612bf87 100644
--- a/src/playlist/EmbeddedCuePlaylistPlugin.cxx
+++ b/src/playlist/EmbeddedCuePlaylistPlugin.cxx
@@ -27,7 +27,6 @@
#include "EmbeddedCuePlaylistPlugin.hxx"
#include "PlaylistPlugin.hxx"
#include "SongEnumerator.hxx"
-#include "tag/Tag.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagId3.hxx"
#include "tag/ApeTag.hxx"
@@ -38,7 +37,6 @@
#include "fs/AllocatedPath.hxx"
#include "util/ASCII.hxx"
-#include <assert.h>
#include <string.h>
class EmbeddedCuePlaylist final : public SongEnumerator {
diff --git a/src/playlist/RssPlaylistPlugin.cxx b/src/playlist/RssPlaylistPlugin.cxx
index e2a44bfd3..a2a38cd3d 100644
--- a/src/playlist/RssPlaylistPlugin.cxx
+++ b/src/playlist/RssPlaylistPlugin.cxx
@@ -31,7 +31,6 @@
#include <glib.h>
-#include <assert.h>
#include <string.h>
static constexpr Domain rss_domain("rss");
diff --git a/src/playlist/XspfPlaylistPlugin.cxx b/src/playlist/XspfPlaylistPlugin.cxx
index dcfab5a80..57e88a08d 100644
--- a/src/playlist/XspfPlaylistPlugin.cxx
+++ b/src/playlist/XspfPlaylistPlugin.cxx
@@ -29,7 +29,6 @@
#include <glib.h>
-#include <assert.h>
#include <string.h>
static constexpr Domain xspf_domain("xspf");
diff --git a/src/system/EPollFD.hxx b/src/system/EPollFD.hxx
index 41f7ec377..a6ea51d18 100644
--- a/src/system/EPollFD.hxx
+++ b/src/system/EPollFD.hxx
@@ -23,6 +23,7 @@
#include <assert.h>
#include <sys/epoll.h>
#include <unistd.h>
+#include <stdint.h>
#include "check.h"
diff --git a/src/system/Resolver.cxx b/src/system/Resolver.cxx
index 5e6ea590b..8f4f4dcda 100644
--- a/src/system/Resolver.cxx
+++ b/src/system/Resolver.cxx
@@ -27,6 +27,9 @@
#ifndef WIN32
#include <sys/socket.h>
#include <netdb.h>
+#ifdef HAVE_TCP
+#include <netinet/in.h>
+#endif
#else
#include <ws2tcpip.h>
#include <winsock.h>
diff --git a/src/system/Resolver.hxx b/src/system/Resolver.hxx
index 62ef455a1..ec557d1a0 100644
--- a/src/system/Resolver.hxx
+++ b/src/system/Resolver.hxx
@@ -27,8 +27,9 @@
struct sockaddr;
struct addrinfo;
class Error;
+class Domain;
-extern const class Domain resolver_domain;
+extern const Domain resolver_domain;
/**
* Converts the specified socket address into a string in the form
@@ -42,7 +43,7 @@ extern const class Domain resolver_domain;
*/
gcc_malloc
char *
-sockaddr_to_string(const struct sockaddr *sa, size_t length, Error &error);
+sockaddr_to_string(const sockaddr *sa, size_t length, Error &error);
/**
* Resolve a specification in the form "host", "host:port",
@@ -54,7 +55,7 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, Error &error);
* @return an #addrinfo linked list that must be freed with
* freeaddrinfo(), or NULL on error
*/
-struct addrinfo *
+addrinfo *
resolve_host_port(const char *host_port, unsigned default_port,
int flags, int socktype,
Error &error);
diff --git a/src/system/SignalFD.cxx b/src/system/SignalFD.cxx
index b89775dcd..d5953056d 100644
--- a/src/system/SignalFD.cxx
+++ b/src/system/SignalFD.cxx
@@ -20,7 +20,6 @@
#include "config.h"
#ifdef USE_SIGNALFD
#include "SignalFD.hxx"
-#include "fd_util.h"
#include "FatalError.hxx"
#include <assert.h>
diff --git a/src/system/SocketError.hxx b/src/system/SocketError.hxx
index 22fbd2441..28e1bace0 100644
--- a/src/system/SocketError.hxx
+++ b/src/system/SocketError.hxx
@@ -21,7 +21,7 @@
#define MPD_SOCKET_ERROR_HXX
#include "Compiler.h"
-#include "util/Error.hxx"
+#include "util/Error.hxx" // IWYU pragma: export
#ifdef WIN32
#include <winsock2.h>
@@ -31,11 +31,13 @@ typedef DWORD socket_error_t;
typedef int socket_error_t;
#endif
+class Domain;
+
/**
* A #Domain for #Error for socket I/O errors. The code is an errno
* value (or WSAGetLastError() on Windows).
*/
-extern const class Domain socket_domain;
+extern const Domain socket_domain;
gcc_pure
static inline socket_error_t
diff --git a/src/tag/Aiff.cxx b/src/tag/Aiff.cxx
index 73e46e49f..84c386678 100644
--- a/src/tag/Aiff.cxx
+++ b/src/tag/Aiff.cxx
@@ -26,9 +26,7 @@
#include <limits>
#include <stdint.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <string.h>
static constexpr Domain aiff_domain("aiff");
diff --git a/src/tag/ApeTag.hxx b/src/tag/ApeTag.hxx
index e35edc381..d2c0365c7 100644
--- a/src/tag/ApeTag.hxx
+++ b/src/tag/ApeTag.hxx
@@ -34,6 +34,6 @@ extern const struct tag_table ape_tags[];
*/
bool
tag_ape_scan2(Path path_fs,
- const struct tag_handler *handler, void *handler_ctx);
+ const tag_handler *handler, void *handler_ctx);
#endif
diff --git a/src/tag/Riff.cxx b/src/tag/Riff.cxx
index ad64afc39..73b2139d3 100644
--- a/src/tag/Riff.cxx
+++ b/src/tag/Riff.cxx
@@ -26,7 +26,6 @@
#include <limits>
#include <stdint.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
diff --git a/src/tag/Tag.hxx b/src/tag/Tag.hxx
index 5846e7a9d..e404a4f26 100644
--- a/src/tag/Tag.hxx
+++ b/src/tag/Tag.hxx
@@ -20,8 +20,8 @@
#ifndef MPD_TAG_HXX
#define MPD_TAG_HXX
-#include "TagType.h"
-#include "TagItem.hxx"
+#include "TagType.h" // IWYU pragma: export
+#include "TagItem.hxx" // IWYU pragma: export
#include "Compiler.h"
#include <algorithm>
diff --git a/src/tag/TagConfig.cxx b/src/tag/TagConfig.cxx
index 96fd1847f..0213ab4dc 100644
--- a/src/tag/TagConfig.cxx
+++ b/src/tag/TagConfig.cxx
@@ -30,8 +30,6 @@
#include <algorithm>
-#include <string.h>
-
void
TagLoadConfig()
{
diff --git a/src/tag/TagConfig.hxx b/src/tag/TagConfig.hxx
index 5ec6766d4..3bc86cc40 100644
--- a/src/tag/TagConfig.hxx
+++ b/src/tag/TagConfig.hxx
@@ -20,8 +20,6 @@
#ifndef MPD_TAG_CONFIG_HXX
#define MPD_TAG_CONFIG_HXX
-#include "TagType.h"
-
void
TagLoadConfig();
diff --git a/src/tag/TagId3.cxx b/src/tag/TagId3.cxx
index df70a95e5..6e1f341a2 100644
--- a/src/tag/TagId3.cxx
+++ b/src/tag/TagId3.cxx
@@ -21,7 +21,6 @@
#include "TagId3.hxx"
#include "TagHandler.hxx"
#include "TagTable.hxx"
-#include "Tag.hxx"
#include "TagBuilder.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
diff --git a/src/tag/TagId3.hxx b/src/tag/TagId3.hxx
index 749166116..aa564e946 100644
--- a/src/tag/TagId3.hxx
+++ b/src/tag/TagId3.hxx
@@ -33,10 +33,10 @@ class Error;
bool
tag_id3_scan(Path path_fs,
- const struct tag_handler *handler, void *handler_ctx);
+ const tag_handler *handler, void *handler_ctx);
Tag *
-tag_id3_import(struct id3_tag *);
+tag_id3_import(id3_tag *);
/**
* Loads the ID3 tags from the file into a libid3tag object. The
@@ -53,8 +53,8 @@ tag_id3_load(Path path_fs, Error &error);
*
*/
void
-scan_id3_tag(struct id3_tag *tag,
- const struct tag_handler *handler, void *handler_ctx);
+scan_id3_tag(id3_tag *tag,
+ const tag_handler *handler, void *handler_ctx);
#else
@@ -62,7 +62,7 @@ scan_id3_tag(struct id3_tag *tag,
static inline bool
tag_id3_scan(gcc_unused Path path_fs,
- gcc_unused const struct tag_handler *handler,
+ gcc_unused const tag_handler *handler,
gcc_unused void *handler_ctx)
{
return false;
diff --git a/src/tag/TagRva2.cxx b/src/tag/TagRva2.cxx
index 204001aa7..442695581 100644
--- a/src/tag/TagRva2.cxx
+++ b/src/tag/TagRva2.cxx
@@ -21,10 +21,10 @@
#include "TagRva2.hxx"
#include "ReplayGainInfo.hxx"
+#include <id3tag.h>
+
#include <stdint.h>
#include <string.h>
-#include <glib.h>
-#include <id3tag.h>
enum rva2_channel {
CHANNEL_OTHER = 0x00,
diff --git a/src/tag/TagRva2.hxx b/src/tag/TagRva2.hxx
index 98154041a..a1d67a777 100644
--- a/src/tag/TagRva2.hxx
+++ b/src/tag/TagRva2.hxx
@@ -32,6 +32,6 @@ struct ReplayGainInfo;
* @return true on success
*/
bool
-tag_rva2_parse(struct id3_tag *tag, ReplayGainInfo &replay_gain_info);
+tag_rva2_parse(id3_tag *tag, ReplayGainInfo &replay_gain_info);
#endif
diff --git a/src/util/Error.hxx b/src/util/Error.hxx
index facb461dc..aa704d593 100644
--- a/src/util/Error.hxx
+++ b/src/util/Error.hxx
@@ -24,6 +24,7 @@
#include "Compiler.h"
#include <string>
+#include <utility>
#include <assert.h>
diff --git a/src/util/FormatString.cxx b/src/util/FormatString.cxx
index c13d0fb52..ea6d41860 100644
--- a/src/util/FormatString.cxx
+++ b/src/util/FormatString.cxx
@@ -19,10 +19,13 @@
#include "FormatString.hxx"
-#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#ifdef WIN32
+#include <string.h>
+#endif
+
char *
FormatNewV(const char *fmt, va_list args)
{
diff --git a/src/util/Tokenizer.cxx b/src/util/Tokenizer.cxx
index 1c8af23fd..c9eb3949e 100644
--- a/src/util/Tokenizer.cxx
+++ b/src/util/Tokenizer.cxx
@@ -26,9 +26,6 @@
#include <glib.h>
-#include <assert.h>
-#include <string.h>
-
static constexpr Domain tokenizer_domain("tokenizer");
static inline bool