version 1.8, 2014/07/20 08:12:46 |
version 1.9, 2014/07/20 09:59:42 |
|
|
*/ |
*/ |
|
|
/* Internal macros */ |
/* Internal macros */ |
|
|
#if !defined(MIN) |
|
#define MIN(a,b) (((a)<(b))? (a):(b)) |
|
#endif /* !defined(MIN) */ |
|
|
|
#define ring_subtract(d,a,b) (((a)-(b) >= 0)? \ |
#define ring_subtract(d,a,b) (((a)-(b) >= 0)? \ |
(a)-(b): (((a)-(b))+(d)->size)) |
(a)-(b): (((a)-(b))+(d)->size)) |
|
|
|
|
int i; |
int i; |
|
|
while (count) { |
while (count) { |
i = MIN(count, ring_empty_consecutive(ring)); |
i = ring_empty_consecutive(ring); |
memmove(ring->supply, buffer, i); |
if (i > count) |
|
i = count; |
|
memcpy(ring->supply, buffer, i); |
ring_supplied(ring, i); |
ring_supplied(ring, i); |
count -= i; |
count -= i; |
buffer += i; |
buffer += i; |