diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2015-07-11 12:35:46 -0400 |
---|---|---|
committer | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2015-07-11 12:35:46 -0400 |
commit | c8b9aced8cc7ef16e6cbba2ed929091441fd94dd (patch) | |
tree | 57fd7f31458ca860824505f7fc8de89ddc82d8c7 | |
parent | eac726bc17077566bee7add0726670e8904cad9a (diff) |
GSM: Make decTN()/incTN() to work with more than one frame adjustment.
-rw-r--r-- | GSM/GSMCommon.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/GSM/GSMCommon.h b/GSM/GSMCommon.h index 80c5608..e255be3 100644 --- a/GSM/GSMCommon.h +++ b/GSM/GSMCommon.h @@ -116,9 +116,8 @@ class Time { Time& decTN(unsigned step=1) { - assert(step<=8); mTN -= step; - if (mTN<0) { + while (mTN<0) { mTN+=8; mFN-=1; if (mFN<0) mFN+=gHyperframe; @@ -128,9 +127,8 @@ class Time { Time& incTN(unsigned step=1) { - assert(step<=8); mTN += step; - if (mTN>7) { + while (mTN>7) { mTN-=8; mFN = (mFN+1) % gHyperframe; } |