| 164 | } |
| 165 | |
| 166 | static inline void |
| 167 | __cirbuf_shift_right(struct cirbuf *cbuf) |
| 168 | { |
| 169 | unsigned int i; |
| 170 | char tmp = cbuf->buf[cbuf->end]; |
| 171 | |
| 172 | for (i=0 ; i<cbuf->len ; i++) { |
| 173 | cbuf->buf[(cbuf->end+cbuf->maxlen-i)%cbuf->maxlen] = |
| 174 | cbuf->buf[(cbuf->end+cbuf->maxlen-i-1)%cbuf->maxlen]; |
| 175 | } |
| 176 | cbuf->buf[(cbuf->end+1)%cbuf->maxlen] = tmp; |
| 177 | cbuf->start += 1; |
| 178 | cbuf->start %= cbuf->maxlen; |
| 179 | cbuf->end += 1; |
| 180 | cbuf->end %= cbuf->maxlen; |
| 181 | } |
| 182 | |
| 183 | /* XXX we could do a better algorithm here... */ |
| 184 | int |
no outgoing calls
no test coverage detected