Merge pull request #26 from lioncash/enum

General: Be explicit about SeekOrigin type
This commit is contained in:
Phillip Stephens 2019-09-08 00:11:52 -07:00 committed by GitHub
commit 43611bd0b7
2 changed files with 5 additions and 5 deletions

View File

@ -77,7 +77,7 @@ SDNARead::SDNARead(SystemStringView path) {
atUint64 length = r.length(); atUint64 length = r.length();
char magicBuf[7]; char magicBuf[7];
r.readUBytesToBuf(magicBuf, 7); r.readUBytesToBuf(magicBuf, 7);
r.seek(0, athena::Begin); r.seek(0, athena::SeekOrigin::Begin);
if (strncmp(magicBuf, "BLENDER", 7)) { if (strncmp(magicBuf, "BLENDER", 7)) {
/* Try gzip decompression */ /* Try gzip decompression */
std::unique_ptr<uint8_t[]> compBuf(new uint8_t[4096]); std::unique_ptr<uint8_t[]> compBuf(new uint8_t[4096]);
@ -169,15 +169,15 @@ BlendType GetBlendType(SystemStringView path) {
r.enumerate( r.enumerate(
[idPropIdx, typeOffset, nameOffset, valOffset, &ret](const FileBlock& block, athena::io::MemoryReader& r) { [idPropIdx, typeOffset, nameOffset, valOffset, &ret](const FileBlock& block, athena::io::MemoryReader& r) {
if (block.type == FOURCC('DATA') && block.sdnaIdx == idPropIdx) { if (block.type == FOURCC('DATA') && block.sdnaIdx == idPropIdx) {
r.seek(typeOffset, athena::Begin); r.seek(typeOffset, athena::SeekOrigin::Begin);
if (r.readUByte() != 1) if (r.readUByte() != 1)
return true; return true;
r.seek(nameOffset, athena::Begin); r.seek(nameOffset, athena::SeekOrigin::Begin);
if (r.readString() != "hecl_type") if (r.readString() != "hecl_type")
return true; return true;
r.seek(valOffset, athena::Begin); r.seek(valOffset, athena::SeekOrigin::Begin);
ret = BlendType(r.readUint32Little()); ret = BlendType(r.readUint32Little());
return false; return false;
} }

View File

@ -68,7 +68,7 @@ void ClientProcess::BufferTransaction::run(blender::Token& btok) {
return; return;
} }
if (m_offset) if (m_offset)
r.seek(m_offset, athena::Begin); r.seek(m_offset, athena::SeekOrigin::Begin);
r.readBytesToBuf(m_targetBuf, m_maxLen); r.readBytesToBuf(m_targetBuf, m_maxLen);
m_complete = true; m_complete = true;
} }