diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2011-04-23 18:10:23 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2011-04-23 18:10:23 -0400 |
commit | d98711dfef6ade6a26aa0f4c0a775087ed13e060 (patch) | |
tree | e119cafaf670df01add6f6840e97e71a51a94ab1 /src | |
parent | 970d8a39736fd67e3ebf406ed8129eed0767d15d (diff) | |
download | postgresql-d98711dfef6ade6a26aa0f4c0a775087ed13e060.tar.gz postgresql-d98711dfef6ade6a26aa0f4c0a775087ed13e060.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/port/win32/crashdump.c | 9 | ||||
-rw-r--r-- | src/backend/port/win32_latch.c | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/backend/port/win32/crashdump.c b/src/backend/port/win32/crashdump.c index 98bde14804e..89509990c52 100644 --- a/src/backend/port/win32/crashdump.c +++ b/src/backend/port/win32/crashdump.c @@ -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); } diff --git a/src/backend/port/win32_latch.c b/src/backend/port/win32_latch.c index b158300d572..3509302aaae 100644 --- a/src/backend/port/win32_latch.c +++ b/src/backend/port/win32_latch.c @@ -94,7 +94,7 @@ WaitLatchOrSocket(volatile Latch *latch, SOCKET sock, bool forRead, DWORD rc; HANDLE events[3]; HANDLE latchevent; - HANDLE sockevent; + HANDLE sockevent = WSA_INVALID_EVENT; /* silence compiler */ int numevents; int result = 0; @@ -161,7 +161,7 @@ WaitLatchOrSocket(volatile Latch *latch, SOCKET sock, bool forRead, break; } else if (rc != WAIT_OBJECT_0) - elog(ERROR, "unexpected return code from WaitForMultipleObjects(): %d", rc); + elog(ERROR, "unexpected return code from WaitForMultipleObjects(): %d", (int) rc); } /* Clean up the handle we created for the socket */ |