mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 11:12:07 +00:00
Replace some #define with constexpr
This commit is contained in:
@@ -328,9 +328,9 @@ static void placeSection(Section §ion) {
|
||||
);
|
||||
}
|
||||
|
||||
#define BANK_CONSTRAINED (1 << 2)
|
||||
#define ORG_CONSTRAINED (1 << 1)
|
||||
#define ALIGN_CONSTRAINED (1 << 0)
|
||||
static constexpr uint8_t BANK_CONSTRAINED = 1 << 2;
|
||||
static constexpr uint8_t ORG_CONSTRAINED = 1 << 1;
|
||||
static constexpr uint8_t ALIGN_CONSTRAINED = 1 << 0;
|
||||
static std::deque<Section *> unassignedSections[1 << 3];
|
||||
|
||||
/*
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "link/section.hpp"
|
||||
#include "link/symbol.hpp"
|
||||
|
||||
#define BANK_SIZE 0x4000
|
||||
static constexpr size_t BANK_SIZE = 0x4000;
|
||||
|
||||
FILE *outputFile;
|
||||
FILE *overlayFile;
|
||||
|
||||
@@ -201,7 +201,8 @@ void sdobj_ReadFile(FileStackNode const &where, FILE *file, std::vector<Symbol>
|
||||
fatal(&where, lineNo, "Unknown endianness type '%c'", line[0]);
|
||||
}
|
||||
|
||||
#define ADDR_SIZE 3
|
||||
static constexpr uint8_t ADDR_SIZE = 3;
|
||||
|
||||
if (line[1] != '0' + ADDR_SIZE)
|
||||
fatal(&where, lineNo, "Unknown or unsupported address size '%c'", line[1]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user