Re: [AD] rotate.c hang fix |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> 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.
Applied to mainline and branch.
--
Eric Botcazou