From 837b94843556f309ec46260d961f74f093295be6 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 1 Jul 2020 17:02:44 +1000 Subject: [PATCH] Header cleanup using `include-what-you-use` --- adapter.hpp | 2 +- cmdopt.hpp | 2 -- colour.hpp | 2 -- cpp.cpp | 1 - encode/base.hpp | 1 - endian.hpp | 3 +-- fixed.hpp | 1 - geom/aabb.hpp | 2 -- geom/plane.hpp | 2 +- geom/ray.hpp | 6 ++---- introspection.hpp | 2 -- job/queue.hpp | 13 +++++-------- log/sink/path.hpp | 1 - map/fixed.hpp | 1 - point.hpp | 2 +- signal.hpp | 2 +- stream.hpp | 3 ++- strongdef.hpp | 1 - typeidx.hpp | 1 - 19 files changed, 14 insertions(+), 34 deletions(-) diff --git a/adapter.hpp b/adapter.hpp index a585e222..190968cc 100644 --- a/adapter.hpp +++ b/adapter.hpp @@ -6,9 +6,9 @@ * Copyright 2015-2019 Danny Robson */ -#include #include #include +#include namespace cruft::adapter { diff --git a/cmdopt.hpp b/cmdopt.hpp index ca750958..94141d88 100644 --- a/cmdopt.hpp +++ b/cmdopt.hpp @@ -6,7 +6,6 @@ * Copyright 2013-2016 Danny Robson */ - #ifndef CRUFT_UTIL_CMDLINE_HPP #define CRUFT_UTIL_CMDLINE_HPP @@ -17,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/colour.hpp b/colour.hpp index de87be52..54ba96f2 100644 --- a/colour.hpp +++ b/colour.hpp @@ -10,9 +10,7 @@ #define __UTIL_COLOUR_HPP #include "coord.hpp" -#include "introspection.hpp" -#include #include diff --git a/cpp.cpp b/cpp.cpp index 746ce02f..d520e782 100644 --- a/cpp.cpp +++ b/cpp.cpp @@ -11,7 +11,6 @@ #include "cpp.hpp" #include "io.hpp" -#include "cast.hpp" using cruft::cpp::include; using cruft::cpp::passthrough; diff --git a/encode/base.hpp b/encode/base.hpp index a83b8b46..ad8627a5 100644 --- a/encode/base.hpp +++ b/encode/base.hpp @@ -12,7 +12,6 @@ #include "../view.hpp" #include -#include namespace cruft::encode { diff --git a/endian.hpp b/endian.hpp index 5a142862..2b5adcaa 100644 --- a/endian.hpp +++ b/endian.hpp @@ -10,14 +10,13 @@ #include "std.hpp" #include "types/bits.hpp" -#include "cast.hpp" -#include #include #include #include #include + namespace cruft { //------------------------------------------------------------------------- // CXX: Update using "if constexpr" when available. It doesn't seem to be diff --git a/fixed.hpp b/fixed.hpp index 6b43da64..8f257a8a 100644 --- a/fixed.hpp +++ b/fixed.hpp @@ -11,7 +11,6 @@ #include "types/bits.hpp" #include "maths.hpp" -#include "endian.hpp" #include diff --git a/geom/aabb.hpp b/geom/aabb.hpp index 40671808..a412fbf6 100644 --- a/geom/aabb.hpp +++ b/geom/aabb.hpp @@ -12,8 +12,6 @@ #include "../extent.hpp" #include "../point.hpp" -#include - namespace cruft::geom { /////////////////////////////////////////////////////////////////////////// diff --git a/geom/plane.hpp b/geom/plane.hpp index a9918aaa..bc11671b 100644 --- a/geom/plane.hpp +++ b/geom/plane.hpp @@ -10,7 +10,7 @@ #include "../point.hpp" #include "../vector.hpp" -#include "../matrix.hpp" + namespace cruft::geom { /// represents an S dimensional plane in parametric form: ax + by + cz + d = 0 diff --git a/geom/ray.hpp b/geom/ray.hpp index 4dfc3ddf..84e4ad2d 100644 --- a/geom/ray.hpp +++ b/geom/ray.hpp @@ -6,13 +6,13 @@ * Copyright 2015-2018 Danny Robson */ -#ifndef __UTIL_GEOM_RAY_HPP -#define __UTIL_GEOM_RAY_HPP +#pragma once #include "aabb.hpp" #include "plane.hpp" #include "../vector.hpp" #include "../point.hpp" +#include "../matrix.hpp" #include @@ -134,5 +134,3 @@ namespace cruft::geom { std::ostream& operator<< (std::ostream&, ray); } - -#endif diff --git a/introspection.hpp b/introspection.hpp index ec0c922e..58ba4739 100644 --- a/introspection.hpp +++ b/introspection.hpp @@ -9,7 +9,6 @@ #pragma once #include "std.hpp" -#include "variadic.hpp" #include "algo/search.hpp" #include @@ -18,7 +17,6 @@ #include #include #include -#include #include #include #include diff --git a/job/queue.hpp b/job/queue.hpp index 1bc65645..97aeb00b 100644 --- a/job/queue.hpp +++ b/job/queue.hpp @@ -19,15 +19,12 @@ #include "../parallel/queue.hpp" -#include -#include -#include -#include -#include -#include #include -#include -#include +#include +#include +#include +#include +#include namespace cruft::job { diff --git a/log/sink/path.hpp b/log/sink/path.hpp index 41e8b42b..f69efc59 100644 --- a/log/sink/path.hpp +++ b/log/sink/path.hpp @@ -12,7 +12,6 @@ #include #include -#include namespace cruft::log::sink { diff --git a/map/fixed.hpp b/map/fixed.hpp index 413ed2fc..f15fcbd1 100644 --- a/map/fixed.hpp +++ b/map/fixed.hpp @@ -10,7 +10,6 @@ #include "../debug/assert.hpp" -#include #include #include #include diff --git a/point.hpp b/point.hpp index 397e744d..ac3f7fae 100644 --- a/point.hpp +++ b/point.hpp @@ -14,9 +14,9 @@ #include "maths.hpp" #include "view.hpp" -#include #include + namespace cruft { /// An n-dimensional position in space. /// diff --git a/signal.hpp b/signal.hpp index 40fdaf01..7dbe49c7 100644 --- a/signal.hpp +++ b/signal.hpp @@ -11,10 +11,10 @@ #include "types/traits.hpp" #include "debug/assert.hpp" -#include #include #include + namespace cruft { namespace reduce { /// Returns the short-circuited logical-and of the results of all diff --git a/stream.hpp b/stream.hpp index 21fd598a..e07d9450 100644 --- a/stream.hpp +++ b/stream.hpp @@ -10,8 +10,9 @@ #define __UTIL_STREAM_HPP #include -#include #include +#include + namespace cruft::stream { namespace scoped { diff --git a/strongdef.hpp b/strongdef.hpp index 81f4e94d..cc02511c 100644 --- a/strongdef.hpp +++ b/strongdef.hpp @@ -11,7 +11,6 @@ #include "cast.hpp" #include "types/traits.hpp" -#include #include #include diff --git a/typeidx.hpp b/typeidx.hpp index f288cba4..d2589062 100644 --- a/typeidx.hpp +++ b/typeidx.hpp @@ -10,7 +10,6 @@ #include -#include namespace cruft { namespace detail {