Renamed readVarUint() to readVarUint64() for better readability an consistency
diff --git a/include/rive/core/binary_reader.hpp b/include/rive/core/binary_reader.hpp index c148788..f7e8627 100644 --- a/include/rive/core/binary_reader.hpp +++ b/include/rive/core/binary_reader.hpp
@@ -23,12 +23,12 @@ size_t lengthInBytes() const; - uint64_t readVarUint(); std::string readString(); double readFloat64(); float readFloat32(); uint8_t readByte(); uint32_t readUint32(); + uint64_t readVarUint64(); // Reads a LEB128 encoded uint64_t }; } // namespace rive
diff --git a/include/rive/runtime_header.hpp b/include/rive/runtime_header.hpp index a8fcb07..f8c3fa9 100644 --- a/include/rive/runtime_header.hpp +++ b/include/rive/runtime_header.hpp
@@ -55,18 +55,18 @@ } } - header.m_MajorVersion = (int)reader.readVarUint(); + header.m_MajorVersion = (int)reader.readVarUint64(); if (reader.didOverflow()) { return false; } - header.m_MinorVersion = (int)reader.readVarUint(); + header.m_MinorVersion = (int)reader.readVarUint64(); if (reader.didOverflow()) { return false; } - header.m_FileId = (int)reader.readVarUint(); + header.m_FileId = (int)reader.readVarUint64(); if (reader.didOverflow()) { @@ -74,8 +74,8 @@ } std::vector<int> propertyKeys; - for (int propertyKey = (int)reader.readVarUint(); propertyKey != 0; - propertyKey = (int)reader.readVarUint()) + for (int propertyKey = (int)reader.readVarUint64(); propertyKey != 0; + propertyKey = (int)reader.readVarUint64()) { propertyKeys.push_back(propertyKey); if (reader.didOverflow())
diff --git a/src/core/binary_reader.cpp b/src/core/binary_reader.cpp index d2fbae6..0596549 100644 --- a/src/core/binary_reader.cpp +++ b/src/core/binary_reader.cpp
@@ -27,7 +27,7 @@ m_Position = m_End; } -uint64_t BinaryReader::readVarUint() +uint64_t BinaryReader::readVarUint64() { uint64_t value; auto readBytes = decode_uint_leb(m_Position, m_End, &value); @@ -42,7 +42,7 @@ std::string BinaryReader::readString() { - uint64_t length = readVarUint(); + uint64_t length = readVarUint64(); if (didOverflow()) { return std::string();
diff --git a/src/core/field_types/core_uint_type.cpp b/src/core/field_types/core_uint_type.cpp index a2b54fc..3d8e43f 100644 --- a/src/core/field_types/core_uint_type.cpp +++ b/src/core/field_types/core_uint_type.cpp
@@ -5,5 +5,5 @@ unsigned int CoreUintType::deserialize(BinaryReader& reader) { - return (int) reader.readVarUint(); + return (int) reader.readVarUint64(); }
diff --git a/src/file.cpp b/src/file.cpp index d4f8fb7..009da9e 100644 --- a/src/file.cpp +++ b/src/file.cpp
@@ -30,11 +30,11 @@ static Core* readRuntimeObject(BinaryReader& reader, const RuntimeHeader& header) { - auto coreObjectKey = reader.readVarUint(); + auto coreObjectKey = reader.readVarUint64(); auto object = CoreRegistry::makeCoreInstance((int)coreObjectKey); while (true) { - auto propertyKey = reader.readVarUint(); + auto propertyKey = reader.readVarUint64(); if (propertyKey == 0) { // Terminator. https://media.giphy.com/media/7TtvTUMm9mp20/giphy.gif