diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-13 17:14:42 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-13 17:14:42 +0100 |
commit | 32f9a59ab42f9c37908d3d4a9db341583ab516ac (patch) | |
tree | 1d134b8f56ee469759ab0c3df418d5d52dd1fe04 /src/llc.h | |
parent | e23102602c94dc7fdd7cc6d383e7f6c576aa01ed (diff) |
llc: Make the index 'private' by appending a m_ to it.
At some point in the future we can start using the private/protected
keywords in this struct.
Diffstat (limited to 'src/llc.h')
-rw-r--r-- | src/llc.h | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -50,19 +50,19 @@ struct gprs_llc { bool fits_in_current_frame(uint8_t size) const; uint8_t frame[LLC_MAX_LEN]; /* current DL or UL frame */ - uint16_t index; /* current write/read position of frame */ + uint16_t m_index; /* current write/read position of frame */ uint16_t m_length; /* len of current DL LLC_frame, 0 == no frame */ struct llist_head queue; /* queued LLC DL data */ }; inline uint16_t gprs_llc::chunk_size() const { - return m_length - index; + return m_length - m_index; } inline uint16_t gprs_llc::remaining_space() const { - return LLC_MAX_LEN - index; + return LLC_MAX_LEN - m_index; } inline uint16_t gprs_llc::frame_length() const @@ -72,17 +72,17 @@ inline uint16_t gprs_llc::frame_length() const inline void gprs_llc::consume(size_t len) { - index += len; + m_index += len; } inline void gprs_llc::consume(uint8_t *data, size_t len) { /* copy and increment index */ - memcpy(data, frame + index, len); - index += len; + memcpy(data, frame + m_index, len); + consume(len); } inline bool gprs_llc::fits_in_current_frame(uint8_t chunk_size) const { - return index + chunk_size <= LLC_MAX_LEN; + return m_index + chunk_size <= LLC_MAX_LEN; } |