mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Revert "Fix broken listdevices sorting (nw)"
This reverts commit 7218ceee7b
.
This commit is contained in:
parent
a62e7d8565
commit
122a16c690
@ -27,7 +27,6 @@
|
||||
#include "osdepend.h"
|
||||
#include "softlist.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <new>
|
||||
#include <ctype.h>
|
||||
|
||||
@ -550,6 +549,13 @@ void cli_frontend::listsamples(const char *gamename)
|
||||
// referenced by a given game or set of games
|
||||
//-------------------------------------------------
|
||||
|
||||
int cli_frontend::compare_devices(const void *i1, const void *i2)
|
||||
{
|
||||
device_t *dev1 = *(device_t **)i1;
|
||||
device_t *dev2 = *(device_t **)i2;
|
||||
return dev1->tag()!=dev2->tag();
|
||||
}
|
||||
|
||||
void cli_frontend::listdevices(const char *gamename)
|
||||
{
|
||||
// determine which drivers to output; return an error if none found
|
||||
@ -574,12 +580,10 @@ void cli_frontend::listdevices(const char *gamename)
|
||||
device_list.push_back(device);
|
||||
|
||||
// sort them by tag
|
||||
std::sort(device_list.begin(), device_list.end(), [](device_t *dev1, device_t *dev2) {
|
||||
return dev1->tag() < dev2->tag();
|
||||
});
|
||||
qsort(&device_list[0], device_list.size(), sizeof(device_list[0]), compare_devices);
|
||||
|
||||
// dump the results
|
||||
for (device_t *device : device_list)
|
||||
for (auto device : device_list)
|
||||
{
|
||||
// extract the tag, stripping the leading colon
|
||||
std::string tag = device->tag();
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
void listcrc(const char *gamename = "*");
|
||||
void listroms(const char *gamename = "*");
|
||||
void listsamples(const char *gamename = "*");
|
||||
static int compare_devices(const void *i1, const void *i2);
|
||||
void listdevices(const char *gamename = "*");
|
||||
void listslots(const char *gamename = "*");
|
||||
void listmedia(const char *gamename = "*");
|
||||
|
Loading…
Reference in New Issue
Block a user