From e49a883d0997127cd3a0ad7e522666f30190e792 Mon Sep 17 00:00:00 2001 From: Andreas Rottmann Date: Thu, 26 Feb 2009 20:17:39 +0000 Subject: Bug 573306 – Relax callback grouping detection rules Make the callback grouping heuristic more lax: consider all pointer parameters ending in 'data' to be the user_data parameter (instead of requiring an exact 'user_data' name). Signed-off-by: Andreas Rottmann --- diff --git a/giscanner/transformer.py b/giscanner/transformer.py index eb76f83..8e3219a 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -237,7 +237,7 @@ class Transformer(object): def _handle_closure(self, param, closure_idx, closure_param): if (closure_param.type.name == 'any' and - closure_param.name == 'user_data'): + closure_param.name.endswith('data')): param.closure_name = closure_param.name param.closure_index = closure_idx return True @@ -261,9 +261,9 @@ class Transformer(object): # group with the callback param j = i + 1 if j == len(params): - continue # no more args -> nothing to group look - # at the param directly following for either a closure - # or a destroy; only one of these will fire + continue # no more args -> nothing to group + # look at the param directly following for either a + # closure or a destroy; only one of these will fire had_closure = self._handle_closure(param, j, params[j]) had_destroy = self._handle_destroy(param, j, params[j]) j += 1 -- cgit v0.9.1