mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Some refactoring and cleanup (#1806)
* Use clang-tidy `misc-include-cleaner` for IWYU `#include` cleanup * Use `std::optional<size_t>` instead of `ssize_t` * Rename some functions in linkdefs.hpp * Fix header order
This commit is contained in:
@@ -11,18 +11,18 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "diagnostics.hpp"
|
||||
#include "helpers.hpp"
|
||||
#include "linkdefs.hpp"
|
||||
#include "platform.hpp"
|
||||
#include "verbosity.hpp"
|
||||
#include "version.hpp"
|
||||
|
||||
#include "link/assign.hpp"
|
||||
#include "link/fstack.hpp"
|
||||
#include "link/main.hpp"
|
||||
#include "link/patch.hpp"
|
||||
#include "link/sdas_obj.hpp"
|
||||
#include "link/section.hpp"
|
||||
@@ -360,7 +360,7 @@ static void readSection(
|
||||
}
|
||||
section.alignOfs = tmp;
|
||||
|
||||
if (sect_HasData(section.type)) {
|
||||
if (sectTypeHasData(section.type)) {
|
||||
if (section.size) {
|
||||
section.data.resize(section.size);
|
||||
if (fread(section.data.data(), 1, section.size, file) != section.size) {
|
||||
@@ -549,7 +549,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) {
|
||||
|
||||
// Give patches' PC section pointers to their sections
|
||||
for (uint32_t i = 0; i < nbSections; ++i) {
|
||||
if (sect_HasData(fileSections[i]->type)) {
|
||||
if (sectTypeHasData(fileSections[i]->type)) {
|
||||
for (Patch &patch : fileSections[i]->patches) {
|
||||
linkPatchToPCSect(patch, fileSections);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user