sel/bres.c: Rewrite list hacking to avoid strict-aliasing badness.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 19 Jun 2013 00:35:21 +0000 (01:35 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 28 Jun 2013 22:24:18 +0000 (23:24 +0100)
commitffb41122634402c842ffea1b323e9f166b2bcfa7
tree124f0fb786d07f03c9825bd67e89566624b1b1f3
parentf533eb38d67ad4d1d3359db6f03bc7fe2733c930
sel/bres.c: Rewrite list hacking to avoid strict-aliasing badness.

The circular list stuff was quite pretty but involved some really
unpleasant casting which modern GCC (quite properly) complains about
vociferously.

Replace it with more traditional doubly-linked-list hacking with
null-pointer sentinels, with the slightly nasty pointer swizzling tucked
away in useful macros.  Some of the uses of these macros (e.g.,
unlinking the first or last item in a list) could be made more efficient
by using special-case versions, but it doesn't seem worthwhile.
sel/bres.c