|Re: [AD] default values for get_desktop_resolution|
[ Thread Index |
| More lists.liballeg.org/allegro-developers Archives
- To: "Coordination of admins/developers of the game programming library Allegro" <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] default values for get_desktop_resolution
- From: "Matthew Leverton" <meffer@xxxxxxxxxx>
- Date: Sat, 28 Jul 2007 00:32:28 -0500
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
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.