Skip to content

Commit ca350d6

Browse files
committed
mingw: squash another warning about a cast
MSys2's compiler is correct that casting a "void *" to a "DWORD" loses precision, but in the case of pthread_exit() we know that the value fits into a DWORD. Just like casting handles to DWORDs, let's work around this issue by casting to "intrptr_t" first, and immediately cast to the final type. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9f932b9 commit ca350d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/win32/pthread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extern pthread_t pthread_self(void);
7777

7878
static inline int pthread_exit(void *ret)
7979
{
80-
ExitThread((DWORD)ret);
80+
ExitThread((DWORD)(intptr_t)ret);
8181
}
8282

8383
typedef DWORD pthread_key_t;

0 commit comments

Comments
 (0)