From a848893d85cd027d831ba0ecae9dacef0a5f0605 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 30 Aug 2008 17:33:07 -0700 Subject: ringbuf: create a new struct rbvec instead of reusing struct iovec Using struct iovec means having to cast iov_base everywhere we want to do pointer arithmetic. Instead, just use rbvec which can be safely casted to iovec whenever we use the readv/writev functions. --- src/outputBuffer_ob_send.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/outputBuffer_ob_send.h') diff --git a/src/outputBuffer_ob_send.h b/src/outputBuffer_ob_send.h index 2a4a84763..d2c99b3f2 100644 --- a/src/outputBuffer_ob_send.h +++ b/src/outputBuffer_ob_send.h @@ -63,7 +63,7 @@ enum dc_action ob_send(void *data, size_t len, float decode_time, mpd_uint16 bit_rate, ReplayGainInfo * rgi) { - struct iovec vec[2]; + struct rbvec vec[2]; struct ob_chunk *c; size_t idx; size_t i, j; @@ -86,9 +86,9 @@ ob_send(void *data, size_t len, } for (i = 0; i < ARRAY_SIZE(vec); i++) { - for (j = 0; j < vec[i].iov_len; j++) { + for (j = 0; j < vec[i].len; j++) { size_t c_len; - idx = vec[i].iov_base - ob.index->buf + j; + idx = vec[i].base - ob.index->buf + j; c = &(ob.chunks[idx]); if (!c->len) { /* populate empty chunk */ -- cgit v1.2.3