Commit Graph
3550 Commits
Author SHA1 Message Date
Rangi 7b39bcd412 Refactor expression for clarity
`tileData[realY + 1 % options.bitDepth]` relied on order of
operations and the fact that `1 % 1 == 0` but `1 % 2 == 1` for
correct indexing. However, it was not obvious at first glance,
and confusable with the more common `(base + offset) % size`
pattern. (And would need changing anyway if we ever support 4bpp.)
2026-07-10 14:30:25 -04:00
Rangi 255cd7f7f6 Fix a typo in a comment 2026-07-10 14:29:32 -04:00
Rangi b8011947a8 Correct assumption to avoid UB with 1 << 31 2026-07-09 21:36:34 -04:00
Rangi 39e7e064c9 Print correct color set limit value in error message 2026-07-09 21:29:02 -04:00
Rangi 7b97d7ce15 Fix RGBGFX crash on deduplicating transparent tiles 2026-07-09 21:24:59 -04:00
Rangi c667bac93a Use trailing return type for begin()/end() 2026-07-08 16:57:52 -04:00
Rangi db96144d49 Use [[nodiscard]] instead of [[gnu::warn_unused_result]] 2026-07-08 16:44:15 -04:00
Rangi 276a1a7952 Use const_cast more precisely to remove const without changing type 2026-07-08 16:42:53 -04:00
Rangi b219e03b38 Use more structured bindings 2026-07-08 16:38:32 -04:00
Rangi 824ebd80f9 Use [[fallthrough]]; attribute instead of // fallthrough comment 2026-07-08 16:30:52 -04:00
Rangi 5aedf31b46 Prevent 32-bit multiplication overflow
Basically impossible to achieve, but just in case
2026-07-07 17:02:46 -04:00
Rangi d94d0bcc2f Make explicit the assumption that targetFileName is checked before ever calling printDep 2026-07-07 17:02:46 -04:00
Rangi ed8e3e4d02 Reset errno = 0 before parseWholeNumber calls and errno == ERANGE checks 2026-07-07 17:02:46 -04:00
Rangi 30fd4514dc Add fail-safe for invalid RPN commands in bad object files 2026-07-07 17:02:46 -04:00
Rangi 08e83601f5 Fix CRLF check in parsing SDAS objects 2026-07-07 17:02:46 -04:00
Rangi e606f4e997 Fix condition for invalid bank range check (#2016) 2026-07-07 17:02:35 -04:00
Rangi 9008d8391c Consistently use sudo apt install -Uyq in workflows (two other cases) 2026-07-07 02:57:48 -04:00
Rangi 21682e8814 Consistently handle negative shifted macro args (#2014)
Negative macro arguments count from the end, i.e. `\<-1>`
is equivalent to `\<_NARG>`, even after `shift`ing them.

Negative arguments cannot be used to access shifted values.
2026-07-07 02:19:37 -04:00
Rangi f82b0838a1 Disallow minus sign before symbol name in bracketed macro arguments (#2015)
This was being silently allowed but without actually negating the symbol's value
2026-07-07 00:42:09 -04:00
Rangi dabd0a08d2 Remove impossible condition (uint64_t > UINT64_MAX) 2026-07-06 23:08:05 -04:00
Rangi c3e10dbb03 Safeguard against localtime or gmtime failure 2026-07-06 23:05:19 -04:00
Rangi 3883c2a2b8 Reuse scrambleLimit instead of its equivalent expression 2026-07-06 22:50:31 -04:00
Rangi cd0caaaceb Clarify comment about -Wno-* behavior with parametric warnings 2026-07-06 22:44:39 -04:00
Rangi 1e4a060d9e Guard against undefined behavior in double2fix
I haven't found input which triggers any, but this is more
technically correct just in case.
2026-07-06 22:38:06 -04:00
Rangi fe3b238dea Do not allow defining labels outside sections (#2013)
Creating a `Symbol` with `type = SYM_LABEL` but `section = nullptr`
is inconsistent and dangerous. I was not able to cause any buggy
behavior so far, but it's safer and reasonable to not create such
a symbol in the first place.

The main consequence is that `DEF(LabelOutsideSection)` will now
evaluate as 0.
2026-07-06 16:18:42 -04:00
Rangi 46a6966b70 Fix $8000_0000 % -1 to warn with -Wdiv like $8000_0000 / -1 does (#2012) 2026-07-06 15:08:44 -04:00
Rangi be3fc61859 Fix included linker scripts with no newline at EOF (#2011) 2026-07-06 14:01:40 -04:00
Rangi 0adbb92e50 Same-line shellcheck comment explanations
These are obvious even with `git grep shellcheck`.
2026-07-06 04:43:08 +02:00
Rangi 09da4e001a Use Bash arrays instead of POSIX splitting when possible 2026-07-06 04:43:08 +02:00
ISSOtm 3eb8c7e8f2 Let tests know they are being run under Cygwin 2026-07-05 20:58:50 -04:00
Rangi 189c679e13 Parallelize build jobs according to CPU count 2026-07-05 20:58:50 -04:00
Rangi 5d5000011a Remove CMAKE_INSTALL_PARALLEL_LEVEL
This value "has no impact unless `INSTALL_PARALLEL` is enabled",
and since our install procedure is so simple, I don't think we need
to add that. (The `make install` commands don't use `-j` either.)
2026-07-05 20:58:50 -04:00
Rangi f81f5fe63c Use git clean -fdx instead of make clean in external projects 2026-07-05 20:58:50 -04:00
Rangi 6e643406a2 Refactor warning diagnostic code to reduce repeated output logic 2026-07-04 23:02:16 -04:00
Rangi de36a11be7 Prevent rgblink -Wno-* disabled warnings from printing a location trace anyway
Fixes #2005
2026-07-04 23:02:16 -04:00
Rangi 799c55b4dd Add [[gnu::format(printf, 1, 2)]] attribute to variadic function sectError 2026-07-04 23:02:16 -04:00
Rangi ddd8f37508 Remove unnecessary default constructor for Token 2026-07-04 18:48:03 -04:00
Rangi c55dec254d Remove unnecessary const_casting methods 2026-07-04 18:45:41 -04:00
Rangi 0996a2f5ed Encapuslate UTF-8 decoder state in a struct 2026-07-03 19:35:23 -04:00
Rangi e3c594c250 Explain why we do not use file(GLOB ext_projects CONFIGURE_DEPENDS "external/*.cfg") 2026-07-03 18:38:07 -04:00
Rangi daba94b495 Remove pointless std::move from non-move constructor 2026-07-03 13:12:29 -04:00
Rangi 2f604bfa9a Fix error message when an rgbgfx output file cannot be created 2026-07-03 13:08:28 -04:00
Rangi 9bbb2247a7 Fix rgbasm -Werror=... not adding to the final error count 2026-07-03 13:05:33 -04:00
Rangi 9b4df11473 Describe how to patch external projects 2026-07-02 12:37:26 -04:00
ISSOtm 4a77c42ed7 Remove redundant labels from tests
It's possible to filter tests by name (`-R`)
2026-07-02 10:39:59 -04:00
ISSOtm b12eac356e Try to automatically determine the test OS name 2026-07-02 10:39:59 -04:00
ISSOtm 82702d8149 Point out an ordering dep isn't a success one 2026-07-02 10:39:59 -04:00
ISSOtm 1f9cc9651a Avoid fetching some repos twice
Also enables a nice bit of logic cleanup
2026-07-02 10:39:59 -04:00
ISSOtm 04b9c7fa3d Move external tests files to tests/external/ 2026-07-02 10:39:59 -04:00
ISSOtm 5e8a6cde20 Remove the need to explicitly list external tests
I like having a single source of truth!
2026-07-02 10:39:59 -04:00