@@ -481,14 +481,9 @@ class Scanner : public IScanner, public EncodingPolicy
481481 charcount_t IchMinTok (void ) const
482482 {
483483
484- AssertOrFailFast (m_pchMinTok - m_pchBase >= 0 );
485- AssertOrFailFast (m_pchMinTok - m_pchBase <= LONG_MAX);
486- if (static_cast <charcount_t >(m_pchMinTok - m_pchBase) < m_cMinTokMultiUnits)
487- {
488- AssertMsg (false , " IchMinTok subtraction overflow" );
489- return 0 ;
490- }
491-
484+ Assert (m_pchMinTok - m_pchBase >= 0 );
485+ Assert (m_pchMinTok - m_pchBase <= LONG_MAX);
486+ Assert (static_cast <charcount_t >(m_pchMinTok - m_pchBase) >= m_cMinTokMultiUnits);
492487 return static_cast <charcount_t >(m_pchMinTok - m_pchBase - m_cMinTokMultiUnits);
493488 }
494489
@@ -497,15 +492,10 @@ class Scanner : public IScanner, public EncodingPolicy
497492 charcount_t IchLimTok (void ) const
498493 {
499494
500- AssertOrFailFast (m_currentCharacter - m_pchBase >= 0 );
501- AssertOrFailFast (m_currentCharacter - m_pchBase <= LONG_MAX);
502- if (static_cast <charcount_t >(m_currentCharacter - m_pchBase) < this ->m_cMultiUnits )
503- {
504- AssertMsg (false , " IchLimTok subtraction overflow" );
505- return 0 ;
506- }
507-
508- return static_cast < charcount_t >(m_currentCharacter - m_pchBase - this ->m_cMultiUnits );
495+ Assert (m_currentCharacter - m_pchBase >= 0 );
496+ Assert (m_currentCharacter - m_pchBase <= LONG_MAX);
497+ Assert (static_cast <charcount_t >(m_currentCharacter - m_pchBase) >= this ->m_cMultiUnits );
498+ return static_cast <charcount_t >(m_currentCharacter - m_pchBase - this ->m_cMultiUnits );
509499 }
510500
511501 void SetErrorPosition (charcount_t ichMinError, charcount_t ichLimError)
@@ -557,14 +547,9 @@ class Scanner : public IScanner, public EncodingPolicy
557547 charcount_t IchMinLine (void ) const
558548 {
559549
560- AssertOrFailFast (m_pchMinLine - m_pchBase >= 0 );
561- AssertOrFailFast (m_pchMinLine - m_pchBase <= LONG_MAX);
562- if (static_cast <charcount_t >(m_pchMinLine - m_pchBase) < m_cMinLineMultiUnits)
563- {
564- AssertMsg (false , " IchMinLine subtraction overflow" );
565- return 0 ;
566- }
567-
550+ Assert (m_pchMinLine - m_pchBase >= 0 );
551+ Assert (m_pchMinLine - m_pchBase <= LONG_MAX);
552+ Assert (static_cast <charcount_t >(m_pchMinLine - m_pchBase) >= m_cMinLineMultiUnits);
568553 return static_cast <charcount_t >(m_pchMinLine - m_pchBase - m_cMinLineMultiUnits);
569554 }
570555
0 commit comments