Browse Source

Merge pull request #108 from branan/seqprefix

Increase allowable sequence prefix range
Adam Johnson 13 years ago
parent
commit
4b8c0a8ab6
  1. 6
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp

6
Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp

@ -316,7 +316,7 @@ plLocation plAgeDescription::CalcPageLocation( const char *page ) const
{
// Combine our sequence # together
Int32 combined;
hsAssert(abs(fSeqPrefix) < 0xFF, "Age sequence prefex is out of range!"); // sequence prefix can NOT be larger or equal to 1-byte max value
hsAssert(fSeqPrefix > -255 && fSeqPrefix <= 0xFEFF, "Age sequence prefex is out of range!"); // sequence prefix can NOT be larger or equal to 1-byte max value
UInt32 suffix = ap->GetSeqSuffix();
hsAssert(suffix <= 0xFFFF, "Page sequence number is out of range!"); // page sequence number can NOT be larger then 2-byte max value
if( fSeqPrefix < 0 ) // we are a global age
@ -326,8 +326,8 @@ plLocation plAgeDescription::CalcPageLocation( const char *page ) const
// Now, our 32 bit number looks like the following:
// 0xRRAAPPPP
// - RR is FF when reserved, and 00 when normal
// - AA is the one byte for age sequence prefix (FF not allowed because 0xFFFFFFFFFF is reserved for invalid sequence number)
// - RR is FF when reserved, and 00-FE when normal
// - AA is the low byte of the age sequence prefix (FF not allowed on a negative prefix because 0xFFFFFFFFFF is reserved for invalid sequence number)
// - PPPP is the two bytes for page sequence number
if( IsGlobalAge() )

Loading…
Cancel
Save