Clean up #includes

Remove unused headers, and avoid relying on transitive inclusions

`include-what-you-use` has been very useful for this!
This commit is contained in:
ISSOtm
2024-03-28 01:16:51 +01:00
parent cae7b5dcf6
commit e5078aba3b
38 changed files with 19 additions and 83 deletions

View File

@@ -2,7 +2,6 @@
#include "asm/charmap.hpp"
#include <errno.h>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
@@ -11,8 +10,6 @@
#include "util.hpp"
#include "asm/main.hpp"
#include "asm/output.hpp"
#include "asm/warning.hpp"
// Charmaps are stored using a structure known as "trie".

View File

@@ -6,9 +6,6 @@
#include <math.h>
#include "asm/symbol.hpp"
#include "asm/warning.hpp"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

View File

@@ -10,7 +10,6 @@
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string_view>
#include "error.hpp"
#include "helpers.hpp"

View File

@@ -12,7 +12,6 @@
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <new>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@@ -45,7 +45,6 @@
%code {
#include <algorithm>
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>

View File

@@ -3,7 +3,6 @@
#include "asm/rpn.hpp"
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stdio.h>
@@ -13,7 +12,6 @@
#include "opmath.hpp"
#include "asm/main.hpp"
#include "asm/output.hpp"
#include "asm/section.hpp"
#include "asm/symbol.hpp"

View File

@@ -12,6 +12,8 @@
#include <stdlib.h>
#include <string.h>
#include "helpers.hpp"
#include "asm/fstack.hpp"
#include "asm/lexer.hpp"
#include "asm/main.hpp"

View File

@@ -3,13 +3,11 @@
#include "asm/symbol.hpp"
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <unordered_map>
#include "error.hpp"
#include "helpers.hpp"
#include "version.hpp"
#include "asm/fstack.hpp"

View File

@@ -5,7 +5,6 @@
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>

View File

@@ -5,11 +5,9 @@
#include <algorithm>
#include <assert.h>
#include <ctype.h>
#include <fstream>
#include <inttypes.h>
#include <ios>
#include <limits>
#include <numeric>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

View File

@@ -4,10 +4,8 @@
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <deque>
#include <inttypes.h>
#include <numeric>
#include <optional>
#include <queue>
#include <type_traits>
@@ -15,6 +13,7 @@
#include "helpers.hpp"
#include "gfx/main.hpp"
#include "gfx/proto_palette.hpp"
using std::swap;

View File

@@ -3,11 +3,11 @@
#include "gfx/pal_sorting.hpp"
#include <algorithm>
#include <assert.h>
#include "helpers.hpp"
#include "gfx/main.hpp"
#include "gfx/process.hpp"
namespace sorting {

View File

@@ -9,7 +9,6 @@
#include <inttypes.h>
#include <limits.h>
#include <optional>
#include <ostream>
#include <stdint.h>
#include <stdio.h>
#include <streambuf>
@@ -17,9 +16,8 @@
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include "helpers.hpp"
#include "platform.hpp"
#include "gfx/main.hpp"

View File

@@ -5,13 +5,9 @@
#include <algorithm>
#include <assert.h>
#include <errno.h>
#include <fstream>
#include <inttypes.h>
#include <limits.h>
#include <memory>
#include <optional>
#include <png.h>
#include <setjmp.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>

View File

@@ -2,6 +2,7 @@
#include "gfx/proto_palette.hpp"
#include <algorithm>
#include <assert.h>
#include "helpers.hpp"

View File

@@ -6,17 +6,14 @@
#include <array>
#include <assert.h>
#include <errno.h>
#include <fstream>
#include <inttypes.h>
#include <optional>
#include <png.h>
#include <string.h>
#include <tuple>
#include <vector>
#include "defaultinitalloc.hpp"
#include "file.hpp"
#include "helpers.hpp"
#include "itertools.hpp"
#include "gfx/main.hpp"

View File

@@ -2,7 +2,6 @@
#include "link/assign.hpp"
#include <algorithm>
#include <deque>
#include <inttypes.h>
#include <stdio.h>
@@ -14,9 +13,9 @@
#include "helpers.hpp"
#include "itertools.hpp"
#include "linkdefs.hpp"
#include "platform.hpp"
#include "link/main.hpp"
#include "link/object.hpp"
#include "link/output.hpp"
#include "link/section.hpp"
#include "link/symbol.hpp"

View File

@@ -2,7 +2,6 @@
#include "link/object.hpp"
#include <algorithm>
#include <deque>
#include <errno.h>
#include <inttypes.h>
@@ -17,11 +16,11 @@
#include "error.hpp"
#include "helpers.hpp"
#include "linkdefs.hpp"
#include "platform.hpp"
#include "version.hpp"
#include "link/assign.hpp"
#include "link/main.hpp"
#include "link/patch.hpp"
#include "link/sdas_obj.hpp"
#include "link/section.hpp"
#include "link/symbol.hpp"

View File

@@ -13,8 +13,9 @@
#include "error.hpp"
#include "extern/utf8decoder.hpp"
#include "itertools.hpp"
#include "helpers.hpp"
#include "linkdefs.hpp"
#include "platform.hpp"
#include "link/main.hpp"
#include "link/symbol.hpp"

View File

@@ -5,22 +5,15 @@
#include <assert.h>
#include <deque>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <variant>
#include <vector>
#include "error.hpp"
#include "helpers.hpp"
#include "opmath.hpp"
#include "platform.hpp"
#include "linkdefs.hpp"
#include "link/main.hpp"
#include "link/object.hpp"
#include "link/section.hpp"
#include "link/symbol.hpp"

View File

@@ -4,16 +4,13 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <memory>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <tuple>
#include <variant>
#include "helpers.hpp"
#include "linkdefs.hpp"
#include "platform.hpp"

View File

@@ -9,6 +9,7 @@
#include <unordered_map>
#include "error.hpp"
#include "helpers.hpp"
std::vector<std::unique_ptr<Section>> sectionList;
std::unordered_map<std::string, size_t> sectionMap; // Indexes into `sectionList`

View File

@@ -2,15 +2,10 @@
#include "link/symbol.hpp"
#include <inttypes.h>
#include <stdlib.h>
#include <unordered_map>
#include "error.hpp"
#include "helpers.hpp"
#include "link/main.hpp"
#include "link/object.hpp"
#include "link/section.hpp"
std::unordered_map<std::string, Symbol *> symbols;

View File

@@ -2,8 +2,6 @@
#include "linkdefs.hpp"
#include "platform.hpp"
using namespace std::literals;
// The default values are the most lax, as they are used as-is by RGBASM; only RGBLINK has the full

View File

@@ -2,7 +2,6 @@
#include "version.hpp"
#include <stdio.h>
#include <string.h>
#include "helpers.hpp"