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)) {
pull/6263/head
Paul Thompson 2018-03-04 12:44:21 -08:00
parent a6e27b1b86
commit 712b47f3c1
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}
}