]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/blobdiff - src/fwp/fwp/lib/fwp/fwp_msgq.c
Get rid of the most of other warnings
[frescor/frsh-forb.git] / src / fwp / fwp / lib / fwp / fwp_msgq.c
index 1af89bdfe2e5363059f51308d96851629d570594..443aec04f9bcc3a9d9a7842119968a7772b8b29f 100644 (file)
@@ -89,7 +89,7 @@ int fwp_msgq_enqueue(struct fwp_msgq *msgq, struct fwp_msgb *msgb)
        /* depends on queuing policy specifies in endpoint */
        msgq->queue[msgq->in] = msgb;
        msgq->nr_pending++;
-       msgq->in = (++msgq->in) & (FWP_MSGQ_SIZE - 1);
+       msgq->in = (msgq->in + 1) & (FWP_MSGQ_SIZE - 1);
 
        sem_post(&msgq->msg_sem);
        /* release queue mutex */
@@ -116,7 +116,7 @@ struct fwp_msgb* fwp_msgq_dequeue(struct fwp_msgq *msgq)
        
        msgb = msgq->queue[msgq->out];
        msgq->nr_pending--;
-       msgq->out = (++msgq->out) & (FWP_MSGQ_SIZE - 1);
+       msgq->out = (msgq->out + 1) & (FWP_MSGQ_SIZE - 1);
        
        /* release queue mutex */
        pthread_mutex_unlock(&msgq->lock);
@@ -157,7 +157,7 @@ void fwp_msgq_dequeue_all(struct fwp_msgq *msgq)
        while (msgq->in != msgq->out){
                msgb = msgq->queue[msgq->out];
                msgq->nr_pending--;
-               msgq->out = (++msgq->out) & (FWP_MSGQ_SIZE - 1);
+               msgq->out = (msgq->out + 1) & (FWP_MSGQ_SIZE - 1);
                fwp_msgb_free(msgb);
        }