Zitat von "Tor Lillqvist" <t...@iki.fi>:

>> The test
>>   if( template )
>> makes only sense, if you can be sure that uninitialzed values
>> will definitelky be NULL.
> You must have missed the g_return_val_if_fail (! template ||
> GIMP_IS_CONTEXT (template), NULL) .
> It checks if template is NULL or a pointer to a valid GimpContext. If
> template is some random non-NULL value, the test will fail and a
> warning message will be printed. Such warning messages indicate a
> programmer error and should be dealt with during development.

Nice to know, but I was talking on things like the *context
in that funcion.

Even only temporarily valies, if set to a certain value,
like 0 or NULL, will help in finding problems.

The mentioned function just was an example.

Uninitialzed values I see nearly everywhere in the code.

Dereferencing NULL is easy to find, because it crashes early.


Gimp-developer mailing list

Reply via email to