Re: Shouldn't integer functions return -1 on error.



On Sat, Apr 12, 2003 at 01:40:26PM +1000, Jeff Franks wrote: 
> Given that zero is a valid value (e.g. when storing enum values) 
> wouldn't it be better for functions returning an integer to return -1 on 
> error, rather than zero. That way, if you only want to know whether a 
> value has been previously set or not, you can check for -1.

How does -1 help? -1 is also a valid integer value.

If you want to handle "this value is not set", you have to 
use gconf_client_get() (which returns NULL for unset).

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]