[ox] Fix most MSVC warnings
This commit is contained in:
parent
109f272650
commit
158115c29f
2
deps/ox/src/ox/mc/intops.hpp
vendored
2
deps/ox/src/ox/mc/intops.hpp
vendored
@ -35,7 +35,7 @@ constexpr std::size_t highestBit(I val) noexcept {
|
|||||||
if constexpr(is_signed_v<I>) {
|
if constexpr(is_signed_v<I>) {
|
||||||
--shiftStart;
|
--shiftStart;
|
||||||
}
|
}
|
||||||
for (auto i = shiftStart; i < MaxValue<decltype(i)>; --i) {
|
for (auto i = shiftStart; i > 0; --i) {
|
||||||
const auto bitValue = (val >> i) & 1;
|
const auto bitValue = (val >> i) & 1;
|
||||||
if (bitValue) {
|
if (bitValue) {
|
||||||
highestBit = i;
|
highestBit = i;
|
||||||
|
4
deps/ox/src/ox/std/error.hpp
vendored
4
deps/ox/src/ox/std/error.hpp
vendored
@ -132,7 +132,7 @@ struct [[nodiscard]] Result {
|
|||||||
T value;
|
T value;
|
||||||
Error error;
|
Error error;
|
||||||
|
|
||||||
constexpr Result() noexcept: error(0) {
|
constexpr Result() noexcept: value(), error(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename U>
|
template<typename U>
|
||||||
@ -143,7 +143,7 @@ struct [[nodiscard]] Result {
|
|||||||
constexpr Result(const Result<U> &&other) noexcept: value(std::move(other.value)), error(std::move(other.error)) {
|
constexpr Result(const Result<U> &&other) noexcept: value(std::move(other.value)), error(std::move(other.error)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Result(const Error &error) noexcept: error(error) {
|
constexpr Result(const Error &error) noexcept: value(), error(error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Result(const type &value, const Error &error = OxError(0)) noexcept: value(const_cast<type&>(value)), error(error) {
|
constexpr Result(const type &value, const Error &error = OxError(0)) noexcept: value(const_cast<type&>(value)), error(error) {
|
||||||
|
2
deps/ox/src/ox/std/fmt.hpp
vendored
2
deps/ox/src/ox/std/fmt.hpp
vendored
@ -193,7 +193,7 @@ constexpr StringType sfmt(StringView fmt, Args... args) noexcept {
|
|||||||
const auto &firstSegment = fmtSegments.segments[0];
|
const auto &firstSegment = fmtSegments.segments[0];
|
||||||
oxIgnoreError(out.append(firstSegment.str, firstSegment.length));
|
oxIgnoreError(out.append(firstSegment.str, firstSegment.length));
|
||||||
const detail::FmtArg elements[sizeof...(args)] = {args...};
|
const detail::FmtArg elements[sizeof...(args)] = {args...};
|
||||||
for (auto i = 0u; i < fmtSegments.size - 1; ++i) {
|
for (auto i = 0ull; i < fmtSegments.size - 1; ++i) {
|
||||||
out += elements[i].out;
|
out += elements[i].out;
|
||||||
const auto &s = fmtSegments.segments[i + 1];
|
const auto &s = fmtSegments.segments[i + 1];
|
||||||
oxIgnoreError(out.append(s.str, s.length));
|
oxIgnoreError(out.append(s.str, s.length));
|
||||||
|
2
deps/ox/src/ox/std/trace.hpp
vendored
2
deps/ox/src/ox/std/trace.hpp
vendored
@ -151,7 +151,7 @@ class OutStream {
|
|||||||
const auto &firstSegment = fmtSegments.segments[0];
|
const auto &firstSegment = fmtSegments.segments[0];
|
||||||
oxIgnoreError(m_msg.msg.append(firstSegment.str, firstSegment.length));
|
oxIgnoreError(m_msg.msg.append(firstSegment.str, firstSegment.length));
|
||||||
//const detail::FmtArg elements[sizeof...(args)] = {args...};
|
//const detail::FmtArg elements[sizeof...(args)] = {args...};
|
||||||
for (auto i = 0u; i < fmtSegments.size - 1; ++i) {
|
for (auto i = 0ull; i < fmtSegments.size - 1; ++i) {
|
||||||
m_msg.msg += elements[i].out;
|
m_msg.msg += elements[i].out;
|
||||||
const auto &s = fmtSegments.segments[i + 1];
|
const auto &s = fmtSegments.segments[i + 1];
|
||||||
oxIgnoreError(m_msg.msg.append(s.str, s.length));
|
oxIgnoreError(m_msg.msg.append(s.str, s.length));
|
||||||
|
2
deps/ox/src/ox/std/uuid.hpp
vendored
2
deps/ox/src/ox/std/uuid.hpp
vendored
@ -128,7 +128,7 @@ class UUID {
|
|||||||
}
|
}
|
||||||
UUID out;
|
UUID out;
|
||||||
auto valueI = 0u;
|
auto valueI = 0u;
|
||||||
for (auto i = 0u; i < s.len();) {
|
for (auto i = 0ull; i < s.len();) {
|
||||||
if (s[i] == '-') {
|
if (s[i] == '-') {
|
||||||
++i;
|
++i;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user