Fixed all the warnings and reverted a change to 86box.c that was not supposed to be committed.

This commit is contained in:
OBattler
2025-06-24 05:13:05 +02:00
parent d5a8a65fdd
commit 6a8eaf507c
4 changed files with 16 additions and 13 deletions

View File

@@ -639,7 +639,7 @@ pc_show_usage(char *s)
ui_msgbox(MBX_ANSI | ((s == NULL) ? MBX_INFO : MBX_WARNING), p);
#else
if (s == NULL)
pclog(p);
pclog("%s", p);
else
ui_msgbox(MBX_ANSI | MBX_WARNING, p);
#endif
@@ -742,7 +742,11 @@ usage:
/* Using this variable for vm manager path
Temporary solution!*/
if ((c+1) == argc) goto usage;
strcpy(vmm_path, argv[++c]);
char *vp = argv[++c];
if ((strlen(vp) + 1) >= sizeof(vmm_path))
memcpy(vmm_path, vp, sizeof(vmm_path));
else
memcpy(vmm_path, vp, strlen(vp) + 1);
//#endif
} else if (!strcasecmp(argv[c], "--fullscreen") || !strcasecmp(argv[c], "-F")) {
start_in_fullscreen = 1;
@@ -1613,8 +1617,6 @@ pc_close(UNUSED(thread_t *ptr))
plat_mouse_capture(0);
warning("CS:EIP = %04X:%08X\n", CS, cpu_state.pc);
/* Close all the memory mappings. */
mem_close();

View File

@@ -776,8 +776,8 @@ plat_set_thread_name(void *thread, const char *name)
if (pSetThreadDescription) {
size_t len = strlen(name) + 1;
wchar_t wname[len + 1];
mbstowcs(wname, name, len);
wchar_t wname[2048];
mbstowcs(wname, name, (len >= 1024) ? 1024 : len);
pSetThreadDescription(thread ? (HANDLE) thread : GetCurrentThread(), wname);
}
#else

View File

@@ -236,7 +236,6 @@ VMManagerMain::shutdownForceButtonPressed() const
void
VMManagerMain::refresh()
{
bool running = selected_sysconfig->process->state() == QProcess::ProcessState::Running;
const auto current_index = ui->listView->currentIndex();
emit selectionChanged(current_index, selected_sysconfig->process->state());

View File

@@ -747,18 +747,20 @@ VMManagerSystem::setupVars() {
QStringList serialFinal;
QStringList lptFinal;
int portIndex = 0;
for(const auto &serialNum: serial_enabled) {
if (serial_enabled[portIndex]) {
while (true) {
if (serial_enabled[portIndex])
serialFinal.append(QString("COM%1").arg(portIndex + 1));
}
++portIndex;
if (portIndex == SERIAL_MAX)
break;
}
portIndex = 0;
for (const auto &lptNum: lpt_enabled) {
if (lpt_enabled[portIndex]) {
while (true) {
if (lpt_enabled[portIndex])
lptFinal.append(QString("LPT%1").arg(portIndex + 1));
}
++portIndex;
if (portIndex == PARALLEL_MAX)
break;
}
display_table[Display::Name::Serial] = serialFinal.empty() ? tr("None") : serialFinal.join(", ");
display_table[Display::Name::Parallel] = lptFinal.empty() ? tr("None") : lptFinal.join(", ");