Remove unnecessary extern from nbSectionsToAssign

This commit is contained in:
Rangi42
2025-07-21 17:27:43 -04:00
parent ad81c74cda
commit a0e23ee911
3 changed files with 3 additions and 14 deletions

View File

@@ -3,10 +3,6 @@
#ifndef RGBDS_LINK_ASSIGN_HPP #ifndef RGBDS_LINK_ASSIGN_HPP
#define RGBDS_LINK_ASSIGN_HPP #define RGBDS_LINK_ASSIGN_HPP
#include <stdint.h>
extern uint64_t nbSectionsToAssign;
// Assigns all sections a slice of the address space // Assigns all sections a slice of the address space
void assign_AssignSections(); void assign_AssignSections();

View File

@@ -379,7 +379,6 @@ static void readSection(
} }
uint32_t nbPatches; uint32_t nbPatches;
tryReadLong( tryReadLong(
nbPatches, nbPatches,
file, file,
@@ -483,7 +482,6 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) {
verbosePrint("Reading object file %s\n", fileName); verbosePrint("Reading object file %s\n", fileName);
uint32_t revNum; uint32_t revNum;
tryReadLong(revNum, file, "%s: Cannot read revision number: %s", fileName); tryReadLong(revNum, file, "%s: Cannot read revision number: %s", fileName);
if (revNum != RGBDS_OBJECT_REV) { if (revNum != RGBDS_OBJECT_REV) {
fatal( fatal(
@@ -498,15 +496,13 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) {
); );
} }
uint32_t nbNodes;
uint32_t nbSymbols; uint32_t nbSymbols;
uint32_t nbSections;
tryReadLong(nbSymbols, file, "%s: Cannot read number of symbols: %s", fileName); 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); 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); tryReadLong(nbNodes, file, "%s: Cannot read number of nodes: %s", fileName);
nodes[fileID].resize(nbNodes); nodes[fileID].resize(nbNodes);
verbosePrint("Reading %u nodes...\n", nbNodes); verbosePrint("Reading %u nodes...\n", nbNodes);
@@ -545,7 +541,6 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) {
} }
uint32_t nbAsserts; uint32_t nbAsserts;
tryReadLong(nbAsserts, file, "%s: Cannot read number of assertions: %s", fileName); tryReadLong(nbAsserts, file, "%s: Cannot read number of assertions: %s", fileName);
verbosePrint("Reading %" PRIu32 " assertions...\n", nbAsserts); verbosePrint("Reading %" PRIu32 " assertions...\n", nbAsserts);
for (uint32_t i = 0; i < nbAsserts; i++) { for (uint32_t i = 0; i < nbAsserts; i++) {

View File

@@ -850,8 +850,6 @@ void sdobj_ReadFile(FileStackNode const &src, FILE *file, std::vector<Symbol> &f
); );
} }
nbSectionsToAssign += fileSections.size();
for (FileSection &entry : fileSections) { for (FileSection &entry : fileSections) {
std::unique_ptr<Section> &section = entry.section; std::unique_ptr<Section> &section = entry.section;