Browse Source

deps-libff: Fix sequence-point warning

Silly code that pre-incremented a value while also assigning
it to the same value.
kc5nra 10 years ago
parent
commit
94e58057fd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      deps/libff/libff/ff-circular-queue.c

+ 2 - 2
deps/libff/libff/ff-circular-queue.c

@@ -116,7 +116,7 @@ void *ff_circular_queue_peek_write(struct ff_circular_queue *cq)
 void ff_circular_queue_advance_write(struct ff_circular_queue *cq, void *item)
 {
 	cq->slots[cq->write_index] = item;
-	cq->write_index = ++cq->write_index % cq->capacity;
+	cq->write_index = (cq->write_index + 1) % cq->capacity;
 
 	queue_lock(cq);
 	++cq->size;
@@ -130,7 +130,7 @@ void *ff_circular_queue_peek_read(struct ff_circular_queue *cq)
 
 void ff_circular_queue_advance_read(struct ff_circular_queue *cq)
 {
-	cq->read_index = ++cq->read_index % cq->capacity;
+	cq->read_index = (cq->read_index + 1) % cq->capacity;
 	queue_lock(cq);
 	--cq->size;
 	queue_signal(cq);