mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Use // line comments not /* block comments
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "link/assign.hpp"
|
||||
|
||||
@@ -48,11 +48,9 @@ static void initFreeSpace() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Assigns a section to a given memory location
|
||||
* @param section The section to assign
|
||||
* @param location The location to assign the section to
|
||||
*/
|
||||
// Assigns a section to a given memory location
|
||||
// @param section The section to assign
|
||||
// @param location The location to assign the section to
|
||||
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
|
||||
@@ -66,15 +64,13 @@ static void assignSection(Section §ion, MemoryLocation const &location) {
|
||||
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.
|
||||
* @param section The section to be placed
|
||||
* @param freeSpace The candidate free space to place the section into
|
||||
* @param location The location to attempt placing the section at
|
||||
* @return True if the location is suitable, false otherwise.
|
||||
*/
|
||||
// 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.
|
||||
// @param section The section to be placed
|
||||
// @param freeSpace The candidate free space to place the section into
|
||||
// @param location The location to attempt placing the section at
|
||||
// @return True if the location is suitable, false otherwise.
|
||||
static bool isLocationSuitable(
|
||||
Section const §ion, FreeSpace const &freeSpace, MemoryLocation const &location
|
||||
) {
|
||||
@@ -90,13 +86,11 @@ static bool isLocationSuitable(
|
||||
return location.address + section.size <= freeSpace.address + freeSpace.size;
|
||||
}
|
||||
|
||||
/*
|
||||
* Finds a suitable location to place a section at.
|
||||
* @param section The section to be placed
|
||||
* @param location A pointer to a memory location that will be filled
|
||||
* @return The index into `memory[section->type]` of the free space encompassing the location,
|
||||
* or -1 if none was found
|
||||
*/
|
||||
// Finds a suitable location to place a section at.
|
||||
// @param section The section to be placed
|
||||
// @param location A pointer to a memory location that will be filled
|
||||
// @return The index into `memory[section->type]` of the free space encompassing the location,
|
||||
// or -1 if none was found
|
||||
static ssize_t getPlacement(Section const §ion, MemoryLocation &location) {
|
||||
SectionTypeInfo const &typeInfo = sectionTypeInfo[section.type];
|
||||
|
||||
@@ -206,12 +200,10 @@ static ssize_t getPlacement(Section const §ion, MemoryLocation &location) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Places a section in a suitable location, or error out if it fails to.
|
||||
* @warning Due to the implemented algorithm, this should be called with
|
||||
* sections of decreasing size.
|
||||
* @param section The section to place
|
||||
*/
|
||||
// Places a section in a suitable location, or error out if it fails to.
|
||||
// @warning Due to the implemented algorithm, this should be called with
|
||||
// sections of decreasing size.
|
||||
// @param section The section to place
|
||||
static void placeSection(Section §ion) {
|
||||
MemoryLocation location;
|
||||
|
||||
@@ -336,11 +328,9 @@ static constexpr uint8_t ALIGN_CONSTRAINED = 1 << 0;
|
||||
// clang-format on
|
||||
static std::deque<Section *> unassignedSections[1 << 3];
|
||||
|
||||
/*
|
||||
* Categorize a section depending on how constrained it is
|
||||
* This is so the most-constrained sections are placed first
|
||||
* @param section The section to categorize
|
||||
*/
|
||||
// Categorize a section depending on how constrained it is
|
||||
// This is so the most-constrained sections are placed first
|
||||
// @param section The section to categorize
|
||||
static void categorizeSection(Section §ion) {
|
||||
uint8_t constraints = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user