From b1f93c4f28870a164c7bd9c665b810b73d3e3e8a Mon Sep 17 00:00:00 2001 From: Martin Hermant Date: Mon, 29 May 2017 18:23:37 -0400 Subject: [PATCH] gen_external.py : fix func_name to long_name resolving (example : aubio_pitch was getting functions like aubio_pitchyin) --- python/lib/gen_external.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/lib/gen_external.py b/python/lib/gen_external.py index 1a81cc21..a953fad1 100644 --- a/python/lib/gen_external.py +++ b/python/lib/gen_external.py @@ -152,7 +152,6 @@ def analyze_c_declarations(cpp_objects, c_declarations): lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []} lib[shortname]['longname'] = longname lib[shortname]['shortname'] = shortname - valid_funcname_part = ['_'+longname,longname+'_'] for fn in c_declarations: func_name = fn.split('(')[0].strip().split(' ')[1:] @@ -160,7 +159,7 @@ def analyze_c_declarations(cpp_objects, c_declarations): func_name = func_name[-1] else: raise NameError('Warning : error while parsing : unexpected line %s' % fn) - if any(x in func_name for x in valid_funcname_part): + if func_name.startswith(longname + '_') or func_name.endswith(longname): # print "found", shortname, "in", fn if 'typedef struct ' in fn: lib[shortname]['struct'].append(fn) -- 2.11.0