diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-24 22:56:53 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-26 21:00:51 +0100 |
commit | c15d5cc2303aef3d4417453b680d42a69ff28fb0 (patch) | |
tree | 6dfe6da87808b2a323b17a126ca15c4b1733eb3e | |
parent | 9977e1545aa31873173038497caa3fffa5b63b87 (diff) |
tbf/rlc: Remove the side-effect from the loop.
-rw-r--r-- | src/tbf.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index aab65863..5f5ea33b 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1618,19 +1618,20 @@ int gprs_rlcmac_tbf::rcv_data_block_acknowledged(const uint8_t *data, size_t len this->dir.ul.window.v_r()); } - #warning "Move to TBF and remove the index side effect.." /* Raise V(Q) if possible, and retrieve LLC frames from blocks. * This is looped until there is a gap (non received block) or * the window is empty.*/ - while (this->dir.ul.window.v_q() != this->dir.ul.window.v_r() && this->dir.ul.v_n. - is_received(index = this->dir.ul.window.v_q() & mod_sns_half)) { + while (this->dir.ul.window.v_q() != this->dir.ul.window.v_r()) { + index = dir.ul.window.v_q() & mod_sns_half; + if (!dir.ul.v_n.is_received(index)) + break; LOGP(DRLCMACUL, LOGL_DEBUG, "- Taking block %d out, raising " - "V(Q) to %d\n", this->dir.ul.window.v_q(), - (this->dir.ul.window.v_q() + 1) & mod_sns); + "V(Q) to %d\n", dir.ul.window.v_q(), + (dir.ul.window.v_q() + 1) & mod_sns); /* get LLC data from block */ - this->assemble_forward_llc(&m_rlc.blocks[index]); + assemble_forward_llc(&m_rlc.blocks[index]); /* raise V(Q), because block already received */ - this->dir.ul.window.increment_q(1); + dir.ul.window.increment_q(1); } /* Check CV of last frame in buffer */ |