From b63bc73b93255d27e784e5e1dbf99fa4e1dae76b Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 26 Aug 2009 15:14:48 +0000 Subject: XML: remove all useless instance_init functions * Use Coccinelle semantic patch tool (http://coccinelle.lip6.fr/) to remove useless instance_init functions, the first patch applied was: @@ type T,V; identifier I, J; parameter list P; expression E1; @@ V instance_init(T node) { <... ( - E1 = 0; | - E1 = NULL; | - E1 = FALSE; ) ...> } It removes useless initialization to 0 (GObject already zeroes allocated objects). The second one is: @ rule1 @ type T; identifier node,fn; @@ - static void fn(T *node) { } @ rule2 extends rule1 @ typedef GType, GInstanceInitFunc; identifier type_constructor; @@ GType type_constructor() { <... - (GInstanceInitFunc)fn + NULL ...> } It removes empty instance_init functions. --- lasso/xml/dst_query_response.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'lasso/xml/dst_query_response.c') diff --git a/lasso/xml/dst_query_response.c b/lasso/xml/dst_query_response.c index 3a4e47f9..1282e971 100644 --- a/lasso/xml/dst_query_response.c +++ b/lasso/xml/dst_query_response.c @@ -126,20 +126,6 @@ init_from_xml(LassoNode *node, xmlNode *xmlnode) /* instance and class init functions */ /*****************************************************************************/ -static void -instance_init(LassoDstQueryResponse *node) -{ - node->Status = NULL; - node->Data = NULL; - node->Extension = NULL; - - node->id = NULL; - node->itemIDRef = NULL; - node->timeStamp = NULL; - - node->prefixServiceType = NULL; - node->hrefServiceType = NULL; -} static void class_init(LassoDstQueryResponseClass *klass) @@ -169,7 +155,7 @@ lasso_dst_query_response_get_type() NULL, sizeof(LassoDstQueryResponse), 0, - (GInstanceInitFunc) instance_init, + NULL, NULL }; -- cgit