[ox] Fix most MSVC warnings

This commit is contained in:
Gary Talent 2023-11-12 00:31:13 -06:00
parent 109f272650
commit 158115c29f
5 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@ constexpr std::size_t highestBit(I val) noexcept {
if constexpr(is_signed_v<I>) {
--shiftStart;
}
for (auto i = shiftStart; i < MaxValue<decltype(i)>; --i) {
for (auto i = shiftStart; i > 0; --i) {
const auto bitValue = (val >> i) & 1;
if (bitValue) {
highestBit = i;

View File

@ -132,7 +132,7 @@ struct [[nodiscard]] Result {
T value;
Error error;
constexpr Result() noexcept: error(0) {
constexpr Result() noexcept: value(), error(0) {
}
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 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) {

View File

@ -193,7 +193,7 @@ constexpr StringType sfmt(StringView fmt, Args... args) noexcept {
const auto &firstSegment = fmtSegments.segments[0];
oxIgnoreError(out.append(firstSegment.str, firstSegment.length));
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;
const auto &s = fmtSegments.segments[i + 1];
oxIgnoreError(out.append(s.str, s.length));

View File

@ -151,7 +151,7 @@ class OutStream {
const auto &firstSegment = fmtSegments.segments[0];
oxIgnoreError(m_msg.msg.append(firstSegment.str, firstSegment.length));
//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;
const auto &s = fmtSegments.segments[i + 1];
oxIgnoreError(m_msg.msg.append(s.str, s.length));

View File

@ -128,7 +128,7 @@ class UUID {
}
UUID out;
auto valueI = 0u;
for (auto i = 0u; i < s.len();) {
for (auto i = 0ull; i < s.len();) {
if (s[i] == '-') {
++i;
continue;