use a safer type cast rather than setting the internal values directly

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libmatroska@7 a6f86f6d-0131-4f8e-9e7b-e335508773d5
This commit is contained in:
Steve Lhomme 2010-03-15 15:56:05 +00:00
parent a5e3439cee
commit 44d2a6d2ed
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ class MATROSKA_DLL_API KaxReferenceBlock : public EbmlSInteger {
protected:
const KaxBlockBlob * RefdBlock;
const KaxBlockGroup * ParentBlock;
void SetReferencedTimecode(int64 refTimecode) {Value = refTimecode; bTimecodeSet = true; bValueIsSet = true;};
void SetReferencedTimecode(int64 refTimecode) {*static_cast<EbmlSInteger*>(this) = refTimecode; bTimecodeSet = true;};
bool bTimecodeSet;
};

View File

@ -114,7 +114,7 @@ uint64 KaxReferenceBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
assert(ParentBlock != NULL);
const KaxInternalBlock &block = *RefdBlock;
Value = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale());
*static_cast<EbmlSInteger*>(this) = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale());
}
return EbmlSInteger::UpdateSize(bSaveDefault, bForceRender);
}