diff --git a/lib/tls_syntax/include/tls/tls_syntax.h b/lib/tls_syntax/include/tls/tls_syntax.h index 1b3dd8c5..04014433 100644 --- a/lib/tls_syntax/include/tls/tls_syntax.h +++ b/lib/tls_syntax/include/tls/tls_syntax.h @@ -9,11 +9,20 @@ #include #include #include +#include +#include #include namespace MLS_NAMESPACE::tls { +using std::size_t; +using std::uint8_t; +using std::uint16_t; +using std::uint32_t; +using std::uint64_t; +using std::ptrdiff_t; + // For indicating no min or max in vector definitions const size_t none = std::numeric_limits::max(); @@ -288,8 +297,9 @@ operator>>(istream& str, std::vector& vec) // NB: Remember that we store the vector in reverse order // NB: This requires that T be default-constructible istream r; + const auto size_diff = static_cast(size); r._buffer = - std::vector{ str._buffer.end() - size, str._buffer.end() }; + std::vector{ str._buffer.end() - size_diff, str._buffer.end() }; vec.clear(); while (r._buffer.size() > 0) { @@ -298,7 +308,7 @@ operator>>(istream& str, std::vector& vec) } // Truncate the primary buffer - str._buffer.erase(str._buffer.end() - size, str._buffer.end()); + str._buffer.erase(str._buffer.end() - size_diff, str._buffer.end()); return str; }