Re: [AD] default values for get_desktop_resolution

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


On 7/28/07, Chris Robinson <chris.kcat@xxxxxxxxxx> wrote:
> I think a problem with that is it's interaction with things like valgrind.
> Setting 'int w = *width;' may complain that it's using uninitialized memory
> if the user hasn't initialized it yet, and then setting it back on failure
> won't cause an uninitialized memory warning if apps try to use it after
> failure.
>
There's no reason that the change has to be implemented like that. If
the system drivers are aware of the "don't modify unless successful,"
then the inline function wouldn't have to ever touch an uninitialized
value. Thus we could still guarantee that the passed parameters will
remain the same on failure by virtue of never changing them.

--
Matthew Leverton




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