glsl: Fix the foreach_in_list_reverse macro.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 6 Jul 2014 05:04:45 +0000 (22:04 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 8 Jul 2014 19:31:01 +0000 (12:31 -0700)
commite13a6406c3d55162d6f4641f3ccca7635b9a5212
treec6585bc51d7825ae152cbeef5b97eebad453d07a
parentbe536efe20d7d0969e6d5286fc488fcc1c403b63
glsl: Fix the foreach_in_list_reverse macro.

We clearly don't want to start at the head and walk backwards; we want
to start at the last real element before the tail sentinel.  If the list
is empty, tail_pred will be the head sentinel, and we'll stop.

Nothing uses this function, so I guess nobody noticed it was broken.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/list.h