Skip to content

Commit

Permalink
Merge pull request H-uru#108 from branan/seqprefix
Browse files Browse the repository at this point in the history
Increase allowable sequence prefix range
  • Loading branch information
Hoikas committed Jan 8, 2012
2 parents 5e04f98 + 30faa99 commit 4b8c0a8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() )
Expand Down

0 comments on commit 4b8c0a8

Please sign in to comment.