MCPcopy Create free account
hub / github.com/F-Stack/f-stack / __cirbuf_shift_right

Function __cirbuf_shift_right

dpdk/lib/cmdline/cmdline_cirbuf.c:166–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166static 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... */
184int

Callers 2

cirbuf_align_leftFunction · 0.85
cirbuf_align_rightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected