On Tue, Dec 16, 2014 at 2:49 PM, Connor Abbott <cwabbo...@gmail.com> wrote: > > On Tue, Dec 16, 2014 at 1:05 AM, Jason Ekstrand <ja...@jlekstrand.net> > wrote: > > Some time while refactoring things to make it look nicer before pushing > to > > master, I completely broke the function. This fixes it to be correct. > > Just goes to show you why you souldn't push code that has no users yet... > > > > Signed-off-by: Jason Ekstrand <jason.ekstr...@intel.com> > > --- > > src/glsl/list.h | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/src/glsl/list.h b/src/glsl/list.h > > index 924c729..4774ccc 100644 > > --- a/src/glsl/list.h > > +++ b/src/glsl/list.h > > @@ -534,9 +534,7 @@ exec_list_validate(const struct exec_list *list) > > * either require C++ or assume the exec_node is embedded in a > structure > > * which is not the case for this function. > > */ > > - for (node = exec_list_get_head_const(list); > > - !exec_node_is_tail_sentinel(node); > > - node = exec_node_get_next_const(node)) { > > + for (node = list->head; node->next != NULL; node = node->next) { > > assert(node->next->prev == node); > > assert(node->prev->next == node); > > } > > -- > > 2.2.0 > > > > _______________________________________________ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > > Just curious before I put a r-b on this, what exactly was broken about it? >
I should probably have said this in the commit message, but the list_get_head and get_next return null if it's empty or you're at the end. Yes, I could have used them and tweaked it differently, but I figured consistency was probably better. --Jason
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev