Some suggestions (I'll send a patch for them if you consider them a good idea)
These days I've been working on implementing several GObjects in a project, and stumbled with several details.
The first one is that g_object_ref()
expects a non-NULL pointer, which means that if a parameter can be NULL, it requires a previous if
to ensure that, in that case, no error is shown on screen. Is there a reason to not allow a NULL value in g_object_ref()
?
Also, I found that there are two styles for checking if a pointer is NULL: either if (xxx == NULL)
or if (xxx)
(and the equivalent for not NULL: if (xxx != NULL)
or if (!xxx)
) and using one or another is project-dependant, which means that you have to check which one is used in each project to decide which to use. So... What about adding to gmacros.h ...?
#define IS_NULL(p) (p == NULL)
#define NOT_NULL(p) (p != NULL)
That would allow to easily unify styles...