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

Function __cirbuf_shift_left

dpdk/lib/cmdline/cmdline_cirbuf.c:149–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147
148
149static 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
166static inline void
167__cirbuf_shift_right(struct cirbuf *cbuf)

Callers 2

cirbuf_align_leftFunction · 0.85
cirbuf_align_rightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected