Sorry still does not seem to work :). Despite testing it on a setup in batman itself I also tested it with a small c program (which does not work as expected either): ----- #include <stdio.h> #include <stdint.h>
#define seq_before(x,y) ((x - y) > 1 << 7 + 8 * (sizeof(x) - 1)) #define seq_after(x,y) ((y - x) >= 1 << 7 + 8 * (sizeof(x) - 1))
int main() { uint8_t old = 0; uint8_t new = 1; if (!seq_after(new,old)) printf("foobar\n");
return 0; } ----- $ ./test foobar $
On Fri, Mar 12, 2010 at 12:04:47AM +0100, Sven Eckelmann wrote:
Sven Eckelmann wrote:
That must be #define seq_before(x,y) ((x - y) > 1 << 7 + 8 * (sizeof(x) - 1)) #define seq_after(x,y) ((y - x) > 1 << 7 + 8 * (sizeof(x) - 1))
Nearly correct but accidentally deleted a =
#define seq_before(x,y) ((x - y) > 1 << 7 + 8 * (sizeof(x) - 1)) #define seq_after(x,y) ((y - x) >= 1 << 7 + 8 * (sizeof(x) - 1))
Best regards, Sven