Re: [AD] rotate.c hang fix

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Although I don't know any example where the bug occurs, I think I
> understand what the problem might be, and in this case I think your
> patch fixed it. Nice!

Great, because I personally don't really understand it :-)

> I attach another patch that does two things to rotate.c:
>
>   (1) It improves "safety" one step more: by moving the
> `if (l_bmp_x_rounded > r_bmp_x_rounded)' tests inside the loops, it
> guarantees that the loops never do more iterations than the width of the
> scanline. Although your patch already fixes the real problem, this makes
> the number of iterations independent of the precision of numbers, for
> sure. And it is easy to see that the new code does the same thing as the
> old.
>
>   (2) It replaces `while(){}' by `do{}while()'. This is clearly valid
> because the condition has already been tested. Although it's ridiculous
> as an optimization, I think it also serves as a clarification.
>
> Can I commit it?

Yes, both on mainline and branch.

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/