|
From: | Bill Auerbach |
Subject: | RE: [lwip-users] Strange "always true" conditional in tcp_in.c |
Date: | Mon, 1 Mar 2010 10:13:23 -0500 |
The macro below would be computed at compile time - there is no overhead in this implementation which is why I thought it to be better than the previous suggestion which used a variable. It could be more generic: #define max_unsigned since it can be used in all unsigned overflow checks. Bill >#define max_dup_acks(size) (size == 1 ? 0xffu : size == 2 ? 0xffffu : >0xfffffffful) > >if (pcb->dupacks != max_dup_acks(sizeof pcb->dupacks)) > ++pcb->dupacks;
[Prev in Thread] | Current Thread | [Next in Thread] |