Re: Re: [AD] About create_bitmap

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


On Thu, 2004-11-04 at 13:42 -0800, Chris wrote:
> > You can
> > never tell which functions are time critical enough to not have such a
> > check. blit() certainly wouldn't be affected by a single if. Allegro's
> > way was to use ASSERT for every parameter checking, which is a simple
> > and effective way in my opinion.
> 
> I agree, except where it creates inconsistencies. If a function has a
> way to fail (ie. return NULL with create_bitmap), and the docs don't
> specificly mention what parameters will cause a function to crash
> (negative or 0 size), it should cleanly fail. That's the whole reason
> for allowing functions to fail.. to inform the user/programmer that
> the request was invalid.
> 

Didn't look at it that way. I agree then, create_bitmap can as well do
the check and fail - and it will create no inconsistency, since it
already can fail.

-- 
Elias Pschernig





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