diff --git a/deps/ox/src/ox/mc/presencemask.cpp b/deps/ox/src/ox/mc/presencemask.cpp index 106b7db5..30d6870c 100644 --- a/deps/ox/src/ox/mc/presencemask.cpp +++ b/deps/ox/src/ox/mc/presencemask.cpp @@ -17,7 +17,7 @@ FieldPresenseMask::FieldPresenseMask(uint8_t *mask, std::size_t maxLen) { m_maskLen = maxLen; } -bool FieldPresenseMask::get(int i) { +bool FieldPresenseMask::get(int i) const { if (i / 8 < m_maskLen) { return (m_mask[i / 8] >> (i % 8)) & 1; } else { @@ -25,7 +25,7 @@ bool FieldPresenseMask::get(int i) { } } -int FieldPresenseMask::set(int i, bool on) { +Error FieldPresenseMask::set(int i, bool on) { if (i / 8 < m_maskLen) { if (on) { m_mask[i / 8] |= 1 << (i % 8); diff --git a/deps/ox/src/ox/mc/presencemask.hpp b/deps/ox/src/ox/mc/presencemask.hpp index 9d411a2e..24a58da6 100644 --- a/deps/ox/src/ox/mc/presencemask.hpp +++ b/deps/ox/src/ox/mc/presencemask.hpp @@ -8,6 +8,7 @@ #pragma once +#include #include namespace ox { @@ -21,17 +22,17 @@ class FieldPresenseMask { public: FieldPresenseMask(uint8_t *mask, std::size_t maxLen); - bool get(int i); + bool get(int i) const; - int set(int i, bool on); + Error set(int i, bool on); constexpr void setFields(int) noexcept; - constexpr int getFields() noexcept; + constexpr int getFields() const noexcept; constexpr void setMaxLen(int) noexcept; - constexpr int getMaxLen() noexcept; + constexpr int getMaxLen() const noexcept; }; @@ -39,7 +40,7 @@ constexpr void FieldPresenseMask::setFields(int fields) noexcept { m_fields = fields; } -constexpr int FieldPresenseMask::getFields() noexcept { +constexpr int FieldPresenseMask::getFields() const noexcept { return m_fields; } @@ -47,7 +48,7 @@ constexpr void FieldPresenseMask::setMaxLen(int maxLen) noexcept { m_maskLen = maxLen; } -constexpr int FieldPresenseMask::getMaxLen() noexcept { +constexpr int FieldPresenseMask::getMaxLen() const noexcept { return m_maskLen; } diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index f1a059e3..ec41d671 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -103,7 +103,7 @@ Error MetalClawWriter::op(const char*, ox::Vector *val) { template Error MetalClawWriter::appendInteger(I val) { - int err = 0; + Error err = 0; bool fieldSet = false; if (val) { if (m_buffIt + sizeof(I) < m_buffLen) { @@ -121,7 +121,7 @@ Error MetalClawWriter::appendInteger(I val) { template Error MetalClawWriter::op(const char*, T *val, std::size_t len) { - int err = 0; + Error err = 0; bool fieldSet = false; if (len) {