From ab5df882e9ee017192273d919228fa0ab2f1bf4a Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 8 Jul 2020 04:28:44 +0200 Subject: [PATCH] Fixed the default values for serial ports 3 and 4 enable, and fix a warning in config.c. --- src/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.c b/src/config.c index 3e8f304f4..bbc672935 100644 --- a/src/config.c +++ b/src/config.c @@ -747,7 +747,7 @@ load_ports(void) for (c = 0; c < 4; c++) { sprintf(temp, "serial%d_enabled", c + 1); - serial_enabled[c] = !!config_get_int(cat, temp, 1); + serial_enabled[c] = !!config_get_int(cat, temp, (c >= 2) ? 0 : 1); } for (c = 0; c < 3; c++) { @@ -1523,7 +1523,7 @@ save_machine(void) if (fpu_type == 0) config_delete_var(cat, "fpu_type"); else - config_set_string(cat, "fpu_type", fpu_get_internal_name(machine, cpu_manufacturer, cpu, fpu_type)); + config_set_string(cat, "fpu_type", (char *) fpu_get_internal_name(machine, cpu_manufacturer, cpu, fpu_type)); if (mem_size == 4096) config_delete_var(cat, "mem_size"); @@ -1713,7 +1713,7 @@ save_ports(void) for (c = 0; c < 4; c++) { sprintf(temp, "serial%d_enabled", c + 1); - if (serial_enabled[c]) + if (((c < 2) && serial_enabled[c]) || ((c >= 2) && !serial_enabled[c])) config_delete_var(cat, temp); else config_set_int(cat, temp, serial_enabled[c]);