Merge pull request #66 from BenjaminLawson/fix-implicit-conversion
Fix implicit conversions in UIntView
diff --git a/runtime/cpp/emboss_prelude.h b/runtime/cpp/emboss_prelude.h
index a47b8b5..0fbaff4 100644
--- a/runtime/cpp/emboss_prelude.h
+++ b/runtime/cpp/emboss_prelude.h
@@ -145,7 +145,7 @@
~UIntView() = default;
ValueType Read() const {
- ValueType result = buffer_.ReadUInt();
+ ValueType result = static_cast<ValueType>(buffer_.ReadUInt());
EMBOSS_CHECK(Parameters::ValueIsOk(result));
return result;
}
@@ -197,7 +197,7 @@
bool TryToWrite(IntT value) const {
if (!CouldWriteValue(value)) return false;
if (!IsComplete()) return false;
- buffer_.WriteUInt(value);
+ buffer_.WriteUInt(static_cast<ValueType>(value));
return true;
}