On Mon, Apr 17, 2006 at 10:30:57AM -0500, Aaron Spike wrote:
bulia byak wrote:
On 4/17/06, Aaron Spike <aaron@...749...> wrote:
bulia byak wrote:
if (!dt) return;
Please contrast the above with "g_return_if_fail(!dt);".
If there's a difference in behavior, I don't know about it.
Well I think I have the condition flipped, but... :-)
I'm wondering if g_return_if_fail() should be avoided because it is a glib thing. Like I've been told to use regular bool rather than gboolean types. It doesn't seem to save any key strokes either.
In code which doesn't otherwise use any gtk or glib functionality, it'd make sense to not use this. On the other hand, if the code is heavy with gtk calls, like the UI code often is, then it doesn't seem like it'd hurt to use the glib style.
The important thing is to be consistent; e.g., all files implementing, say, dialogs really ought to use just one approach or the other, and use it consistently throughout.
Bryce