Shouldn't integer functions return -1 on error.



Hi,

I noticed that gconf_client_get_int() returns zero if a key has no value set, or the subdirectory doesn't exist. This means the only way to check if a key has been previously set, say the first time an application runs, is with gconf_client_dir_exists(). I tried using GError but no error gets reported if a value has not been set for a key, or the key doesn't exist yet.

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.

Regards,
Jeff Franks.






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