From: Toni Wilen Date: Wed, 19 Jul 2017 12:14:20 +0000 (+0300) Subject: Small fixes and cleanups. X-Git-Tag: 3600~152 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=e58c3d484b770d13e6b9f2e46cba43047abcd574;p=francis%2Fwinuae.git Small fixes and cleanups. --- diff --git a/cfgfile.cpp b/cfgfile.cpp index 771f2f04..3f04c548 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -4462,11 +4462,18 @@ static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, int type, TCHA uci.physical_geometry = false; } if (tmpp2[0]) { - n = cfgfile_unescape (tmpp2, &end, 0); - if (!n) - goto invalid_fs; - _tcscpy(uci.geometry, n); - xfree(n); + if (tmpp2[0] == '\"') { + n = cfgfile_unescape (tmpp2, &end, 0); + if (!n) + goto invalid_fs; + _tcscpy(uci.geometry, n); + xfree(n); + } else { + tmpp = _tcschr (tmpp2, ','); + if (tmpp) + *tmpp++ = 0; + _tcscpy (uci.geometry, tmpp2); + } } } } diff --git a/custom.cpp b/custom.cpp index 4e6dc89d..fd1ca75d 100644 --- a/custom.cpp +++ b/custom.cpp @@ -735,7 +735,7 @@ static void reset_dbplh_all (int hpos) reset_dbplh(hpos, num); } dbplpth_on2 = 0; - } + } } static void reset_dbpll (int hpos, int num) @@ -754,7 +754,7 @@ static void reset_dbpll_all (int hpos) reset_dbpll(hpos, num); } dbplptl_on2 = 0; - } + } } #endif diff --git a/expansion.cpp b/expansion.cpp index 94c51a35..b02fa187 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -4577,7 +4577,7 @@ const struct expansionromtype expansionroms[] = { }, { _T("comspec1000"), _T("SA-1000"), _T("Comspec"), - NULL, comspec_init, NULL, comspec_add_scsi_unit, ROMTYPE_COMSPEC, 0, 0, BOARD_AUTOCONFIG_Z2, true, + comspec_preinit, comspec_init, NULL, comspec_add_scsi_unit, ROMTYPE_COMSPEC, 0, 0, BOARD_AUTOCONFIG_Z2, true, NULL, 0, true, EXPANSIONTYPE_SCSI, 0, 0, 0, false, NULL, diff --git a/ide.cpp b/ide.cpp index 8d0c8f7d..099a6b08 100644 --- a/ide.cpp +++ b/ide.cpp @@ -72,7 +72,7 @@ void ata_parse_identity(uae_u8 *out, struct uaedev_config_info *uci, bool *lba48 v = (out[59 * 2 + 0] << 8) | (out[59 * 2 + 1] << 0); if (v & 1) { // multiple mode? - *max_multiple = (out[47 * 2 + 0] << 8) | (out[47 * 2 + 1] << 0); + *max_multiple = ((out[47 * 2 + 0] << 8) | (out[47 * 2 + 1] << 0)) & 0xff; } v = (out[53 * 2 + 0] << 8) | (out[53 * 2 + 1] << 0); @@ -463,7 +463,7 @@ static void ide_identity_buffer(struct ide_hdf *ide) if (ata_get_identity(ide->hdhfd.hfd.geometry, ide->secbuf, true)) { - if (ide->byteswap) + if (!ide->byteswap) ata_byteswapidentity(ide->secbuf); } else { diff --git a/ini.cpp b/ini.cpp index b2b1b2fb..c190e0ce 100644 --- a/ini.cpp +++ b/ini.cpp @@ -199,7 +199,6 @@ struct ini_data *ini_load(const TCHAR *path) otxt = xrealloc(TCHAR, otxt, len); } _tcscat(otxt, s3); - xfree(s3); s3 = NULL; if (!nl) break; diff --git a/newcpu.cpp b/newcpu.cpp index dc41d9dc..9cd43348 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -6178,7 +6178,7 @@ static int asm_parse_mode(TCHAR *s, uae_u8 *reg, uae_u32 *v, uae_u16 *ext) if (endptr == startptr || endptr[0] != ',') return -1; s2 = endptr + 1; - } else if ((asm_isareg(s + 1) >= 0 || asm_ispc(s + 1)) && s[3] == ',' || (asm_isdreg(s + 4) >= 0 || asm_isareg(s + 4) >= 0)) { + } else if (((asm_isareg(s + 1) >= 0 || asm_ispc(s + 1)) && s[3] == ',') || (asm_isdreg(s + 4) >= 0 || asm_isareg(s + 4) >= 0)) { if (dots != 1) return -1; s2 = s + 1; @@ -7110,9 +7110,11 @@ void m68k_dumpstate (uaecptr pc, uaecptr *nextpc) struct instr *dp; struct mnemolookup *lookup1, *lookup2; dp = table68k + regs.irc; - for (lookup1 = lookuptab; lookup1->mnemo != dp->mnemo; lookup1++); + for (lookup1 = lookuptab; lookup1->mnemo != dp->mnemo; lookup1++) + ; dp = table68k + regs.ir; - for (lookup2 = lookuptab; lookup2->mnemo != dp->mnemo; lookup2++); + for (lookup2 = lookuptab; lookup2->mnemo != dp->mnemo; lookup2++) + ; console_out_f (_T("Prefetch %04x (%s) %04x (%s) Chip latch %08X\n"), regs.irc, lookup1->name, regs.ir, lookup2->name, regs.chipset_latch_rw); } diff --git a/scsi.cpp b/scsi.cpp index 0364a560..79a540ec 100644 --- a/scsi.cpp +++ b/scsi.cpp @@ -4593,4 +4593,4 @@ bool addhard_init(struct autoconfig_info *aci) void addhard_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc) { generic_soft_scsi_add(ch, ci, rc, NCR5380_ADDHARD, 65536, 32768, ROMTYPE_ADDHARD); -} \ No newline at end of file +}