iwyu: remove, add std headers where used (#5694)

* chore: remove unused #include <array>

* chore: remove unused #include <chrono>

* chore: remove unused #include <set>

* chore: remove unused #include <algorithm>

* chore: remove unused #include "interned-string.h"

* chore: remove unused #include <list>

* chore: remove unused #include <optional>

* chore: iwyu <cstddef>

* chore: iwyu <ctime>

* chore: remove unused #include <cerrno>

* chore: remove unused #include <deque>

* chore: remove unused #include <vector>

* chore: remove unused #include <memory>

* chore: remove unused #include <unordered_set>

* chore: remove unused #include <array>

* chore: remove unused #include <mutex>

* chore: remove unused #include <functional>

* chore: remove unused #include <cmath>
This commit is contained in:
Charles Kerr 2023-06-29 23:51:55 -05:00 committed by GitHub
parent cb101ec6cf
commit ce66e5c442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 31 additions and 54 deletions

View File

@ -46,7 +46,6 @@
#include <algorithm>
#include <cinttypes> // PRId64
#include <cmath> // pow()
#include <cstring> // strstr
#include <functional>
#include <iostream>

View File

@ -17,8 +17,7 @@
#include <fmt/core.h>
#include <array>
#include <functional>
#include <cmath>
#include <utility>
using namespace std::string_view_literals;

View File

@ -19,7 +19,6 @@
#include <bitset>
#include <initializer_list>
#include <memory>
#include <vector>
class Percents;

View File

@ -42,7 +42,6 @@
#include <fmt/core.h>
#include <array>
#include <functional>
#include <memory>
#include <stack>

View File

@ -5,7 +5,7 @@
#pragma once
#include <cstddef>
#include <cstddef> // size_t
#include <optional>
#include <string>
#include <string_view>

View File

@ -12,7 +12,6 @@
#include <array>
#include <chrono>
#include <cstdint> // uint64_t
#include <functional>
#include <optional>
#include <string>
#include <string_view>

View File

@ -5,7 +5,6 @@
#include <algorithm> // std::copy_n()
#include <cctype>
#include <chrono>
#include <cstdio> /* fprintf() */
#include <iomanip>
#include <iostream>

View File

@ -4,7 +4,6 @@
// License text can be found in the licenses/ folder.
#include <algorithm> // for std::find_if()
#include <cerrno> // for errno, EAFNOSUPPORT
#include <climits> // for CHAR_BIT
#include <cstring> // for memset()
#include <ctime>

View File

@ -14,6 +14,8 @@
#include <cstdint> // uint32_t
#include <ctime>
#include <functional>
#include <memory>
#include <optional>
#include <string_view>
#include <vector>

View File

@ -4,7 +4,6 @@
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <array>
#include <climits> // SIZE_MAX
#include <vector>

View File

@ -3,7 +3,6 @@
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <memory>
#include <utility>
#include <vector>

View File

@ -6,7 +6,6 @@
#include <algorithm>
#include <array>
#include <cctype>
#include <functional>
#include <iterator>
#include <random>
#include <string>

View File

@ -7,6 +7,7 @@
#include <array>
#include <chrono>
#include <cstddef> // size_t
#include <fstream>
#include <functional>
#include <iostream>

View File

@ -3,7 +3,6 @@
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <set>
#include <vector>

View File

@ -6,7 +6,6 @@
#undef _GNU_SOURCE
#define _GNU_SOURCE // NOLINT
#include <algorithm>
#include <array>
#include <cerrno>
#include <climits> /* PATH_MAX */

View File

@ -4,9 +4,9 @@
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <array>
#include <cctype> // for isalpha()
#include <cstring>
#include <ctime>
#include <iterator> // for std::back_inserter
#include <optional>
#include <string>

View File

@ -3,7 +3,6 @@
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <string>
#include <string_view>
#include <vector>

View File

@ -5,7 +5,6 @@
#pragma once
#include <cstddef> // size_t
#include <cstdint> // uint64_t
#include <ctime> // time_t
#include <functional>

View File

@ -4,7 +4,6 @@
// License text can be found in the licenses/ folder.
#include <algorithm> // std::all_of
#include <chrono>
#include <cstddef>
#include <string_view>
#include <utility> // std::move

View File

@ -5,8 +5,9 @@
#include <array>
#include <atomic>
#include <condition_variable>
#include <chrono> // std::chrono::milliseconds
#include <condition_variable>
#include <cstddef> // size_t
#include <memory> // std::unique_ptr
#include <mutex>
#include <optional>

View File

@ -5,8 +5,6 @@
#include <algorithm>
#include <array>
#include <cerrno>
#include <chrono>
#include <string_view>
#include <utility>

View File

@ -9,6 +9,7 @@
#error only libtransmission should #include this header.
#endif
#include <cstddef> // size_t
#include <cstdint> // uint8_t, uint32_t
#include "transmission.h"

View File

@ -5,7 +5,7 @@
#pragma once
#include <cstddef>
#include <cstddef> // size_t
#include <ctime>
#include <optional>
#include <string>

View File

@ -5,9 +5,8 @@
#pragma once
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstddef> // size_t
#include <cstdint>
#include <functional>
#include <utility>

View File

@ -5,7 +5,7 @@
#pragma once
#include <cstddef>
#include <cstddef> // size_t
#include <string>
#include <string_view>
#include <vector>

View File

@ -8,7 +8,6 @@
#include <climits>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <iterator> // std::back_inserter
#include <string_view>
#include <utility> // std::pair

View File

@ -3,7 +3,6 @@
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <array>
#include <cstdint> // uint8_t, uint64_t
#include <string_view>

View File

@ -10,6 +10,7 @@
#endif
#include <array>
#include <cstddef> // size_t
#include <cstdint> // uint8_t, uint32_t, uint64_t
#include <string>
@ -18,7 +19,6 @@
#include "bitfield.h"
#include "block-info.h"
#include "history.h"
#include "interned-string.h"
#include "net.h" // tr_port
/**

View File

@ -3,7 +3,6 @@
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <array>
#include <cerrno>
#include <cstdint>

View File

@ -8,7 +8,6 @@
#include <memory>
#include <utility>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <small/map.hpp>

View File

@ -3,7 +3,6 @@
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <cstddef>
#include <set>
#include <utility>

View File

@ -11,7 +11,6 @@
#include <cmath>
#include <cstdint>
#include <ctime> // time_t
#include <deque>
#include <map>
#include <iterator> // std::back_inserter
#include <memory>

View File

@ -14,7 +14,6 @@
#include <algorithm> // for std::copy_n()
#include <array>
#include <cstddef> // size_t, std::byte
#include <memory>
#include "tr-macros.h" // tr_sha1_digest_t
#include "tr-arc4.h"

View File

@ -9,11 +9,13 @@
#error only libtransmission should #include this header.
#endif
#include <array>
#include <atomic>
#include <cstddef> // for size_t
#include <memory>
#include <utility> // for std::pair<>
#include "interned-string.h"
#include "peer-common.h" // for tr_peer
class tr_peer;

View File

@ -10,6 +10,7 @@
#endif
#include <atomic>
#include <cstddef> // size_t
#include <string>
#include <string_view>
#include <utility> // for std::make_pair()

View File

@ -6,7 +6,6 @@
#include <array>
#include <cerrno>
#include <cstdint> // uint32_t
#include <ctime>
#include <event2/util.h> /* evutil_inet_ntop() */

View File

@ -7,7 +7,6 @@
#include <cerrno>
#include <chrono>
#include <future>
#include <mutex>
#include <string>
#include <thread>
#include <utility>

View File

@ -3,7 +3,6 @@
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <cstring>
#include <ctime>
#include <string_view>

View File

@ -9,6 +9,7 @@
#error only libtransmission should #include this header.
#endif
#include <cstddef> // size_t
#include <memory>
#include <string>
#include <string_view>

View File

@ -10,6 +10,7 @@
#pragma once
#include <bitset>
#include <cstddef> // size_t
#include <ctime> // for time_t
#include <optional>

View File

@ -3,7 +3,6 @@
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#include <ctime>
#include <string_view>
#include <iterator> // for std::back_inserter

View File

@ -12,12 +12,10 @@
#include <ctime>
#include <future>
#include <iterator> // for std::back_inserter
#include <list>
#include <memory>
#include <numeric> // for std::accumulate()
#include <string>
#include <string_view>
#include <unordered_set>
#include <utility>
#include <vector>

View File

@ -14,6 +14,8 @@
#include <array>
#include <cstddef> // size_t
#include <cstdint> // uintX_t
#include <ctime> // time_t
#include <functional>
#include <future>
#include <memory>
#include <mutex>

View File

@ -4,7 +4,6 @@
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <array>
#include <cerrno> // for EINVAL
#include <string>
#include <string_view>

View File

@ -9,6 +9,7 @@
#error only libtransmission should #include this header.
#endif
#include <cstddef> // size_t
#include <ctime>
#include <string_view>
#include <utility>

View File

@ -9,8 +9,6 @@
#include <cstddef>
#include <iterator>
#include <limits>
#include <memory>
#include <optional>
#include <string>
#include <string_view>

View File

@ -3,7 +3,6 @@
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <cerrno>
#include <chrono>
#include <cstdio>
#include <cstdlib> // for abort()

View File

@ -8,6 +8,8 @@
#error only libtransmission should #include this header.
#endif
#include <cstddef> // size_t
#include <ctime>
#include <memory>
#include <string_view>
#include <vector>

View File

@ -3,7 +3,6 @@
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#include <algorithm>
#include <cstdlib> /* exit() */
#include <cstring>
#include <string_view>

View File

@ -10,14 +10,15 @@
// --- Basic Types
#include <stdbool.h> /* bool */
#include <stddef.h> /* size_t */
#include <stdint.h> /* uintN_t */
#include <time.h> /* time_t */
#include <stddef.h> // size_t
#include <stdint.h> // uintN_t
#include <time.h> // time_t
#ifdef __cplusplus
#include <string>
#include <string_view>
#else
#include <stdbool.h> // bool
#endif
#include "tr-macros.h"

View File

@ -6,7 +6,6 @@
#include <algorithm> // for std::sort, std::transform
#include <array> // std::array
#include <cctype>
#include <cerrno>
#include <cfloat> // DBL_DIG
#include <chrono>
#include <cstdint> // SIZE_MAX

View File

@ -7,6 +7,7 @@
#include <cstddef> // size_t
#include <cstdint> // int64_t
#include <optional>
#include <string>
#include <string_view>

View File

@ -7,7 +7,6 @@
#include <ctime>
#include <mutex>
#include <optional>
#include <set>
#include <thread>
#include <vector>

View File

@ -4,7 +4,6 @@
// License text can be found in the licenses/ folder.
#include <chrono>
#include <set>
#define LIBTRANSMISSION_WATCHDIR_MODULE

View File

@ -6,7 +6,8 @@
#pragma once
#include <chrono>
#include <cstddef>
#include <cstddef> // size_t
#include <ctime> // time_t
#include <functional>
#include <memory>
#include <optional>

View File

@ -10,7 +10,6 @@
#include "Speed.h"
#include <algorithm>
#include <array>
Formatter& Formatter::get()
{

View File

@ -8,7 +8,6 @@
#include <cctype> /* isspace */
#include <cinttypes> // PRId64
#include <cerrno>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring> /* strcmp */