Use std::sort instead of qsort in minsyms.c
This has better typesafety and is also marginally faster (either
due to inlining or because it avoids indirection through a
function pointer).
Note that in this change:
- return 1; /* fn1 has no name, so it is "less". */
+ return true; /* fn1 has no name, so it is "less". */
else if (name1) /* fn2 has no name, so it is "less". */
- return -1;
+ return false;
I am fairly sure the old code was wrong (ie. code didn't match the
comment and the comment seemed correct), so I fixed it.
gdb/ChangeLog:
2019-09-28 Christian Biesinger <cbiesinger@google.com>
* minsyms.c (compare_minimal_symbols): Rename to...
(minimal_symbol_is_less_than): ...this, and adjust to STL
conventions (return bool, take arguments as references)
(minimal_symbol_reader::install): Call std::sort instead
of qsort.