memcpy(&wrd->rd_ring->buffer[wrd->rd_prod], data, left);
memcpy(&wrd->rd_ring->buffer[0], data + left, datalen - left);
wrd->rd_prod += datalen;
- wrd->rd_prod &= wrd->rd_data_size - 1;
+ wrd->rd_prod %= wrd->rd_data_size;
}
static inline void
memcpy(data + left, &rrd->rd_ring->buffer[0], datalen - left);
if (!peek) {
rrd->rd_cons += datalen;
- rrd->rd_cons &= rrd->rd_data_size - 1;
+ rrd->rd_cons %= rrd->rd_data_size;
}
}
if (offset) {
rrd->rd_cons += offset;
- rrd->rd_cons &= rrd->rd_data_size - 1;
+ rrd->rd_cons %= rrd->rd_data_size;
}
hv_ring_get(rrd, (uint8_t *)data, datalen, 0);