Skip to content

Commit 712b47f

Browse files
author
Paul Thompson
committed
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)) {
1 parent a6e27b1 commit 712b47f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

events/equeue/equeue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static inline int equeue_clampdiff(unsigned a, unsigned b) {
3737
// Increment the unique id in an event, hiding the event from cancel
3838
static inline void equeue_incid(equeue_t *q, struct equeue_event *e) {
3939
e->id += 1;
40-
if (!(e->id << q->npw2)) {
40+
if (0 == (e->id << q->npw2)) {
4141
e->id = 1;
4242
}
4343
}

0 commit comments

Comments
 (0)