Re: [AD] bugfix in floodfill()

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


Eric Botcazou wrote:
But it does make sense for lpos, rpos and y, in case someone floodfills
really big bitmaps (but note that in general, we assume bitmaps can be
addressed with fixed point coordinates, i.e., <32768). In floodfill it can't hurt supporting up to 65535-sized bitmaps, so I attach an updated
patch.

Yes, but coordinates are signed for Allegro and this would not really buy us anything so I think we should keep signed shorts.

It buys us that floodfill works with bitmaps with 32768<=width<65536 or 32768<=height<65536. Probably most other functions work with such bitmaps. And it doesn't un-buy us anything, anyway.

Sorry, what should be ASSERTed and where is the critical point?

The index wrapping around and the place in the code where this may happen.

Oh, but now that we have int's, this can't happen: the int is an array index, and the language guarantees that no array is so big that an int can't index it.

--
Sven





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