| 147 | |
| 148 | |
| 149 | static inline void |
| 150 | __cirbuf_shift_left(struct cirbuf *cbuf) |
| 151 | { |
| 152 | unsigned int i; |
| 153 | char tmp = cbuf->buf[cbuf->start]; |
| 154 | |
| 155 | for (i=0 ; i<cbuf->len ; i++) { |
| 156 | cbuf->buf[(cbuf->start+i)%cbuf->maxlen] = |
| 157 | cbuf->buf[(cbuf->start+i+1)%cbuf->maxlen]; |
| 158 | } |
| 159 | cbuf->buf[(cbuf->start-1+cbuf->maxlen)%cbuf->maxlen] = tmp; |
| 160 | cbuf->start += (cbuf->maxlen - 1); |
| 161 | cbuf->start %= cbuf->maxlen; |
| 162 | cbuf->end += (cbuf->maxlen - 1); |
| 163 | cbuf->end %= cbuf->maxlen; |
| 164 | } |
| 165 | |
| 166 | static inline void |
| 167 | __cirbuf_shift_right(struct cirbuf *cbuf) |
no outgoing calls
no test coverage detected