[ox] Update formatting in recently edited files
All checks were successful
Build / build (push) Successful in 1m11s
All checks were successful
Build / build (push) Successful in 1m11s
This commit is contained in:
8
deps/ox/src/ox/model/modelvalue.hpp
vendored
8
deps/ox/src/ox/model/modelvalue.hpp
vendored
@@ -187,7 +187,7 @@ class ModelValue {
|
||||
constexpr Type type() const noexcept;
|
||||
|
||||
constexpr Error setType(
|
||||
DescriptorType const*type,
|
||||
DescriptorType const *type,
|
||||
SubscriptStack const& = {},
|
||||
int subscriptLevels = 0) noexcept;
|
||||
|
||||
@@ -275,7 +275,7 @@ class ModelValueArray {
|
||||
}
|
||||
|
||||
constexpr Error setType(
|
||||
DescriptorType const*type,
|
||||
DescriptorType const *type,
|
||||
SubscriptStack subscriptStack,
|
||||
int subscriptLevels) noexcept {
|
||||
oxAssert(subscriptLevels <= static_cast<int>(subscriptStack.size()), "subscript level mismatch");
|
||||
@@ -418,7 +418,7 @@ class ModelValueVector {
|
||||
}
|
||||
|
||||
constexpr Error setType(
|
||||
DescriptorType const*type,
|
||||
DescriptorType const *type,
|
||||
SubscriptStack subscriptStack,
|
||||
int subscriptLevels) noexcept {
|
||||
oxAssert(subscriptLevels <= static_cast<int>(subscriptStack.size()), "subscript level mismatch");
|
||||
@@ -821,7 +821,7 @@ class ModelUnion {
|
||||
|
||||
template<typename PlatSpec>
|
||||
[[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();
|
||||
}
|
||||
|
||||
|
||||
4
deps/ox/src/ox/std/assert.cpp
vendored
4
deps/ox/src/ox/std/assert.cpp
vendored
@@ -15,7 +15,7 @@
|
||||
|
||||
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);
|
||||
if (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
|
||||
__attribute__((weak))
|
||||
#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);
|
||||
}
|
||||
|
||||
|
||||
4
deps/ox/src/ox/std/assert.hpp
vendored
4
deps/ox/src/ox/std/assert.hpp
vendored
@@ -31,7 +31,7 @@ void panic(
|
||||
[[noreturn]]
|
||||
constexpr void constexprPanic(
|
||||
StringViewCR panicMsg,
|
||||
Error const&err = {},
|
||||
Error const &err = {},
|
||||
std::source_location const &src = std::source_location::current()) noexcept {
|
||||
if (!std::is_constant_evaluated()) {
|
||||
panic(err, panicMsg, src);
|
||||
@@ -66,7 +66,7 @@ constexpr void assertFunc(
|
||||
}
|
||||
|
||||
constexpr void assertFunc(
|
||||
Error const&err,
|
||||
Error const &err,
|
||||
StringViewCR,
|
||||
StringViewCR assertMsg,
|
||||
std::source_location const &src = std::source_location::current()) noexcept {
|
||||
|
||||
56
deps/ox/src/ox/std/error.hpp
vendored
56
deps/ox/src/ox/std/error.hpp
vendored
@@ -17,7 +17,7 @@ class exception {
|
||||
virtual ~exception() = default;
|
||||
|
||||
[[nodiscard]]
|
||||
virtual char const*what() const noexcept {
|
||||
virtual char const *what() const noexcept {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
@@ -44,7 +44,7 @@ struct [[nodiscard]] Error {
|
||||
|
||||
explicit constexpr Error(
|
||||
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},
|
||||
errCode{errCode}
|
||||
{}
|
||||
@@ -52,7 +52,7 @@ struct [[nodiscard]] Error {
|
||||
explicit constexpr Error(
|
||||
ErrorCode const errCode,
|
||||
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},
|
||||
msg{msg},
|
||||
errCode{errCode}
|
||||
@@ -65,13 +65,13 @@ struct [[nodiscard]] Error {
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr auto errCode(Error const&err) noexcept {
|
||||
constexpr auto errCode(Error const &err) noexcept {
|
||||
return err.errCode;
|
||||
}
|
||||
|
||||
template<typename T = char const*>
|
||||
[[nodiscard]]
|
||||
constexpr auto toStr(Error const&err) noexcept {
|
||||
constexpr auto toStr(Error const &err) noexcept {
|
||||
return err.msg ? T{err.msg} : "";
|
||||
}
|
||||
|
||||
@@ -82,19 +82,19 @@ struct Exception: public std::exception {
|
||||
|
||||
explicit Exception(
|
||||
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},
|
||||
errCode{errCode} {}
|
||||
|
||||
explicit Exception(
|
||||
ErrorCode const errCode,
|
||||
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},
|
||||
msg{msg},
|
||||
errCode{errCode} {}
|
||||
|
||||
explicit Exception(Error const&err) noexcept:
|
||||
explicit Exception(Error const &err) noexcept:
|
||||
src{err.src},
|
||||
msg{err.msg ? err.msg : ""},
|
||||
errCode{err.errCode} {}
|
||||
@@ -104,16 +104,16 @@ struct Exception: public std::exception {
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
char const*what() const noexcept override {
|
||||
char const *what() const noexcept override {
|
||||
return msg;
|
||||
}
|
||||
};
|
||||
|
||||
[[noreturn]]
|
||||
void panic(
|
||||
Error const&err,
|
||||
char const*panicMsg,
|
||||
std::source_location const&src = std::source_location::current()) noexcept;
|
||||
Error const &err,
|
||||
char const *panicMsg,
|
||||
std::source_location const &src = std::source_location::current()) noexcept;
|
||||
|
||||
template<typename T>
|
||||
struct [[nodiscard]] Result {
|
||||
@@ -127,25 +127,25 @@ struct [[nodiscard]] Result {
|
||||
}
|
||||
|
||||
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>
|
||||
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;
|
||||
|
||||
explicit constexpr operator type const&() const noexcept {
|
||||
explicit constexpr operator type const &() const noexcept {
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ struct [[nodiscard]] Result {
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
constexpr Error copyTo(U &val) const& noexcept {
|
||||
constexpr Error copyTo(U &val) const & noexcept {
|
||||
if (!error) [[likely]] {
|
||||
val = value;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ struct [[nodiscard]] Result {
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr T const&unwrap() const & noexcept {
|
||||
constexpr T const &unwrap() const & noexcept {
|
||||
if (error) [[unlikely]] {
|
||||
ox::panic(error, "Failed unwrap");
|
||||
}
|
||||
@@ -223,7 +223,7 @@ struct [[nodiscard]] Result {
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr T const&unwrapThrow() const & {
|
||||
constexpr T const &unwrapThrow() const & {
|
||||
if (error) {
|
||||
throw ox::Exception(error);
|
||||
}
|
||||
@@ -247,7 +247,7 @@ struct [[nodiscard]] Result {
|
||||
}
|
||||
|
||||
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]] {
|
||||
return error;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ struct [[nodiscard]] Result {
|
||||
}
|
||||
|
||||
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]] {
|
||||
return error;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ struct [[nodiscard]] Result {
|
||||
* @param 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) {
|
||||
return std::move(alt);
|
||||
}
|
||||
@@ -291,7 +291,7 @@ struct [[nodiscard]] Result {
|
||||
* @param 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) {
|
||||
return alt;
|
||||
}
|
||||
@@ -303,7 +303,7 @@ struct [[nodiscard]] Result {
|
||||
* @param 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) {
|
||||
return alt;
|
||||
}
|
||||
@@ -321,12 +321,12 @@ struct [[nodiscard]] Result {
|
||||
|
||||
namespace detail {
|
||||
|
||||
constexpr Error toError(Error const&e) noexcept {
|
||||
constexpr Error toError(Error const &e) noexcept {
|
||||
return e;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
constexpr Error toError(Result<T> const&r) noexcept {
|
||||
constexpr Error toError(Result<T> const &r) noexcept {
|
||||
return r.error;
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ constexpr void primitiveAssert(
|
||||
constexpr void boundsCheck(
|
||||
size_t const i,
|
||||
size_t const sz,
|
||||
char const*msg,
|
||||
char const *msg,
|
||||
std::source_location const &src = std::source_location::current()) noexcept {
|
||||
if constexpr(defines::CheckBounds) {
|
||||
if (i >= sz) [[unlikely]] {
|
||||
|
||||
2
deps/ox/src/ox/std/new.hpp
vendored
2
deps/ox/src/ox/std/new.hpp
vendored
@@ -79,7 +79,7 @@ constexpr U *make(Args &&...args) noexcept {
|
||||
#ifdef __cpp_exceptions
|
||||
try {
|
||||
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());
|
||||
return nullptr;
|
||||
} catch (...) {
|
||||
|
||||
6
deps/ox/src/ox/std/span.hpp
vendored
6
deps/ox/src/ox/std/span.hpp
vendored
@@ -47,7 +47,7 @@ class Span {
|
||||
}
|
||||
|
||||
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_size(a.size()) {
|
||||
}
|
||||
@@ -60,7 +60,7 @@ class Span {
|
||||
}
|
||||
|
||||
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_size(a.size()) {
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class Span {
|
||||
}
|
||||
|
||||
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_size(v.size()) {
|
||||
}
|
||||
|
||||
6
deps/ox/src/ox/std/vector.hpp
vendored
6
deps/ox/src/ox/std/vector.hpp
vendored
@@ -263,7 +263,7 @@ class Vector: detail::VectorAllocator<T, Allocator, SmallVectorSize> {
|
||||
constexpr bool contains(MaybeView_t<T> const&) const noexcept;
|
||||
|
||||
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);
|
||||
|
||||
@@ -526,7 +526,7 @@ constexpr void Vector<T, SmallVectorSize, Allocator>::reserveResize(std::size_t
|
||||
}
|
||||
|
||||
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) {
|
||||
if (m_items[i] == v) {
|
||||
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>
|
||||
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<T&, T*, false>
|
||||
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) {
|
||||
reserveInsert(m_cap ? m_size + cnt : initialCap, pos, cnt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user