mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 20:35:49 +01:00
Fix signedness warnings in glib/gpoll.c
glib/gpoll.c: In function 'poll_rest': ../glib/gpoll.c:165:22: warning: comparison of integer expressions of different signedness: 'gint' {aka 'int'} and 'unsigned int' if (timeout_ms == INFINITE) ^~ glib/gpoll.c:219:18: warning: comparison of unsigned expression >= 0 is always true else if (ready >= WAIT_OBJECT_0 && ready < WAIT_OBJECT_0 + nhandles) ^~ glib/gpoll.c: In function 'poll_single_thread': glib/gpoll.c:281:44: warning: comparison of integer expressions of different signedness: 'gint' {aka 'int'} and 'unsigned int' if (retval == 0 && (data->timeout_ms == INFINITE || data->timeout_ms > 0)) ^~ glib/gpoll.c: In function 'g_poll': glib/gpoll.c:477:52: warning: comparison of integer expressions of different signedness: 'DWORD' {aka 'long unsigned int'} and 'int' retval = retval == -1 ? -1 : thread_retval == -1 ? -1 : retval + thread_retval; ^~ glib/gpoll.c:477:60: warning: operand of ?: changes signedness from 'int' to 'long unsigned int' due to unsignedness of other operand retval = retval == -1 ? -1 : thread_retval == -1 ? -1 : retval + thread_retval; ^~ glib/gpoll.c:477:33: warning: operand of ?: changes signedness from 'int' to 'long unsigned int' due to unsignedness of other operand retval = retval == -1 ? -1 : thread_retval == -1 ? -1 : retval + thread_retval; ^~
This commit is contained in:
parent
d16d780bf4
commit
b89967a14d
14
glib/gpoll.c
14
glib/gpoll.c
@ -135,7 +135,7 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
HANDLE *handles,
|
HANDLE *handles,
|
||||||
GPollFD *handle_to_fd[],
|
GPollFD *handle_to_fd[],
|
||||||
gint nhandles,
|
gint nhandles,
|
||||||
gint timeout_ms)
|
DWORD timeout_ms)
|
||||||
{
|
{
|
||||||
DWORD ready;
|
DWORD ready;
|
||||||
GPollFD *f;
|
GPollFD *f;
|
||||||
@ -147,7 +147,7 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
* -> Use MsgWaitForMultipleObjectsEx
|
* -> Use MsgWaitForMultipleObjectsEx
|
||||||
*/
|
*/
|
||||||
if (_g_main_poll_debug)
|
if (_g_main_poll_debug)
|
||||||
g_print (" MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout_ms);
|
g_print (" MsgWaitForMultipleObjectsEx(%d, %lu)\n", nhandles, timeout_ms);
|
||||||
|
|
||||||
ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout_ms,
|
ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout_ms,
|
||||||
QS_ALLINPUT, MWMO_ALERTABLE);
|
QS_ALLINPUT, MWMO_ALERTABLE);
|
||||||
@ -177,7 +177,7 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
* -> Use WaitForMultipleObjectsEx
|
* -> Use WaitForMultipleObjectsEx
|
||||||
*/
|
*/
|
||||||
if (_g_main_poll_debug)
|
if (_g_main_poll_debug)
|
||||||
g_print (" WaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout_ms);
|
g_print (" WaitForMultipleObjectsEx(%d, %lu)\n", nhandles, timeout_ms);
|
||||||
|
|
||||||
ready = WaitForMultipleObjectsEx (nhandles, handles, FALSE, timeout_ms, TRUE);
|
ready = WaitForMultipleObjectsEx (nhandles, handles, FALSE, timeout_ms, TRUE);
|
||||||
if (ready == WAIT_FAILED)
|
if (ready == WAIT_FAILED)
|
||||||
@ -216,7 +216,7 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
recursed_result = poll_rest (NULL, stop_fd, handles, handle_to_fd, nhandles, 0);
|
recursed_result = poll_rest (NULL, stop_fd, handles, handle_to_fd, nhandles, 0);
|
||||||
return (recursed_result == -1) ? -1 : 1 + recursed_result;
|
return (recursed_result == -1) ? -1 : 1 + recursed_result;
|
||||||
}
|
}
|
||||||
else if (ready >= WAIT_OBJECT_0 && ready < WAIT_OBJECT_0 + nhandles)
|
else if (ready < WAIT_OBJECT_0 + nhandles)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ typedef struct
|
|||||||
GPollFD *msg_fd;
|
GPollFD *msg_fd;
|
||||||
GPollFD *stop_fd;
|
GPollFD *stop_fd;
|
||||||
gint nhandles;
|
gint nhandles;
|
||||||
gint timeout_ms;
|
DWORD timeout_ms;
|
||||||
} GWin32PollThreadData;
|
} GWin32PollThreadData;
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
@ -295,7 +295,7 @@ poll_single_thread (GWin32PollThreadData *data)
|
|||||||
static void
|
static void
|
||||||
fill_poll_thread_data (GPollFD *fds,
|
fill_poll_thread_data (GPollFD *fds,
|
||||||
guint nfds,
|
guint nfds,
|
||||||
gint timeout_ms,
|
DWORD timeout_ms,
|
||||||
GPollFD *stop_fd,
|
GPollFD *stop_fd,
|
||||||
GWin32PollThreadData *data)
|
GWin32PollThreadData *data)
|
||||||
{
|
{
|
||||||
@ -474,7 +474,7 @@ g_poll (GPollFD *fds,
|
|||||||
for (i = 0; i < nthreads; i++)
|
for (i = 0; i < nthreads; i++)
|
||||||
{
|
{
|
||||||
if (GetExitCodeThread (thread_handles[i], &thread_retval))
|
if (GetExitCodeThread (thread_handles[i], &thread_retval))
|
||||||
retval = retval == -1 ? -1 : thread_retval == -1 ? -1 : retval + thread_retval;
|
retval = (retval == -1) ? -1 : ((thread_retval == (DWORD) -1) ? -1 : (int) (retval + thread_retval));
|
||||||
|
|
||||||
CloseHandle (thread_handles[i]);
|
CloseHandle (thread_handles[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user