diff options
author | 2019-02-16 21:27:06 -0500 | |
---|---|---|
committer | 2019-02-16 21:27:06 -0500 | |
commit | 314f411b13588207d6f8bceadc2d3121b5a8b6e6 (patch) | |
tree | 8818eb03c1e92d06c4c2adc3f7d242973de456d4 /src/emu/debug/debugcmd.cpp | |
parent | 9f7c4385a85806b510ab6a4d62bc60f433af8fe1 (diff) |
Eliminate qsort usage in debugger (nw)
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
-rw-r--r-- | src/emu/debug/debugcmd.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 05fb6acbddd..7f650a2e356 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -21,6 +21,7 @@ #include "natkeyboard.h" #include "render.h" #include <ctype.h> +#include <algorithm> #include <fstream> @@ -3215,13 +3216,6 @@ void debugger_commands::execute_memdump(int ref, const std::vector<std::string> execute_symlist - execute the symlist command -------------------------------------------------*/ -static int CLIB_DECL symbol_sort_compare(const void *item1, const void *item2) -{ - const char *str1 = *(const char **)item1; - const char *str2 = *(const char **)item2; - return strcmp(str1, str2); -} - void debugger_commands::execute_symlist(int ref, const std::vector<std::string> ¶ms) { device_t *cpu = nullptr; @@ -3257,7 +3251,9 @@ void debugger_commands::execute_symlist(int ref, const std::vector<std::string> /* sort the symbols */ if (count > 1) - qsort((void *)namelist, count, sizeof(namelist[0]), symbol_sort_compare); + std::sort(&namelist[0], &namelist[count], [](const char *item1, const char *item2) { + return strcmp(item1, item2) < 0; + }); /* iterate over symbols and print out relevant ones */ for (symnum = 0; symnum < count; symnum++) |