Use C++-style casts (#1576)

This commit is contained in:
Sylvie
2024-12-09 21:56:54 -05:00
committed by GitHub
parent e66da4c8c7
commit b877c81c32
33 changed files with 197 additions and 173 deletions

View File

@@ -30,8 +30,8 @@ struct FileStackNode {
// Meaningless at the root level, but gets written to the object file anyway, so init it
uint32_t lineNo = 0;
// Set only if referenced: ID within the object file, -1 if not output yet
uint32_t ID = -1;
// Set only if referenced: ID within the object file, `UINT32_MAX` if not output yet
uint32_t ID = UINT32_MAX;
// REPT iteration counts since last named node, in reverse depth order
std::vector<uint32_t> &iters() { return data.get<std::vector<uint32_t>>(); }

View File

@@ -45,7 +45,7 @@ struct Symbol {
>
data;
uint32_t ID; // ID of the symbol in the object file (-1 if none)
uint32_t ID; // ID of the symbol in the object file (`UINT32_MAX` if none)
uint32_t defIndex; // Ordering of the symbol in the state file
bool isDefined() const { return type != SYM_REF; }
@@ -55,7 +55,7 @@ struct Symbol {
bool isConstant() const {
if (type == SYM_LABEL) {
Section const *sect = getSection();
return sect && sect->org != (uint32_t)-1;
return sect && sect->org != UINT32_MAX;
}
return type == SYM_EQU || type == SYM_VAR;
}