History

gen_external.py : fix func_name to long_name resolving (example : aubio_pitch was getting functions like aubio_pitchyin)

Martin Hermant committed 9 years ago

Commit b1f93c41 parent 415e3601 file · +1 −2Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/lib/gen_external.py+1−2
@@ -152,7 +152,6 @@ def analyze_c_declarations(cpp_objects, c_declarations): · 151 unmodified lines
152152 lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []}
153153 lib[shortname]['longname'] = longname
154154 lib[shortname]['shortname'] = shortname
155− valid_funcname_part = ['_'+longname,longname+'_']
156155
157156 for fn in c_declarations:
158157 func_name = fn.split('(')[0].strip().split(' ')[1:]
@@ -160,7 +159,7 @@ def analyze_c_declarations(cpp_objects, c_declarations): · 1 unmodified line
160159 func_name = func_name[-1]
161160 else:
162161 raise NameError('Warning : error while parsing : unexpected line %s' % fn)
163− if any(x in func_name for x in valid_funcname_part):
162+ if func_name.startswith(longname + '_') or func_name.endswith(longname):
164163 # print "found", shortname, "in", fn
165164 if 'typedef struct ' in fn:
166165 lib[shortname]['struct'].append(fn)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t