diff --git a/include/asm/section.hpp b/include/asm/section.hpp index ce4b3260..fa3fdcac 100644 --- a/include/asm/section.hpp +++ b/include/asm/section.hpp @@ -3,7 +3,6 @@ #ifndef RGBDS_ASM_SECTION_HPP #define RGBDS_ASM_SECTION_HPP -#include #include #include #include @@ -39,7 +38,7 @@ struct Section { uint32_t bank; uint8_t align; // Exactly as specified in `ALIGN[]` uint16_t alignOfs; - std::deque patches; + std::vector patches; std::vector data; SectionTypeInfo const &typeInfo() const { return sectionTypeInfo[type]; } diff --git a/src/asm/section.cpp b/src/asm/section.cpp index 3ff28016..24ba30a8 100644 --- a/src/asm/section.cpp +++ b/src/asm/section.cpp @@ -646,7 +646,7 @@ uint32_t sect_GetOutputOffset() { } Patch *sect_AddOutputPatch() { - return currentSection ? ¤tSection->patches.emplace_front() : nullptr; + return currentSection ? ¤tSection->patches.emplace_back() : nullptr; } // Returns how many bytes need outputting for the specified alignment and offset to succeed diff --git a/test/asm/long-rpn-expression.link.err b/test/asm/long-rpn-expression.link.err index 7f47bed6..3d7f3ffe 100644 --- a/test/asm/long-rpn-expression.link.err +++ b/test/asm/long-rpn-expression.link.err @@ -1,5 +1,5 @@ -error: Undefined symbol `A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000` - at long-rpn-expression.asm(42) warning: Value $8953 is not 8-bit [-Wtruncation] at long-rpn-expression.asm(33) +error: Undefined symbol `A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000` + at long-rpn-expression.asm(42) Linking failed with 1 error diff --git a/test/asm/rpn-undefined.link.err b/test/asm/rpn-undefined.link.err index a710da3f..18369347 100644 --- a/test/asm/rpn-undefined.link.err +++ b/test/asm/rpn-undefined.link.err @@ -1,7 +1,7 @@ error: Undefined symbol `UNDEFINED` - at rpn-undefined.asm(4) + at rpn-undefined.asm(2) error: Requested `BANK()` of undefined section "Undefined" at rpn-undefined.asm(3) error: Undefined symbol `UNDEFINED` - at rpn-undefined.asm(2) + at rpn-undefined.asm(4) Linking failed with 3 errors diff --git a/test/link/bit-res-set-bad.out b/test/link/bit-res-set-bad.out index f5c78e1b..e9e1e8b4 100644 --- a/test/link/bit-res-set-bad.out +++ b/test/link/bit-res-set-bad.out @@ -1,7 +1,7 @@ -error: Value $ff00 is not a bit index - at bit-res-set-bad.asm(5) -error: Value $8 is not a bit index - at bit-res-set-bad.asm(4) error: Value $ffffffff is not a bit index at bit-res-set-bad.asm(3) +error: Value $8 is not a bit index + at bit-res-set-bad.asm(4) +error: Value $ff00 is not a bit index + at bit-res-set-bad.asm(5) Linking failed with 3 errors diff --git a/test/link/cascading-errors.out b/test/link/cascading-errors.out index 8ff4ab1e..00f848ee 100644 --- a/test/link/cascading-errors.out +++ b/test/link/cascading-errors.out @@ -2,20 +2,20 @@ error: Undefined symbol `Foo` at cascading-errors.asm(18) error: Undefined symbol `Bar` at cascading-errors.asm(19) -error: Undefined symbol `hNonExist` - at cascading-errors.asm(16) -error: Undefined symbol `NonExist` - at cascading-errors.asm(14) +error: Undefined symbol `Bar` + at cascading-errors.asm(8) error: Undefined symbol `Foo` - at cascading-errors.asm(12) + at cascading-errors.asm(9) +error: Undefined symbol `Bar` + at cascading-errors.asm(9) error: Undefined symbol `Foo` at cascading-errors.asm(10) error: Division by 0 at cascading-errors.asm(10) error: Undefined symbol `Foo` - at cascading-errors.asm(9) -error: Undefined symbol `Bar` - at cascading-errors.asm(9) -error: Undefined symbol `Bar` - at cascading-errors.asm(8) + at cascading-errors.asm(12) +error: Undefined symbol `NonExist` + at cascading-errors.asm(14) +error: Undefined symbol `hNonExist` + at cascading-errors.asm(16) Linking failed with 10 errors diff --git a/test/link/invalid-patches.out b/test/link/invalid-patches.out index 2738610e..b24325e8 100644 --- a/test/link/invalid-patches.out +++ b/test/link/invalid-patches.out @@ -1,17 +1,17 @@ -error: `JR` target must be between -128 and 127 bytes away, not 190; use `JP` instead - at invalid-patches.asm(10) -error: Address $0 for `LDH` is not in HRAM range; use `LD` instead - at invalid-patches.asm(9) -error: Requested `SIZEOF()` of undefined section "NonexistentSection" - at invalid-patches.asm(8) -error: Requested `STARTOF()` of undefined section "NonexistentSection" - at invalid-patches.asm(7) -error: Requested `BANK()` of undefined section "NonexistentSection" - at invalid-patches.asm(6) -error: Requested `BANK()` of undefined symbol `NonexistentSymbol` - at invalid-patches.asm(5) -error: Exponent by negative value -1 - at invalid-patches.asm(4) error: Modulo by 0 at invalid-patches.asm(3) +error: Exponent by negative value -1 + at invalid-patches.asm(4) +error: Requested `BANK()` of undefined symbol `NonexistentSymbol` + at invalid-patches.asm(5) +error: Requested `BANK()` of undefined section "NonexistentSection" + at invalid-patches.asm(6) +error: Requested `STARTOF()` of undefined section "NonexistentSection" + at invalid-patches.asm(7) +error: Requested `SIZEOF()` of undefined section "NonexistentSection" + at invalid-patches.asm(8) +error: Address $0 for `LDH` is not in HRAM range; use `LD` instead + at invalid-patches.asm(9) +error: `JR` target must be between -128 and 127 bytes away, not 190; use `JP` instead + at invalid-patches.asm(10) Linking failed with 8 errors diff --git a/test/link/patch-diagnostics.out b/test/link/patch-diagnostics.out index f0fc714a..86716f3d 100644 --- a/test/link/patch-diagnostics.out +++ b/test/link/patch-diagnostics.out @@ -1,22 +1,22 @@ -warning: Shifting right by large amount 32 [-Wshift-amount] - at patch-diagnostics.asm(12) -warning: Shifting right by negative amount -1 [-Wshift-amount] - at patch-diagnostics.asm(11) -warning: Shifting right by large amount 32 [-Wshift-amount] - at patch-diagnostics.asm(10) -warning: Shifting right by negative amount -1 [-Wshift-amount] - at patch-diagnostics.asm(9) -warning: Shifting right negative value -1 [-Wshift] - at patch-diagnostics.asm(8) -warning: Shifting left by large amount 32 [-Wshift-amount] - at patch-diagnostics.asm(7) -warning: Shifting left by negative amount -1 [-Wshift-amount] - at patch-diagnostics.asm(6) -warning: Modulo of -2147483648 by -1 yields 0 [-Wdiv] - at patch-diagnostics.asm(5) -warning: Value $40000000 is not 8-bit [-Wtruncation] - at patch-diagnostics.asm(4) warning: Division of -2147483648 by -1 yields -2147483648 [-Wdiv] at patch-diagnostics.asm(3) warning: Value $80000000 (may be negative?) is not 8-bit [-Wtruncation] at patch-diagnostics.asm(3) +warning: Value $40000000 is not 8-bit [-Wtruncation] + at patch-diagnostics.asm(4) +warning: Modulo of -2147483648 by -1 yields 0 [-Wdiv] + at patch-diagnostics.asm(5) +warning: Shifting left by negative amount -1 [-Wshift-amount] + at patch-diagnostics.asm(6) +warning: Shifting left by large amount 32 [-Wshift-amount] + at patch-diagnostics.asm(7) +warning: Shifting right negative value -1 [-Wshift] + at patch-diagnostics.asm(8) +warning: Shifting right by negative amount -1 [-Wshift-amount] + at patch-diagnostics.asm(9) +warning: Shifting right by large amount 32 [-Wshift-amount] + at patch-diagnostics.asm(10) +warning: Shifting right by negative amount -1 [-Wshift-amount] + at patch-diagnostics.asm(11) +warning: Shifting right by large amount 32 [-Wshift-amount] + at patch-diagnostics.asm(12) diff --git a/test/link/patch-overflow.out b/test/link/patch-overflow.out index d1b9ab96..7e0a8a7e 100644 --- a/test/link/patch-overflow.out +++ b/test/link/patch-overflow.out @@ -1,4 +1,4 @@ -warning: Value $14000 is not 16-bit [-Wtruncation] - at patch-overflow.asm(3) warning: Value $4000 is not 8-bit [-Wtruncation] at patch-overflow.asm(2) +warning: Value $14000 is not 16-bit [-Wtruncation] + at patch-overflow.asm(3) diff --git a/test/link/rpn-bad-sym-id.out b/test/link/rpn-bad-sym-id.out index c12836f6..4f04d9c0 100644 --- a/test/link/rpn-bad-sym-id.out +++ b/test/link/rpn-bad-sym-id.out @@ -1,5 +1,5 @@ -error: Undefined symbol `BAR` - at rpn-bad-sym-id.asm(3) error: Undefined symbol `FOO` at rpn-bad-sym-id.asm(2) +error: Undefined symbol `BAR` + at rpn-bad-sym-id.asm(3) Linking failed with 2 errors diff --git a/test/link/sym-noexist.out b/test/link/sym-noexist.out index ab813e4e..4264f1ef 100644 --- a/test/link/sym-noexist.out +++ b/test/link/sym-noexist.out @@ -1,5 +1,5 @@ -error: Undefined symbol `nothing` - at sym-noexist.asm(3) error: Undefined symbol `where` at sym-noexist.asm(2) +error: Undefined symbol `nothing` + at sym-noexist.asm(3) Linking failed with 2 errors diff --git a/test/link/truncation2.out b/test/link/truncation2.out index 8dc06552..d279dd03 100644 --- a/test/link/truncation2.out +++ b/test/link/truncation2.out @@ -1,4 +1,4 @@ -warning: Value $fffe8000 (may be negative?) is not 16-bit [-Wtruncation] - at truncation2.asm(3) warning: Value $ffff4000 (may be negative?) is not 16-bit [-Wtruncation] at truncation2.asm(2) +warning: Value $fffe8000 (may be negative?) is not 16-bit [-Wtruncation] + at truncation2.asm(3)