From: Nicolas Pennequin Date: Sat, 4 Aug 2007 20:34:50 +0000 (+0200) Subject: A couple comment changes. X-Git-Tag: working_mob_2~9 X-Git-Url: https://repo.or.cz/w/Rockbox-MoB.git/commitdiff_plain/edd293ad76669b6f691d2eedb993152469e98087 A couple comment changes. --- diff --git a/testplugin.c b/testplugin.c index 13319ae..2ae948e 100644 --- a/testplugin.c +++ b/testplugin.c @@ -603,6 +603,7 @@ ssize_t bufread(int handle_id, size_t size, char *dest) if (h->ridx + buffered_data > buffer_len) { + /* the data wraps around the end of the buffer */ size_t read = buffer_len - h->ridx; rb->memcpy(dest, &buffer[h->ridx], read); rb->memcpy(dest+read, buffer, buffered_data - read); @@ -634,7 +635,8 @@ ssize_t bufgetdata(int handle_id, size_t size, unsigned char **data) if (h->ridx + size > buffer_len && h->available - RINGBUF_SUB(h->ridx, h->data) >= size) { - /* use the guard buffer to provide what was requested. */ + /* the data wraps around the end of the buffer : + use the guard buffer to provide the requested amount of data. */ size_t copy_n = MIN(h->ridx + size - buffer_len, GUARD_SIZE); rb->memcpy(guard_buffer, (unsigned char *)buffer, copy_n); ret = buffer_len - h->ridx + copy_n;