lib/tevent: remove spectacularly complicated manual subtraction
commitce31ae860d25823f7b5b3140b74e8d83af9d6ed5
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 26 Aug 2009 08:00:32 +0000 (26 17:30 +0930)
committerKarolin Seeger <kseeger@samba.org>
Wed, 9 Sep 2009 10:45:07 +0000 (9 12:45 +0200)
tree20943ea0a08238a810a92732f8b9d388c81a589b
parent3dbdc27d14f159aa0db16615924a91efb960d951
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>
(cherry picked from commit 4279879c9847ca069527e11ca934b8906009cad8)
(cherry picked from commit fdcc157d51cce8561df37fa9eed39332772bacb9)
lib/tevent/tevent_signal.c