From ef58ece498790df909d6dca3bfaab5ee2cd4edab Mon Sep 17 00:00:00 2001 From: Paul Thompson Date: Sun, 4 Mar 2018 12:44:21 -0800 Subject: [PATCH] Clarify intention between comparison to zero and the shift operation Building with (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 gives this warning ../events/equeue/equeue.c: In function 'equeue_incid': ../events/equeue/equeue.c:40:17: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context] if (!(e->id << q->npw2)) { --- events/equeue/equeue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/equeue/equeue.c b/events/equeue/equeue.c index 436b45c3eb..173a35db81 100644 --- a/events/equeue/equeue.c +++ b/events/equeue/equeue.c @@ -37,7 +37,7 @@ static inline int equeue_clampdiff(unsigned a, unsigned b) { // Increment the unique id in an event, hiding the event from cancel static inline void equeue_incid(equeue_t *q, struct equeue_event *e) { e->id += 1; - if (!(e->id << q->npw2)) { + if (0 == (e->id << q->npw2)) { e->id = 1; } }