[ox] Update formatting in recently edited files
All checks were successful
Build / build (push) Successful in 1m11s

This commit is contained in:
2026-01-25 21:26:44 -06:00
parent bfdfc10425
commit 4aa8255c55
7 changed files with 43 additions and 43 deletions

View File

@@ -187,7 +187,7 @@ class ModelValue {
constexpr Type type() const noexcept; constexpr Type type() const noexcept;
constexpr Error setType( constexpr Error setType(
DescriptorType const*type, DescriptorType const *type,
SubscriptStack const& = {}, SubscriptStack const& = {},
int subscriptLevels = 0) noexcept; int subscriptLevels = 0) noexcept;
@@ -275,7 +275,7 @@ class ModelValueArray {
} }
constexpr Error setType( constexpr Error setType(
DescriptorType const*type, DescriptorType const *type,
SubscriptStack subscriptStack, SubscriptStack subscriptStack,
int subscriptLevels) noexcept { int subscriptLevels) noexcept {
oxAssert(subscriptLevels <= static_cast<int>(subscriptStack.size()), "subscript level mismatch"); oxAssert(subscriptLevels <= static_cast<int>(subscriptStack.size()), "subscript level mismatch");
@@ -418,7 +418,7 @@ class ModelValueVector {
} }
constexpr Error setType( constexpr Error setType(
DescriptorType const*type, DescriptorType const *type,
SubscriptStack subscriptStack, SubscriptStack subscriptStack,
int subscriptLevels) noexcept { int subscriptLevels) noexcept {
oxAssert(subscriptLevels <= static_cast<int>(subscriptStack.size()), "subscript level mismatch"); oxAssert(subscriptLevels <= static_cast<int>(subscriptStack.size()), "subscript level mismatch");
@@ -821,7 +821,7 @@ class ModelUnion {
template<typename PlatSpec> template<typename PlatSpec>
[[nodiscard]] [[nodiscard]]
constexpr std::size_t sizeOf(ModelValueArray const*v) noexcept { constexpr std::size_t sizeOf(ModelValueArray const *v) noexcept {
return sizeOf<PlatSpec>(&(*v)[0]) * v->size(); return sizeOf<PlatSpec>(&(*v)[0]) * v->size();
} }

View File

@@ -15,7 +15,7 @@
namespace ox { namespace ox {
void panic(Error const&err, StringViewCR panicMsg, std::source_location const &src) noexcept { void panic(Error const &err, StringViewCR panicMsg, std::source_location const &src) noexcept {
oxErrf("\033[31;1;1mPANIC:\033[0m [{}:{}]: {}\n", src.file_name(), src.line(), panicMsg); oxErrf("\033[31;1;1mPANIC:\033[0m [{}:{}]: {}\n", src.file_name(), src.line(), panicMsg);
if (err.msg) { if (err.msg) {
oxErrf("\tError Message:\t{}\n", err.msg); oxErrf("\tError Message:\t{}\n", err.msg);
@@ -36,7 +36,7 @@ void panic(Error const&err, StringViewCR panicMsg, std::source_location const &s
#if __GNUC__ && !_WIN32 #if __GNUC__ && !_WIN32
__attribute__((weak)) __attribute__((weak))
#endif #endif
void panic(Error const&err, char const*panicMsg, std::source_location const &src) noexcept { void panic(Error const &err, char const*panicMsg, std::source_location const &src) noexcept {
panic(err, StringView{panicMsg}, src); panic(err, StringView{panicMsg}, src);
} }

View File

@@ -31,7 +31,7 @@ void panic(
[[noreturn]] [[noreturn]]
constexpr void constexprPanic( constexpr void constexprPanic(
StringViewCR panicMsg, StringViewCR panicMsg,
Error const&err = {}, Error const &err = {},
std::source_location const &src = std::source_location::current()) noexcept { std::source_location const &src = std::source_location::current()) noexcept {
if (!std::is_constant_evaluated()) { if (!std::is_constant_evaluated()) {
panic(err, panicMsg, src); panic(err, panicMsg, src);
@@ -66,7 +66,7 @@ constexpr void assertFunc(
} }
constexpr void assertFunc( constexpr void assertFunc(
Error const&err, Error const &err,
StringViewCR, StringViewCR,
StringViewCR assertMsg, StringViewCR assertMsg,
std::source_location const &src = std::source_location::current()) noexcept { std::source_location const &src = std::source_location::current()) noexcept {

View File

@@ -17,7 +17,7 @@ class exception {
virtual ~exception() = default; virtual ~exception() = default;
[[nodiscard]] [[nodiscard]]
virtual char const*what() const noexcept { virtual char const *what() const noexcept {
return ""; return "";
} }
}; };
@@ -44,7 +44,7 @@ struct [[nodiscard]] Error {
explicit constexpr Error( explicit constexpr Error(
ErrorCode const errCode, ErrorCode const errCode,
std::source_location const&src = std::source_location::current()) noexcept: std::source_location const &src = std::source_location::current()) noexcept:
src{src}, src{src},
errCode{errCode} errCode{errCode}
{} {}
@@ -52,7 +52,7 @@ struct [[nodiscard]] Error {
explicit constexpr Error( explicit constexpr Error(
ErrorCode const errCode, ErrorCode const errCode,
ox::CString msg, ox::CString msg,
std::source_location const&src = std::source_location::current()) noexcept: std::source_location const &src = std::source_location::current()) noexcept:
src{src}, src{src},
msg{msg}, msg{msg},
errCode{errCode} errCode{errCode}
@@ -65,13 +65,13 @@ struct [[nodiscard]] Error {
}; };
[[nodiscard]] [[nodiscard]]
constexpr auto errCode(Error const&err) noexcept { constexpr auto errCode(Error const &err) noexcept {
return err.errCode; return err.errCode;
} }
template<typename T = char const*> template<typename T = char const*>
[[nodiscard]] [[nodiscard]]
constexpr auto toStr(Error const&err) noexcept { constexpr auto toStr(Error const &err) noexcept {
return err.msg ? T{err.msg} : ""; return err.msg ? T{err.msg} : "";
} }
@@ -82,19 +82,19 @@ struct Exception: public std::exception {
explicit Exception( explicit Exception(
ErrorCode const errCode, ErrorCode const errCode,
std::source_location const&src = std::source_location::current()) noexcept: std::source_location const &src = std::source_location::current()) noexcept:
src{src}, src{src},
errCode{errCode} {} errCode{errCode} {}
explicit Exception( explicit Exception(
ErrorCode const errCode, ErrorCode const errCode,
ox::CString msg, ox::CString msg,
std::source_location const&src = std::source_location::current()) noexcept: std::source_location const &src = std::source_location::current()) noexcept:
src{src}, src{src},
msg{msg}, msg{msg},
errCode{errCode} {} errCode{errCode} {}
explicit Exception(Error const&err) noexcept: explicit Exception(Error const &err) noexcept:
src{err.src}, src{err.src},
msg{err.msg ? err.msg : ""}, msg{err.msg ? err.msg : ""},
errCode{err.errCode} {} errCode{err.errCode} {}
@@ -104,16 +104,16 @@ struct Exception: public std::exception {
} }
[[nodiscard]] [[nodiscard]]
char const*what() const noexcept override { char const *what() const noexcept override {
return msg; return msg;
} }
}; };
[[noreturn]] [[noreturn]]
void panic( void panic(
Error const&err, Error const &err,
char const*panicMsg, char const *panicMsg,
std::source_location const&src = std::source_location::current()) noexcept; std::source_location const &src = std::source_location::current()) noexcept;
template<typename T> template<typename T>
struct [[nodiscard]] Result { struct [[nodiscard]] Result {
@@ -127,25 +127,25 @@ struct [[nodiscard]] Result {
} }
template<typename U> template<typename U>
constexpr Result(Result<U> const&other) noexcept: value(other.value), error(other.error) { constexpr Result(Result<U> const &other) noexcept: value(other.value), error(other.error) {
} }
template<typename U> template<typename U>
constexpr Result(Result<U> &&other) noexcept: value(std::move(other.value)), error(std::move(other.error)) { constexpr Result(Result<U> &&other) noexcept: value(std::move(other.value)), error(std::move(other.error)) {
} }
constexpr Result(Error const&error) noexcept: value(), error(error) { constexpr Result(Error const &error) noexcept: value(), error(error) {
} }
constexpr Result(type const&value, Error const&error = {}) noexcept: value(value), error(error) { constexpr Result(type const &value, Error const &error = {}) noexcept: value(value), error(error) {
} }
constexpr Result(type &&value, Error const&error = {}) noexcept: value(std::move(value)), error(error) { constexpr Result(type &&value, Error const &error = {}) noexcept: value(std::move(value)), error(error) {
} }
constexpr ~Result() noexcept = default; constexpr ~Result() noexcept = default;
explicit constexpr operator type const&() const noexcept { explicit constexpr operator type const &() const noexcept {
return value; return value;
} }
@@ -159,7 +159,7 @@ struct [[nodiscard]] Result {
} }
template<typename U> template<typename U>
constexpr Error copyTo(U &val) const& noexcept { constexpr Error copyTo(U &val) const & noexcept {
if (!error) [[likely]] { if (!error) [[likely]] {
val = value; val = value;
} }
@@ -199,7 +199,7 @@ struct [[nodiscard]] Result {
} }
[[nodiscard]] [[nodiscard]]
constexpr T const&unwrap() const & noexcept { constexpr T const &unwrap() const & noexcept {
if (error) [[unlikely]] { if (error) [[unlikely]] {
ox::panic(error, "Failed unwrap"); ox::panic(error, "Failed unwrap");
} }
@@ -223,7 +223,7 @@ struct [[nodiscard]] Result {
} }
[[nodiscard]] [[nodiscard]]
constexpr T const&unwrapThrow() const & { constexpr T const &unwrapThrow() const & {
if (error) { if (error) {
throw ox::Exception(error); throw ox::Exception(error);
} }
@@ -247,7 +247,7 @@ struct [[nodiscard]] Result {
} }
template<typename U = T> template<typename U = T>
constexpr ox::Result<U> to(auto const&f) & noexcept { constexpr ox::Result<U> to(auto const &f) & noexcept {
if (error) [[unlikely]] { if (error) [[unlikely]] {
return error; return error;
} }
@@ -255,7 +255,7 @@ struct [[nodiscard]] Result {
} }
template<typename U = T> template<typename U = T>
constexpr ox::Result<U> to(auto const&f) && noexcept { constexpr ox::Result<U> to(auto const &f) && noexcept {
if (error) [[unlikely]] { if (error) [[unlikely]] {
return error; return error;
} }
@@ -267,7 +267,7 @@ struct [[nodiscard]] Result {
* @param alt * @param alt
* @return value of Result or alt * @return value of Result or alt
*/ */
constexpr T or_value(T &&alt) const& noexcept { constexpr T or_value(T &&alt) const & noexcept {
if (error) { if (error) {
return std::move(alt); return std::move(alt);
} }
@@ -291,7 +291,7 @@ struct [[nodiscard]] Result {
* @param alt * @param alt
* @return value of Result or alt * @return value of Result or alt
*/ */
constexpr T or_value(T const&alt) const& noexcept { constexpr T or_value(T const &alt) const & noexcept {
if (error) { if (error) {
return alt; return alt;
} }
@@ -303,7 +303,7 @@ struct [[nodiscard]] Result {
* @param alt * @param alt
* @return value of Result or alt * @return value of Result or alt
*/ */
constexpr T or_value(T const&alt) && noexcept { constexpr T or_value(T const &alt) && noexcept {
if (error) { if (error) {
return alt; return alt;
} }
@@ -321,12 +321,12 @@ struct [[nodiscard]] Result {
namespace detail { namespace detail {
constexpr Error toError(Error const&e) noexcept { constexpr Error toError(Error const &e) noexcept {
return e; return e;
} }
template<typename T> template<typename T>
constexpr Error toError(Result<T> const&r) noexcept { constexpr Error toError(Result<T> const &r) noexcept {
return r.error; return r.error;
} }
@@ -346,7 +346,7 @@ constexpr void primitiveAssert(
constexpr void boundsCheck( constexpr void boundsCheck(
size_t const i, size_t const i,
size_t const sz, size_t const sz,
char const*msg, char const *msg,
std::source_location const &src = std::source_location::current()) noexcept { std::source_location const &src = std::source_location::current()) noexcept {
if constexpr(defines::CheckBounds) { if constexpr(defines::CheckBounds) {
if (i >= sz) [[unlikely]] { if (i >= sz) [[unlikely]] {

View File

@@ -79,7 +79,7 @@ constexpr U *make(Args &&...args) noexcept {
#ifdef __cpp_exceptions #ifdef __cpp_exceptions
try { try {
return new T(ox::forward<Args>(args)...); return new T(ox::forward<Args>(args)...);
} catch (std::exception const&ex) { } catch (std::exception const &ex) {
ox::panic(ox::Error(1, ex.what()), ex.what()); ox::panic(ox::Error(1, ex.what()), ex.what());
return nullptr; return nullptr;
} catch (...) { } catch (...) {

View File

@@ -47,7 +47,7 @@ class Span {
} }
template<std::size_t sz> template<std::size_t sz>
constexpr Span(std::array<ox::remove_const_t<T>, sz> const&a) noexcept: constexpr Span(std::array<ox::remove_const_t<T>, sz> const &a) noexcept:
m_items(a.data()), m_items(a.data()),
m_size(a.size()) { m_size(a.size()) {
} }
@@ -60,7 +60,7 @@ class Span {
} }
template<std::size_t sz> template<std::size_t sz>
constexpr Span(ox::Array<ox::remove_const_t<T>, sz> const&a) noexcept: constexpr Span(ox::Array<ox::remove_const_t<T>, sz> const &a) noexcept:
m_items(a.data()), m_items(a.data()),
m_size(a.size()) { m_size(a.size()) {
} }
@@ -72,7 +72,7 @@ class Span {
} }
template<std::size_t sz, typename Allocator> template<std::size_t sz, typename Allocator>
constexpr Span(ox::Vector<ox::remove_const_t<T>, sz, Allocator> const&v) noexcept: constexpr Span(ox::Vector<ox::remove_const_t<T>, sz, Allocator> const &v) noexcept:
m_items(v.data()), m_items(v.data()),
m_size(v.size()) { m_size(v.size()) {
} }

View File

@@ -263,7 +263,7 @@ class Vector: detail::VectorAllocator<T, Allocator, SmallVectorSize> {
constexpr bool contains(MaybeView_t<T> const&) const noexcept; constexpr bool contains(MaybeView_t<T> const&) const noexcept;
constexpr iterator<T&, T*, false> insert( constexpr iterator<T&, T*, false> insert(
std::size_t pos, std::size_t cnt, T const&val) noexcept(useNoexcept); std::size_t pos, std::size_t cnt, T const &val) noexcept(useNoexcept);
constexpr iterator<T&, T*, false> insert(std::size_t pos, T val) noexcept(useNoexcept); constexpr iterator<T&, T*, false> insert(std::size_t pos, T val) noexcept(useNoexcept);
@@ -526,7 +526,7 @@ constexpr void Vector<T, SmallVectorSize, Allocator>::reserveResize(std::size_t
} }
template<typename T, std::size_t SmallVectorSize, typename Allocator> template<typename T, std::size_t SmallVectorSize, typename Allocator>
constexpr bool Vector<T, SmallVectorSize, Allocator>::contains(MaybeView_t<T> const&v) const noexcept { constexpr bool Vector<T, SmallVectorSize, Allocator>::contains(MaybeView_t<T> const &v) const noexcept {
for (std::size_t i = 0; i < m_size; ++i) { for (std::size_t i = 0; i < m_size; ++i) {
if (m_items[i] == v) { if (m_items[i] == v) {
return true; return true;
@@ -538,7 +538,7 @@ constexpr bool Vector<T, SmallVectorSize, Allocator>::contains(MaybeView_t<T> co
template<typename T, std::size_t SmallVectorSize, typename Allocator> template<typename T, std::size_t SmallVectorSize, typename Allocator>
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<T&, T*, false> constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<T&, T*, false>
Vector<T, SmallVectorSize, Allocator>::insert( Vector<T, SmallVectorSize, Allocator>::insert(
std::size_t pos, std::size_t cnt, T const&val) noexcept(useNoexcept) { std::size_t pos, std::size_t cnt, T const &val) noexcept(useNoexcept) {
if (m_size + cnt > m_cap) { if (m_size + cnt > m_cap) {
reserveInsert(m_cap ? m_size + cnt : initialCap, pos, cnt); reserveInsert(m_cap ? m_size + cnt : initialCap, pos, cnt);
} }