summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c
index ba5bfa5..91aeff6 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -223,14 +223,14 @@ ssize_t iio_buffer_foreach_sample(struct iio_buffer *buffer,
break;
/* Test if the buffer has samples for this channel */
- if (!TEST_BIT(buffer->mask, chn->index))
+ if (!TEST_BIT(buffer->mask, chn->number))
continue;
if ((ptr - start) % length)
ptr += length - ((ptr - start) % length);
/* Test if the client wants samples from this channel */
- if (TEST_BIT(dev->mask, chn->index)) {
+ if (TEST_BIT(dev->mask, chn->number)) {
ssize_t ret = callback(chn,
(void *) ptr, length, d);
if (ret < 0)
@@ -272,7 +272,7 @@ void * iio_buffer_first(const struct iio_buffer *buffer,
break;
/* Test if the buffer has samples for this channel */
- if (!TEST_BIT(buffer->mask, cur->index))
+ if (!TEST_BIT(buffer->mask, cur->number))
continue;
/* Two channels with the same index use the same samples */