]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: task: Fix a compiler warning by adding a cast.
authorDavid Carlier <devnexen@gmail.com>
Fri, 1 Jun 2018 12:32:39 +0000 (14:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Jun 2018 15:43:12 +0000 (17:43 +0200)
When calling HA_ATOMIC_CAS with a pointer as the target, the compiler
expects a pointer as the new value, so give it one by casting 0x1 to
(void *).

include/proto/task.h

index 760b368b57e44943398b2153c52b97bf260bb452..0c2c5f28cb3a4603aeb9176ca41df986f9cded14 100644 (file)
@@ -218,7 +218,7 @@ static inline void task_insert_into_tasklet_list(struct task *t)
         * another runqueue. We set leaf_p to 0x1 to indicate that the node is
         * not in a tree but that it's in the tasklet list. See task_in_rq().
         */
-       if (unlikely(!HA_ATOMIC_CAS(&t->rq.node.leaf_p, &expected, 0x1)))
+       if (unlikely(!HA_ATOMIC_CAS(&t->rq.node.leaf_p, &expected, (void *)0x1)))
                return;
        HA_ATOMIC_ADD(&tasks_run_queue, 1);
        task_list_size[tid]++;