mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-23 19:42:08 +00:00
Make all non-extern globals static
This commit is contained in:
@@ -32,9 +32,9 @@ struct FreeSpace {
|
||||
};
|
||||
|
||||
// Table of free space for each bank
|
||||
std::vector<std::deque<FreeSpace>> memory[SECTTYPE_INVALID];
|
||||
static std::vector<std::deque<FreeSpace>> memory[SECTTYPE_INVALID];
|
||||
|
||||
uint64_t nbSectionsToAssign;
|
||||
static uint64_t nbSectionsToAssign;
|
||||
|
||||
// Init the free space-modelling structs
|
||||
static void initFreeSpace() {
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
|
||||
Options options;
|
||||
|
||||
FILE *linkerScript;
|
||||
|
||||
std::string const &FileStackNode::dump(uint32_t curLineNo) const {
|
||||
if (std::holds_alternative<std::vector<uint32_t>>(data)) {
|
||||
assume(parent); // REPT nodes use their parent's name
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
|
||||
static constexpr size_t BANK_SIZE = 0x4000;
|
||||
|
||||
FILE *outputFile;
|
||||
FILE *overlayFile;
|
||||
FILE *symFile;
|
||||
FILE *mapFile;
|
||||
static FILE *outputFile;
|
||||
static FILE *overlayFile;
|
||||
static FILE *symFile;
|
||||
static FILE *mapFile;
|
||||
|
||||
struct SortedSymbol {
|
||||
Symbol const *sym;
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
#include "link/symbol.hpp"
|
||||
#include "link/warning.hpp"
|
||||
|
||||
std::deque<Assertion> assertions;
|
||||
static std::deque<Assertion> assertions;
|
||||
|
||||
struct RPNStackEntry {
|
||||
int32_t value;
|
||||
bool errorFlag; // Whether the value is a placeholder inserted for error recovery
|
||||
};
|
||||
|
||||
std::deque<RPNStackEntry> rpnStack;
|
||||
static std::deque<RPNStackEntry> rpnStack;
|
||||
|
||||
static void pushRPN(int32_t value, bool comesFromError) {
|
||||
rpnStack.push_front({.value = value, .errorFlag = comesFromError});
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
#include "link/warning.hpp"
|
||||
|
||||
std::vector<std::unique_ptr<Section>> sectionList;
|
||||
std::unordered_map<std::string, size_t> sectionMap; // Indexes into `sectionList`
|
||||
static std::vector<std::unique_ptr<Section>> sectionList;
|
||||
static std::unordered_map<std::string, size_t> sectionMap; // Indexes into `sectionList`
|
||||
|
||||
void sect_ForEach(void (*callback)(Section &)) {
|
||||
for (std::unique_ptr<Section> &ptr : sectionList) {
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
#include "link/section.hpp"
|
||||
#include "link/warning.hpp"
|
||||
|
||||
std::unordered_map<std::string, Symbol *> symbols;
|
||||
std::unordered_map<std::string, std::vector<Symbol *>> localSymbols;
|
||||
static std::unordered_map<std::string, Symbol *> symbols;
|
||||
static std::unordered_map<std::string, std::vector<Symbol *>> localSymbols;
|
||||
|
||||
void sym_ForEach(void (*callback)(Symbol &)) {
|
||||
for (auto &it : symbols) {
|
||||
|
||||
Reference in New Issue
Block a user