From 155fc8fa5a3abf1d802efb36cd4b4fa2b3f3d69a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 23 Jul 2020 16:14:23 +0200 Subject: [PATCH] include cleanup --- src/io/UniqueFileDescriptor.hxx | 4 ++-- src/io/uring/Operation.cxx | 2 ++ src/io/uring/Queue.cxx | 3 --- src/lib/dbus/AppendIter.hxx | 2 ++ src/net/AddressInfo.hxx | 7 ++++--- src/net/AllocatedSocketAddress.hxx | 2 +- src/net/SocketAddress.hxx | 4 ++-- src/net/SocketDescriptor.cxx | 1 + src/system/Error.hxx | 4 ++-- src/util/StringCompare.cxx | 2 ++ 10 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/io/UniqueFileDescriptor.hxx b/src/io/UniqueFileDescriptor.hxx index 8e808b231..0a6c03c8e 100644 --- a/src/io/UniqueFileDescriptor.hxx +++ b/src/io/UniqueFileDescriptor.hxx @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 Max Kellermann + * Copyright 2012-2020 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ #ifndef UNIQUE_FILE_DESCRIPTOR_HXX #define UNIQUE_FILE_DESCRIPTOR_HXX -#include "FileDescriptor.hxx" +#include "FileDescriptor.hxx" // IWYU pragma: export #include #include diff --git a/src/io/uring/Operation.cxx b/src/io/uring/Operation.cxx index cf8864e2d..120434e97 100644 --- a/src/io/uring/Operation.cxx +++ b/src/io/uring/Operation.cxx @@ -33,6 +33,8 @@ #include "Operation.hxx" #include "CancellableOperation.hxx" +#include + namespace Uring { void diff --git a/src/io/uring/Queue.cxx b/src/io/uring/Queue.cxx index b5032e9dc..f3ee9556e 100644 --- a/src/io/uring/Queue.cxx +++ b/src/io/uring/Queue.cxx @@ -32,11 +32,8 @@ #include "Queue.hxx" #include "CancellableOperation.hxx" -#include "Operation.hxx" #include "util/DeleteDisposer.hxx" -#include - namespace Uring { Queue::Queue(unsigned entries, unsigned flags) diff --git a/src/lib/dbus/AppendIter.hxx b/src/lib/dbus/AppendIter.hxx index 40067e82b..a6bdc595f 100644 --- a/src/lib/dbus/AppendIter.hxx +++ b/src/lib/dbus/AppendIter.hxx @@ -36,6 +36,8 @@ #include "Iter.hxx" #include "Values.hxx" +#include + namespace ODBus { class AppendMessageIter : public MessageIter { diff --git a/src/net/AddressInfo.hxx b/src/net/AddressInfo.hxx index 1e6350b75..578c53a07 100644 --- a/src/net/AddressInfo.hxx +++ b/src/net/AddressInfo.hxx @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 Max Kellermann + * Copyright 2016-2020 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,13 +31,14 @@ #define NET_ADDRESS_INFO_HXX #include "SocketAddress.hxx" +#include "util/Compiler.h" #include #ifdef _WIN32 -#include +#include // IWYU pragma: export #else -#include +#include // IWYU pragma: export #endif constexpr struct addrinfo diff --git a/src/net/AllocatedSocketAddress.hxx b/src/net/AllocatedSocketAddress.hxx index 002281685..1301a06d1 100644 --- a/src/net/AllocatedSocketAddress.hxx +++ b/src/net/AllocatedSocketAddress.hxx @@ -30,7 +30,7 @@ #ifndef ALLOCATED_SOCKET_ADDRESS_HXX #define ALLOCATED_SOCKET_ADDRESS_HXX -#include "SocketAddress.hxx" +#include "SocketAddress.hxx" // IWYU pragma: export #include "Features.hxx" #include "util/Compiler.h" diff --git a/src/net/SocketAddress.hxx b/src/net/SocketAddress.hxx index c1adc54f3..cd9a23156 100644 --- a/src/net/SocketAddress.hxx +++ b/src/net/SocketAddress.hxx @@ -36,9 +36,9 @@ #include #ifdef _WIN32 -#include +#include // IWYU pragma: export #else -#include +#include // IWYU pragma: export #endif template struct ConstBuffer; diff --git a/src/net/SocketDescriptor.cxx b/src/net/SocketDescriptor.cxx index 827ace4b8..aa09d992a 100644 --- a/src/net/SocketDescriptor.cxx +++ b/src/net/SocketDescriptor.cxx @@ -42,6 +42,7 @@ #include #endif +#include #include #include diff --git a/src/system/Error.hxx b/src/system/Error.hxx index 0050eb9c6..ea2f31d69 100644 --- a/src/system/Error.hxx +++ b/src/system/Error.hxx @@ -32,7 +32,7 @@ #include "util/Compiler.h" -#include +#include // IWYU pragma: export #include #include @@ -92,7 +92,7 @@ FormatLastError(const char *fmt, Args&&... args) noexcept #endif /* _WIN32 */ -#include +#include // IWYU pragma: export #include diff --git a/src/util/StringCompare.cxx b/src/util/StringCompare.cxx index a02887cec..6a0ab9391 100644 --- a/src/util/StringCompare.cxx +++ b/src/util/StringCompare.cxx @@ -29,6 +29,8 @@ #include "StringCompare.hxx" +#include + bool StringEndsWith(const char *haystack, const char *needle) noexcept {