Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd98711d

Browse files
committed
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.
1 parent970d8a3 commitd98711d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

‎src/backend/port/win32/crashdump.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,17 @@ crashDumpHandler(struct _EXCEPTION_POINTERS * pExceptionInfo)
135135

136136
systemTicks=GetTickCount();
137137
snprintf(dumpPath,_MAX_PATH,
138-
"crashdumps\\postgres-pid%0i-%0i.mdmp",selfPid,systemTicks);
138+
"crashdumps\\postgres-pid%0i-%0i.mdmp",
139+
(int)selfPid, (int)systemTicks);
139140
dumpPath[_MAX_PATH-1]='\0';
140141

141142
dumpFile=CreateFile(dumpPath,GENERIC_WRITE,FILE_SHARE_WRITE,
142143
NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,
143144
NULL);
144145
if (dumpFile==INVALID_HANDLE_VALUE)
145146
{
146-
write_stderr("could not open crash dump file %s for writing: error code %d\n",
147-
dumpPath,GetLastError());
147+
write_stderr("could not open crash dump file %s for writing: error code %u\n",
148+
dumpPath,(unsignedint)GetLastError());
148149
returnEXCEPTION_CONTINUE_SEARCH;
149150
}
150151

@@ -153,7 +154,7 @@ crashDumpHandler(struct _EXCEPTION_POINTERS * pExceptionInfo)
153154
write_stderr("wrote crash dump to %s\n",dumpPath);
154155
else
155156
write_stderr("could not write crash dump to %s: error code %08x\n",
156-
dumpPath,GetLastError());
157+
dumpPath,(unsignedint)GetLastError());
157158

158159
CloseHandle(dumpFile);
159160
}

‎src/backend/port/win32_latch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ WaitLatchOrSocket(volatile Latch *latch, SOCKET sock, bool forRead,
9494
DWORDrc;
9595
HANDLEevents[3];
9696
HANDLElatchevent;
97-
HANDLEsockevent;
97+
HANDLEsockevent=WSA_INVALID_EVENT;/* silence compiler */
9898
intnumevents;
9999
intresult=0;
100100

@@ -161,7 +161,7 @@ WaitLatchOrSocket(volatile Latch *latch, SOCKET sock, bool forRead,
161161
break;
162162
}
163163
elseif (rc!=WAIT_OBJECT_0)
164-
elog(ERROR,"unexpected return code from WaitForMultipleObjects(): %d",rc);
164+
elog(ERROR,"unexpected return code from WaitForMultipleObjects(): %d",(int)rc);
165165
}
166166

167167
/* Clean up the handle we created for the socket */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp