lib/tevent: remove spectacularly complicated manual subtraction
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 26 Aug 2009 08:00:32 +0000 (17:30 +0930)
committerAndrew Tridgell <tridge@samba.org>
Fri, 28 Aug 2009 03:08:01 +0000 (13:08 +1000)
commit4279879c9847ca069527e11ca934b8906009cad8
tree067e7c95487d27001ee554b4adcb2072bcc26956
parentcc248f7dfccf015586627ecef5fc5a475cc7f842
lib/tevent: remove spectacularly complicated manual subtraction

To be completely honest, I don't quite know whether to laugh or cry at
this one:

1 + (0xFFFFFFFF & ~(s.seen - s.count))
== 1 + (~(s.seen - s.count)) # s.seen, s.count are uint32_t
== s.count - s.seen # -A == ~A + 1

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/tevent/tevent_signal.c