quiet a couple of Windows warnings

This commit is contained in:
nhmall
2023-09-21 16:31:34 -04:00
parent b6c942d062
commit 61cc98af3c
+11 -6
View File
@@ -160,10 +160,15 @@ get_known_folder_path(
void void
create_directory(const char * path) create_directory(const char * path)
{ {
HRESULT hr = CreateDirectoryA(path, NULL);
if (FAILED(hr) && hr != ERROR_ALREADY_EXISTS) BOOL dres = CreateDirectoryA(path, NULL);
error("Unable to create directory '%s'", path);
if (!dres) {
DWORD dw = GetLastError();
if (dw != ERROR_ALREADY_EXISTS)
error("Unable to create directory '%s'", path);
}
} }
RESTORE_WARNING_UNREACHABLE_CODE RESTORE_WARNING_UNREACHABLE_CODE
@@ -697,7 +702,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
raw_print("Cannot create lock file"); raw_print("Cannot create lock file");
} else { } else {
gh.hackpid = GetCurrentProcessId(); gh.hackpid = GetCurrentProcessId();
write(nhfp->fd, (genericptr_t) &gh.hackpid, sizeof(gh.hackpid)); (void) write(nhfp->fd, (genericptr_t) &gh.hackpid, sizeof(gh.hackpid));
close_nhfile(nhfp); close_nhfile(nhfp);
} }
/* /*
@@ -1058,8 +1063,8 @@ fakeconsole(void)
AllocConsole(); AllocConsole();
AttachConsole(GetCurrentProcessId()); AttachConsole(GetCurrentProcessId());
/* rval = SetStdHandle(STD_OUTPUT_HANDLE, hWrite); */ /* rval = SetStdHandle(STD_OUTPUT_HANDLE, hWrite); */
freopen("CON", "w", stdout); (void) freopen("CON", "w", stdout);
freopen("CON", "r", stdin); (void) freopen("CON", "r", stdin);
} }
has_fakeconsole = TRUE; has_fakeconsole = TRUE;
} }