Commit Graph

622 Commits

Author SHA1 Message Date
Rangi42 e14ba664ea Remove redundant (void) parameter declarations 2024-03-01 10:41:47 -05:00
Sylvie 043db49676 Replace NULL with nullptr (#1321) 2024-02-29 15:06:33 -05:00
Sylvie eff8c324c8 Remove now-unnecessary struct keyword (#1320)
C++ acts like structs are `typedef`ed by default

We do have to keep `struct stat`, since there's ambiguity
with the function also called `stat`.
2024-02-29 14:41:58 -05:00
Rangi42 cf08fed067 Use std::vector for SDCC object section data 2024-02-29 13:44:08 -05:00
Rangi42 c44b336e1b Use std::vector for SDCC object line buffer 2024-02-29 13:44:08 -05:00
Rangi42 e90084ad06 Rename isWRA0Mode to isWRAM0Mode 2024-02-29 13:44:08 -05:00
Rangi42 2ff723f943 Use vec.data() instead of &vec[0]
In general `vec.data()` is always safe, whereas `&vec[0]`
may fail when `vec` is empty.
2024-02-29 13:44:08 -05:00
Rangi42 17df94c75b Remove now-unnecessary cleanup functions 2024-02-29 13:44:08 -05:00
Rangi42 96f354026a Use automatic allocation for section data 2024-02-29 13:44:08 -05:00
Rangi42 8fe6be19f1 Use automatic allocation for tryReadstring 2024-02-29 13:44:08 -05:00
Rangi42 002eed405b Use automatic allocation for assertion error messages 2024-02-29 13:44:08 -05:00
Rangi42 ef1c1440a0 Use automatic allocation for symbol names 2024-02-29 13:44:08 -05:00
Rangi42 826512730c Use automatic allocation for section symbols 2024-02-29 13:44:08 -05:00
Rangi42 5a26a48d11 Use automatic allocation for section names 2024-02-29 13:44:08 -05:00
Rangi42 3c0af94c5c Use automatic allocation for patches 2024-02-29 13:44:08 -05:00
Rangi42 0cc49782ab Use std::variant and automatic allocation for file stack node data 2024-02-29 13:44:08 -05:00
Rangi42 e1ac51d7da Use std::vector's .size() for SDCC sections and symbols 2024-02-29 13:44:08 -05:00
Rangi42 48b2e94aa3 Use std::string for symbol/section/node names and assertion messages 2024-02-29 13:44:08 -05:00
Rangi42 52ac98c294 Use std::vector for section data 2024-02-29 13:44:08 -05:00
Rangi42 4cd88ade54 Use automatic allocation for object file symbols 2024-02-29 13:44:08 -05:00
Rangi42 dead69eb2c Use std::vector for section symbols 2024-02-29 13:44:08 -05:00
Rangi42 f47ce337bf Use std::vector for reading object file symbols 2024-02-29 13:44:08 -05:00
Rangi42 9a51fbafb3 Use std::vector for file stack nodes 2024-02-29 13:44:08 -05:00
Rangi42 3d23f5bbb3 Use std::vector for reading object file sections 2024-02-29 13:44:08 -05:00
Rangi42 5075ac8887 Use std::vector for RPN expressions 2024-02-29 13:44:08 -05:00
Rangi42 d792ee4b61 Use std::vector for section patches 2024-02-29 13:44:08 -05:00
Rangi42 b207bff157 Use std::vector for fstack REPT nodes 2024-02-29 13:44:08 -05:00
Rangi42 b8e267e387 Use std::vector for SDAS file sections 2024-02-29 13:44:08 -05:00
Rangi42 a5ea25cde5 Use automatic allocation for RPN stack 2024-02-29 13:44:08 -05:00
Rangi42 003977a9fb Use std::deque for unassigned sections 2024-02-29 13:44:08 -05:00
Rangi42 26a93a530b Use std::deque for assertions
Also fix a memory leak
2024-02-29 13:44:08 -05:00
Rangi42 2df4fff6c9 Use std::vector for sorted symbols 2024-02-29 13:44:08 -05:00
Rangi42 b74b40abd2 Use std::deque for sorted sections 2024-02-29 13:44:08 -05:00
Rangi42 f44701c02d Use std::map for rgblink symbols and sections 2024-02-29 13:44:08 -05:00
Rangi42 d5de3fa111 Use std::deque for symbol lists
Also fix a memory leak that this reveals
2024-02-29 13:44:08 -05:00
Rangi42 d87b1ed22a Refactor some redundant error/warning-printing code 2024-02-24 19:05:29 -05:00
Sylvie 595c066c2a Remove #include <stdbool.h> (#1317) 2024-02-24 10:51:46 -05:00
Sylvie 54d6a22d19 Build with pedantically standard C++ (#1309)
* Remove array designators (not standard C++)

* Build with pedantically standard C++
2024-02-23 16:46:53 -05:00
Sylvie c0d534f5ad No more flexible array members (not standard C++) (#1307)
* Replace FAMs with `std::vector`s (or one `std::string`) in four `struct`s

* Anonymous types declared in an anonymous union are also non-standard
  Only Clang complains about this (-Wnested-anon-types)
2024-02-22 16:22:37 -05:00
Rangi42 c70cecc24a Add missing license header 2024-02-21 19:20:10 -05:00
Rangi42 c0da9fa2bb Remove obsolete #undef fail 2024-02-20 20:15:34 -05:00
Rangi42 ee59f17ea1 Free all the charmaps after parsing 2024-02-19 09:00:15 -05:00
Sylvie 9cdd0b8a02 No more anonymous structs (not standard C++) (#1305)
This is one step to restoring `-pedantic` builds
2024-02-19 08:12:20 +01:00
Rangi42 cd297e1f90 Remove unused rgblink function sym_ForEach 2024-02-18 18:46:07 -05:00
ISSOtm 18e83c17b4 Add a few more linker script tests 2024-02-19 00:23:08 +01:00
Sylvie 8a49a0b714 Report "<stdin>" or "<stdout>" when using "-" as a filename placeholder (#1297)
Also fix a memory leak with `targetFileNames`
2024-02-18 17:07:25 +01:00
Sylvie d71a161bc9 Phrase error messages as "Failed to", not "Could not" or "Couldn't" (#1298) 2024-02-18 14:52:31 +01:00
Marcus Huderle a37285eae9 Fix two instances of possible infinite loops in the linker (#1292) 2024-02-08 11:46:04 +01:00
Sylvie 66fd5a7062 Fix some usually disabled compiler warnings (#1286)
* Fixes from temporarily re-enabling more compiler warnings

* More edits suggested by cppcheck

* Fix hanging on append_yylval_string

* Fix FOR loop increment
2024-01-18 20:47:20 +01:00
Eldred Habert ccf9dcb851 Improve linker scripts a little (#1275)
* Allow for optional sections in linker scripts
  These are more useful for frameworks/toolchains.

* Check for an active mem region everywhere
  Do you like segfaults? Too bad!

* Allow the address to be floating in linker scripts
  Try and make the life of SDCC interop easier.

* Also validate alignment when floating

* Overhaul the linker script manual page
  Documenting the new features, but also restructuring the
  existing documentation to make the manual page (hopefully)
  easier to understand.
2023-12-24 23:29:11 -05:00