From f909615b14379da2c281d8c3727ca302793a59b5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 15 Aug 2019 17:57:20 +0200 Subject: [PATCH] include cleanups (powered by iwyu) --- src/fs/Charset.cxx | 1 - src/input/plugins/TidalErrorParser.cxx | 1 - src/lib/curl/Delegate.cxx | 2 ++ src/lib/dbus/Message.cxx | 4 +++- src/lib/dbus/Message.hxx | 3 +-- src/lib/ffmpeg/LogError.cxx | 2 -- src/lib/icu/CaseFold.cxx | 1 - src/lib/icu/Converter.cxx | 1 - src/lib/icu/Util.cxx | 1 - src/playlist/plugins/FlacPlaylistPlugin.cxx | 1 - src/util/HugeAllocator.hxx | 3 +-- src/util/WStringCompare.cxx | 4 +++- test/read_mixer.cxx | 4 ---- test/run_encoder.cxx | 2 +- test/run_output.cxx | 2 +- test/test_vorbis_encoder.cxx | 2 +- 16 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx index d38c37468..941021fa7 100644 --- a/src/fs/Charset.cxx +++ b/src/fs/Charset.cxx @@ -33,7 +33,6 @@ #include #include -#include #ifdef HAVE_FS_CHARSET diff --git a/src/input/plugins/TidalErrorParser.cxx b/src/input/plugins/TidalErrorParser.cxx index 61d997499..f1832c398 100644 --- a/src/input/plugins/TidalErrorParser.cxx +++ b/src/input/plugins/TidalErrorParser.cxx @@ -20,7 +20,6 @@ #include "TidalErrorParser.hxx" #include "TidalError.hxx" #include "lib/yajl/Callbacks.hxx" -#include "util/ConstBuffer.hxx" #include "util/RuntimeError.hxx" using Wrapper = Yajl::CallbacksWrapper; diff --git a/src/lib/curl/Delegate.cxx b/src/lib/curl/Delegate.cxx index a2511d2d5..2ebb9cd7a 100644 --- a/src/lib/curl/Delegate.cxx +++ b/src/lib/curl/Delegate.cxx @@ -30,6 +30,8 @@ #include "Delegate.hxx" #include "Parser.hxx" +#include + #include void diff --git a/src/lib/dbus/Message.cxx b/src/lib/dbus/Message.cxx index 5206af9f3..b391b0c35 100644 --- a/src/lib/dbus/Message.cxx +++ b/src/lib/dbus/Message.cxx @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 Content Management AG + * Copyright 2007-2019 Content Management AG * All rights reserved. * * author: Max Kellermann @@ -33,6 +33,8 @@ #include "Message.hxx" #include "ReadIter.hxx" +#include + ODBus::Message ODBus::Message::NewMethodCall(const char *destination, const char *path, diff --git a/src/lib/dbus/Message.hxx b/src/lib/dbus/Message.hxx index 545abf2a1..5e7dc7f06 100644 --- a/src/lib/dbus/Message.hxx +++ b/src/lib/dbus/Message.hxx @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 Content Management AG + * Copyright 2007-2019 Content Management AG * All rights reserved. * * author: Max Kellermann @@ -35,7 +35,6 @@ #include -#include #include namespace ODBus { diff --git a/src/lib/ffmpeg/LogError.cxx b/src/lib/ffmpeg/LogError.cxx index c114c1fa1..0b9d255af 100644 --- a/src/lib/ffmpeg/LogError.cxx +++ b/src/lib/ffmpeg/LogError.cxx @@ -21,8 +21,6 @@ #include "Domain.hxx" #include "Log.hxx" -#include /* needed due to libavutil bug */ - extern "C" { #include } diff --git a/src/lib/icu/CaseFold.cxx b/src/lib/icu/CaseFold.cxx index 2aa3720e4..669047269 100644 --- a/src/lib/icu/CaseFold.cxx +++ b/src/lib/icu/CaseFold.cxx @@ -27,7 +27,6 @@ #ifdef HAVE_ICU #include "Util.hxx" #include "util/AllocatedArray.hxx" -#include "util/ConstBuffer.hxx" #include #include diff --git a/src/lib/icu/Converter.cxx b/src/lib/icu/Converter.cxx index 3e464a3af..7c46c726c 100644 --- a/src/lib/icu/Converter.cxx +++ b/src/lib/icu/Converter.cxx @@ -20,7 +20,6 @@ #include "Converter.hxx" #include "util/AllocatedString.hxx" #include "util/AllocatedArray.hxx" -#include "util/ConstBuffer.hxx" #include "util/FormatString.hxx" #include "config.h" diff --git a/src/lib/icu/Util.cxx b/src/lib/icu/Util.cxx index 5fc12534a..7ce3a7857 100644 --- a/src/lib/icu/Util.cxx +++ b/src/lib/icu/Util.cxx @@ -20,7 +20,6 @@ #include "Util.hxx" #include "util/AllocatedString.hxx" #include "util/AllocatedArray.hxx" -#include "util/WritableBuffer.hxx" #include "util/ConstBuffer.hxx" #include diff --git a/src/playlist/plugins/FlacPlaylistPlugin.cxx b/src/playlist/plugins/FlacPlaylistPlugin.cxx index 30793aeac..fd2cd4983 100644 --- a/src/playlist/plugins/FlacPlaylistPlugin.cxx +++ b/src/playlist/plugins/FlacPlaylistPlugin.cxx @@ -31,7 +31,6 @@ #include "song/DetachedSong.hxx" #include "input/InputStream.hxx" #include "util/RuntimeError.hxx" -#include "util/ScopeExit.hxx" #include diff --git a/src/util/HugeAllocator.hxx b/src/util/HugeAllocator.hxx index 6ae68f78e..93c06d5f9 100644 --- a/src/util/HugeAllocator.hxx +++ b/src/util/HugeAllocator.hxx @@ -31,7 +31,6 @@ #define HUGE_ALLOCATOR_HXX #include "WritableBuffer.hxx" -#include "Compiler.h" #include @@ -85,7 +84,7 @@ WritableBuffer HugeAllocate(size_t size); static inline void -HugeFree(void *p, gcc_unused size_t size) noexcept +HugeFree(void *p, size_t) noexcept { VirtualFree(p, 0, MEM_RELEASE); } diff --git a/src/util/WStringCompare.cxx b/src/util/WStringCompare.cxx index b255f8e64..ea67f3d2d 100644 --- a/src/util/WStringCompare.cxx +++ b/src/util/WStringCompare.cxx @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 Max Kellermann + * Copyright 2013-2019 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +29,8 @@ #include "WStringCompare.hxx" +#include + bool StringEndsWith(const wchar_t *haystack, const wchar_t *needle) noexcept { diff --git a/test/read_mixer.cxx b/test/read_mixer.cxx index c9d1496a5..603660c3b 100644 --- a/test/read_mixer.cxx +++ b/test/read_mixer.cxx @@ -21,15 +21,11 @@ #include "mixer/MixerControl.hxx" #include "mixer/MixerList.hxx" #include "filter/FilterRegistry.hxx" -#include "pcm/Volume.hxx" -#include "Main.hxx" #include "event/Loop.hxx" #include "config/Block.hxx" #include "util/PrintException.hxx" #include -#include -#include #include const FilterPlugin * diff --git a/test/run_encoder.cxx b/test/run_encoder.cxx index 41a6e5c49..5f567ad75 100644 --- a/test/run_encoder.cxx +++ b/test/run_encoder.cxx @@ -27,11 +27,11 @@ #include "fs/io/StdioOutputStream.hxx" #include "util/PrintException.hxx" +#include #include #include #include -#include #include int main(int argc, char **argv) diff --git a/test/run_output.cxx b/test/run_output.cxx index 2a31c001a..bbefaa1ad 100644 --- a/test/run_output.cxx +++ b/test/run_output.cxx @@ -24,7 +24,7 @@ #include "event/Thread.hxx" #include "fs/Path.hxx" #include "AudioParser.hxx" -#include "pcm/Convert.hxx" +#include "AudioFormat.hxx" #include "util/StringBuffer.hxx" #include "util/RuntimeError.hxx" #include "util/ScopeExit.hxx" diff --git a/test/test_vorbis_encoder.cxx b/test/test_vorbis_encoder.cxx index 62ac660d3..496466a54 100644 --- a/test/test_vorbis_encoder.cxx +++ b/test/test_vorbis_encoder.cxx @@ -30,8 +30,8 @@ #include +#include #include -#include static uint8_t zero[256];