From 314f411b13588207d6f8bceadc2d3121b5a8b6e6 Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 16 Feb 2019 21:27:06 -0500 Subject: Eliminate qsort usage in debugger (nw) --- src/emu/debug/debugcmd.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/emu/debug/debugcmd.cpp') 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 +#include #include @@ -3215,13 +3216,6 @@ void debugger_commands::execute_memdump(int ref, const std::vector 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 ¶ms) { device_t *cpu = nullptr; @@ -3257,7 +3251,9 @@ void debugger_commands::execute_symlist(int ref, const std::vector /* 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++) -- cgit v1.2.3