On Tue, Nov 3, 2015 at 10:44 PM, Kenneth Graunke <kenn...@whitecape.org> wrote: > On Tuesday, November 03, 2015 10:20:26 PM Matt Turner wrote: >> On Tue, Nov 3, 2015 at 9:47 PM, Kenneth Graunke <kenn...@whitecape.org> >> wrote: >> > memmove(cur + 1, cur, >> > (annotation->ann_count - i + 2) * sizeof(struct >> > annotation)); >> > ann = cur; >> > ann->error = NULL; >> > ann->error_length = 0; >> > ann->block_end = NULL; >> > ann->offset = insertion_point; >> > annotation->ann_count++; >> > break; >> > } >> > } > > I still think my code is correct and easier to read...
I tried your code -- it's not correct -- it inserts the errors in the wrong place. The good news is that the misunderstanding in it reminded me why my code looks strange. To know whether an offset is in an annotation block, you have to check if it's before the next. And, to insert an error for a given instruction, that instruction must end the annotation block. I've simplified the code and made the cur/next names make sense in relation to the iteration variable i. I'll send v2 in reply. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev