From a0e23ee9119c2a6160de488dc0a0ac848d384e29 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 21 Jul 2025 17:27:43 -0400 Subject: [PATCH] Remove unnecessary `extern` from `nbSectionsToAssign` --- include/link/assign.hpp | 4 ---- src/link/object.cpp | 11 +++-------- src/link/sdas_obj.cpp | 2 -- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/include/link/assign.hpp b/include/link/assign.hpp index 42fdbade..6e681808 100644 --- a/include/link/assign.hpp +++ b/include/link/assign.hpp @@ -3,10 +3,6 @@ #ifndef RGBDS_LINK_ASSIGN_HPP #define RGBDS_LINK_ASSIGN_HPP -#include - -extern uint64_t nbSectionsToAssign; - // Assigns all sections a slice of the address space void assign_AssignSections(); diff --git a/src/link/object.cpp b/src/link/object.cpp index 543438b4..233da1f7 100644 --- a/src/link/object.cpp +++ b/src/link/object.cpp @@ -379,7 +379,6 @@ static void readSection( } uint32_t nbPatches; - tryReadLong( nbPatches, file, @@ -483,7 +482,6 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) { verbosePrint("Reading object file %s\n", fileName); uint32_t revNum; - tryReadLong(revNum, file, "%s: Cannot read revision number: %s", fileName); if (revNum != RGBDS_OBJECT_REV) { fatal( @@ -498,15 +496,13 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) { ); } - uint32_t nbNodes; uint32_t nbSymbols; - uint32_t nbSections; - tryReadLong(nbSymbols, file, "%s: Cannot read number of symbols: %s", fileName); + + uint32_t nbSections; tryReadLong(nbSections, file, "%s: Cannot read number of sections: %s", fileName); - nbSectionsToAssign += nbSections; - + uint32_t nbNodes; tryReadLong(nbNodes, file, "%s: Cannot read number of nodes: %s", fileName); nodes[fileID].resize(nbNodes); verbosePrint("Reading %u nodes...\n", nbNodes); @@ -545,7 +541,6 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) { } uint32_t nbAsserts; - tryReadLong(nbAsserts, file, "%s: Cannot read number of assertions: %s", fileName); verbosePrint("Reading %" PRIu32 " assertions...\n", nbAsserts); for (uint32_t i = 0; i < nbAsserts; i++) { diff --git a/src/link/sdas_obj.cpp b/src/link/sdas_obj.cpp index 50285fb9..ec8a4a83 100644 --- a/src/link/sdas_obj.cpp +++ b/src/link/sdas_obj.cpp @@ -850,8 +850,6 @@ void sdobj_ReadFile(FileStackNode const &src, FILE *file, std::vector &f ); } - nbSectionsToAssign += fileSections.size(); - for (FileSection &entry : fileSections) { std::unique_ptr
§ion = entry.section;