Correct a casting issue in the rapidjson implementation

Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2021-10-19 11:43:06 +01:00
parent 1943db6f20
commit 16752474d9
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ byte_t::byte_t(simdjson::dom::array input) noexcept
#ifdef USE_RAPIDJSON_JSON
byte_t::byte_t(const rapidjson::Value& input)
: m_address((uint8_t)input[0].GetInt64()),
: m_address((uint16_t)input[0].GetInt64()),
m_value((uint8_t)input[1].GetInt64()) {
assert(input.Size() == 2);
}

View File

@ -43,7 +43,7 @@ cycle_t::cycle_t(simdjson::dom::array input) noexcept
#ifdef USE_RAPIDJSON_JSON
cycle_t::cycle_t(const rapidjson::Value& input)
: m_address((uint8_t)input[0].GetInt64()),
: m_address((uint16_t)input[0].GetInt64()),
m_value((uint8_t)input[1].GetInt64()),
m_action(to_action(input[2].GetString())) {
assert(input.Size() == 3);