"\tself->type = $uct"."_NODE;\n";
$copyfunc{$typename} = "{\n" .
"\t$typename * new;\n" .
- "\tg_return_if_fail(self != NULL);\n" .
- "\tg_return_if_fail(self->type == $uct"."_NODE);\n" .
+ "\tg_return_val_if_fail(self != NULL, NULL);\n" .
+ "\tg_return_val_if_fail(self->type == $uct"."_NODE, NULL);\n" .
"\tnew = g_new0($typename, 1);\n" .
"\tnew->type = $uct"."_NODE;\n";
$freefunc{$typename} = "{\n\tg_return_if_fail(self != NULL);\n" .
print OUTC "Node * copy_node(Node *node)\n" .
"{\n" .
- "\tg_return_if_fail(node != NULL);\n" .
- "\tg_return_if_fail(node->type >= 0 && node->type < LAST_NODE_TYPE);\n" .
+ "\tg_return_val_if_fail(node != NULL, NULL);\n" .
+ "\tg_return_val_if_fail(node->type >= 0 && node->type < LAST_NODE_TYPE, NULL);\n" .
"\tswitch(node->type) {\n";
foreach $t (sort keys %typestruct) {
print OUTC "\tcase " . uc($t) . "_NODE: return (Node *)copy_" . lc($t) . " (($t *)node);\n";