From 1ca4282e3187c24467e8467be9570effb5adfb0c Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Wed, 16 Sep 2026 21:37:29 -0400 Subject: [PATCH] Move a function closer to its usage point Trying to keep code grouped together well. --- src/link/assign.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/link/assign.cpp b/src/link/assign.cpp index 201116db..b7083a12 100644 --- a/src/link/assign.cpp +++ b/src/link/assign.cpp @@ -36,17 +36,6 @@ struct FreeSpace { // Table of free space for each bank static std::vector> memory[SECTTYPE_INVALID]; -// Assigns a section to a given memory location -static void assignSection(Section §ion, MemoryLocation const &location) { - // Propagate the assigned location to all UNIONs/FRAGMENTs - // so `jr` patches in them will have the correct offset - for (Section &piece : section.pieces()) { - piece.org = location.address; - piece.bank = location.bank; - } - out_AddSection(section); -} - // Checks whether a given location is suitable for placing a given section // This checks not only that the location has enough room for the section, but // also that the constraints (alignment...) are respected. @@ -249,6 +238,17 @@ static std::string getSectionDescription(Section const §ion) { return description; } +// Assigns a section to a given memory location +static void assignSection(Section §ion, MemoryLocation const &location) { + // Propagate the assigned location to all UNIONs/FRAGMENTs + // so `jr` patches in them will have the correct offset + for (Section &piece : section.pieces()) { + piece.org = location.address; + piece.bank = location.bank; + } + out_AddSection(section); +} + // Places a section in a suitable location, or error out if it fails to. // Due to the implemented algorithm, this should be called with sections of decreasing size! static void placeSection(Section §ion) {