Compare commits

..

3 Commits

Author SHA1 Message Date
c06d3c6131 [jasper/project] Add new type descriptors
All checks were successful
Build / build (push) Successful in 1m29s
2025-05-23 03:24:23 -05:00
2d9f39000f Merge commit 'e90dd887477452922f783535edb3d4c55e9a0d2c' 2025-05-23 03:23:17 -05:00
e90dd88747 Squashed 'deps/nostalgia/' changes from cb304ecf..312097a7
312097a7 [ox/std] Fix implementation of std cmp functions
a40198ab [nostalgia] Update release-d2025.05.2 release notes
52d8c0bd [nostalgia/gfx] Replace static_cast compare with std::cmp_equal
c19d7f4e [nostalgia] Add .vs and cmake-build-* to .gitignore
159b7e7e [buildcore] Make pybb cmake_build specify --config debug/release
c93eec4f [teagba] Make cstart.cpp only compile if GCC
e7e7a223 [nostalgia/sample_project] Make sample_project exempt from autocrlf
26d5048e [ox/fs] Fix new build error in MSVC (VS 17.14)
3b8f97cc [nostalgia/gfx] Cleanup
f1e68e0a [nostalgia/gfx/studio/tilesheet] Fix overrun errors when switching subsheets, clear selection on switch
d6e4ab7a [keel] Cleanup

git-subtree-dir: deps/nostalgia
git-subtree-split: 312097a7991194ce36e7c2e357e7e3a51d916767
2025-05-23 03:23:17 -05:00

View File

@@ -43,7 +43,7 @@ constexpr bool cmp_less(T const t, U const u) noexcept {
if constexpr(ox::is_signed_v<T> == ox::is_signed_v<U>) {
return t < u;
} else if constexpr(ox::is_signed_v<T>) {
return t >= 0 && static_cast<ox::Unsigned<T>>(t) < u;
return t < 0 || static_cast<ox::Unsigned<T>>(t) < u;
} else {
return u >= 0 && t < static_cast<ox::Unsigned<U>>(u);
}
@@ -69,6 +69,13 @@ constexpr bool cmp_greater_equal(T const t, U const u) noexcept {
return !std::cmp_less(t, u);
}
static_assert(cmp_less(-1, 5u));
static_assert(!cmp_less(5u, -1));
static_assert(cmp_equal(5u, 5));
static_assert(cmp_equal(5, 5u));
static_assert(!cmp_equal(-5, 5u));
static_assert(!cmp_equal(4u, 5u));
}
#endif