mirror of
https://github.com/86Box/86Box.git
synced 2026-02-21 17:15:32 -07:00
Get rid of machine_get_machine_from_internal_name_ex
This commit is contained in:
15
src/config.c
15
src/config.c
@@ -349,16 +349,21 @@ load_machine(void)
|
||||
for (i = 0; machine_migrations[i].old; i++) {
|
||||
if (!strcmp(p, machine_migrations[i].old)) {
|
||||
machine = machine_get_machine_from_internal_name(machine_migrations[i].new);
|
||||
migrate_from = p;
|
||||
if (machine_migrations[i].new_bios) {
|
||||
migration_cat = ini_find_or_create_section(config, machine_get_device(machine)->name);
|
||||
ini_section_set_string(migration_cat, "bios", machine_migrations[i].new_bios);
|
||||
if (machine != -1) {
|
||||
migrate_from = p;
|
||||
if (machine_migrations[i].new_bios) {
|
||||
migration_cat = ini_find_or_create_section(config, machine_get_device(machine)->name);
|
||||
ini_section_set_string(migration_cat, "bios", machine_migrations[i].new_bios);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!migrate_from)
|
||||
if (!migrate_from) {
|
||||
machine = machine_get_machine_from_internal_name(p);
|
||||
if (machine == -1)
|
||||
machine = 0;
|
||||
}
|
||||
} else {
|
||||
machine = 0;
|
||||
}
|
||||
|
||||
@@ -391,7 +391,6 @@ extern const char * machine_getname(int m);
|
||||
extern const char * machine_get_internal_name(void);
|
||||
extern const char * machine_get_nvr_name(void);
|
||||
extern int machine_get_machine_from_internal_name(const char *s);
|
||||
extern int machine_get_machine_from_internal_name_ex(const char *s); /* returns -1 if internal name does not exist. */
|
||||
extern void machine_init(void);
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t *machine_get_kbc_device(int m);
|
||||
|
||||
@@ -20700,21 +20700,6 @@ machine_get_machine_from_internal_name(const char *s)
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_get_machine_from_internal_name_ex(const char *s)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (machines[c].init != NULL) {
|
||||
if (!strcmp(machines[c].internal_name, s))
|
||||
return c;
|
||||
c++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ VMManagerSystem::setupVars()
|
||||
auto machine_name = QString();
|
||||
int i = 0;
|
||||
int ram_granularity = 0;
|
||||
int ci = machine_get_machine_from_internal_name_ex(machine_config["machine"].toUtf8());
|
||||
int ci = machine_get_machine_from_internal_name(machine_config["machine"].toUtf8());
|
||||
// Machine
|
||||
if (ci != -1 && machine_available(ci)) {
|
||||
machine_name = machines[ci].name;
|
||||
|
||||
Reference in New Issue
Block a user