Virtual ISO: Some more micro-optimizations

This commit is contained in:
RichardG867
2022-03-31 13:21:12 -03:00
parent 27a6ff7c20
commit 9ed01221c4

View File

@@ -400,8 +400,8 @@ viso_fill_dir_record(uint8_t *data, viso_entry_t *entry, int type)
memcpy(p, entry->name_short, *q); /* file ID */ memcpy(p, entry->name_short, *q); /* file ID */
p += *q; p += *q;
if (!S_ISDIR(entry->stats.st_mode)) { if (!S_ISDIR(entry->stats.st_mode)) {
memcpy(p, ";1", 2); /* version suffix for files */ *p++ = ';'; /* version suffix for files */
p += 2; *p++ = '1';
*q += 2; *q += 2;
} }
@@ -871,8 +871,7 @@ next_dir:
p += 128; p += 128;
viso_write_wstring((uint16_t *) p, L"", 64, VISO_CHARSET_A); /* data preparer ID */ viso_write_wstring((uint16_t *) p, L"", 64, VISO_CHARSET_A); /* data preparer ID */
p += 128; p += 128;
swprintf(wtemp, 64, L"%ls %ls VIRTUAL ISO", EMU_NAME_W, EMU_VERSION_W); viso_write_wstring((uint16_t *) p, EMU_NAME_W L" " EMU_VERSION_W L" VIRTUAL ISO", 64, VISO_CHARSET_A); /* application ID */
viso_write_wstring((uint16_t *) p, wtemp, 64, VISO_CHARSET_A); /* application ID */
p += 128; p += 128;
viso_write_wstring((uint16_t *) p, L"", 18, VISO_CHARSET_D); /* copyright file ID */ viso_write_wstring((uint16_t *) p, L"", 18, VISO_CHARSET_D); /* copyright file ID */
p += 37; p += 37;
@@ -887,8 +886,7 @@ next_dir:
p += 128; p += 128;
viso_write_string(p, "", 128, VISO_CHARSET_A); /* data preparer ID */ viso_write_string(p, "", 128, VISO_CHARSET_A); /* data preparer ID */
p += 128; p += 128;
snprintf((char *) p, 128, "%s %s VIRTUAL ISO", EMU_NAME, EMU_VERSION); viso_write_string(p, EMU_NAME " " EMU_VERSION " VIRTUAL ISO", 128, VISO_CHARSET_A); /* application ID */
viso_write_string(p, (char *) p, 128, VISO_CHARSET_A); /* application ID */
p += 128; p += 128;
viso_write_string(p, "", 37, VISO_CHARSET_D); /* copyright file ID */ viso_write_string(p, "", 37, VISO_CHARSET_D); /* copyright file ID */
p += 37; p += 37;