1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

Silence a few compiler warnings from gcc on MinGW.

Most of these cast DWORD to int or unsigned int for printf type handling.
This is safe even on 64 bit architectures because a DWORD is always 32 bits.

In one case a variable is initialised to keep the compiler happy.
This commit is contained in:
Andrew Dunstan
2011-04-23 18:10:23 -04:00
parent 970d8a3973
commit d98711dfef
2 changed files with 7 additions and 6 deletions

View File

@@ -135,7 +135,8 @@ crashDumpHandler(struct _EXCEPTION_POINTERS * pExceptionInfo)
systemTicks = GetTickCount();
snprintf(dumpPath, _MAX_PATH,
"crashdumps\\postgres-pid%0i-%0i.mdmp", selfPid, systemTicks);
"crashdumps\\postgres-pid%0i-%0i.mdmp",
(int) selfPid, (int) systemTicks);
dumpPath[_MAX_PATH - 1] = '\0';
dumpFile = CreateFile(dumpPath, GENERIC_WRITE, FILE_SHARE_WRITE,
@@ -143,8 +144,8 @@ crashDumpHandler(struct _EXCEPTION_POINTERS * pExceptionInfo)
NULL);
if (dumpFile == INVALID_HANDLE_VALUE)
{
write_stderr("could not open crash dump file %s for writing: error code %d\n",
dumpPath, GetLastError());
write_stderr("could not open crash dump file %s for writing: error code %u\n",
dumpPath, (unsigned int) GetLastError());
return EXCEPTION_CONTINUE_SEARCH;
}
@@ -153,7 +154,7 @@ crashDumpHandler(struct _EXCEPTION_POINTERS * pExceptionInfo)
write_stderr("wrote crash dump to %s\n", dumpPath);
else
write_stderr("could not write crash dump to %s: error code %08x\n",
dumpPath, GetLastError());
dumpPath, (unsigned int) GetLastError());
CloseHandle(dumpFile);
}