Compare functions by function name first, only after by full declation

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2008-11-07 19:17:32 +00:00
1 parent aee8ad9721
commit 7d08ccf1c4
1 file changed
+6 -1
+6 -1
View File
@@ -1813,7 +1813,12 @@ pybindgen.settings.error_handler = ErrorHandler()
functions_to_scan.append(fun)
def fun_cmp(a, b):
return cmp(a.decl_string, b.decl_string)
name_cmp = cmp(a.name, b.name)
# if function names differ, compare by name, else compare by the full declaration
if name_cmp != 0:
return name_cmp
else:
return cmp(a.decl_string, b.decl_string)
functions_to_scan.sort(fun_cmp)
for fun in functions_to_scan: