mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
Merge branch 'fix_more_windows_warnings' into 'main'
Fix more windows warnings See merge request GNOME/glib!2303
This commit is contained in:
commit
9784f31527
@ -3138,7 +3138,7 @@ g_socket_get_available_bytes (GSocket *socket)
|
||||
* systems add internal header size to the reported size, making it
|
||||
* unusable for this function. */
|
||||
avail = recv (socket->priv->fd, buf, bufsize, MSG_PEEK);
|
||||
if (avail == -1)
|
||||
if ((gint) avail == -1)
|
||||
{
|
||||
int errsv = get_socket_errno ();
|
||||
#ifdef G_OS_WIN32
|
||||
@ -5275,7 +5275,7 @@ g_socket_send_messages_with_timeout (GSocket *socket,
|
||||
#else
|
||||
{
|
||||
gssize result;
|
||||
gint i;
|
||||
guint i;
|
||||
gint64 wait_timeout;
|
||||
|
||||
wait_timeout = timeout_us;
|
||||
@ -5305,7 +5305,11 @@ g_socket_send_messages_with_timeout (GSocket *socket,
|
||||
#endif
|
||||
}
|
||||
|
||||
result = pollable_result == G_POLLABLE_RETURN_OK ? bytes_written : -1;
|
||||
if (G_MAXSSIZE > bytes_written &&
|
||||
pollable_result == G_POLLABLE_RETURN_OK)
|
||||
result = (gssize) bytes_written;
|
||||
else
|
||||
result = -1;
|
||||
|
||||
/* check if we've timed out or how much time to wait at most */
|
||||
if (timeout_us > 0)
|
||||
|
@ -92,7 +92,7 @@ g_win32_fs_monitor_handle_event (GWin32FSMonitorPrivate *monitor,
|
||||
monitor->pfni_prev->Action == FILE_ACTION_RENAMED_OLD_NAME)
|
||||
{
|
||||
/* don't bother sending events, was already sent (rename) */
|
||||
fme = -1;
|
||||
fme = (GFileMonitorEvent) -1;
|
||||
}
|
||||
else
|
||||
fme = G_FILE_MONITOR_EVENT_MOVED_IN;
|
||||
@ -104,7 +104,7 @@ g_win32_fs_monitor_handle_event (GWin32FSMonitorPrivate *monitor,
|
||||
break;
|
||||
}
|
||||
|
||||
if (fme != -1)
|
||||
if (fme != (GFileMonitorEvent) -1)
|
||||
return g_file_monitor_source_handle_event (monitor->fms,
|
||||
fme,
|
||||
filename,
|
||||
|
@ -546,7 +546,7 @@ g_winhttp_file_query_info (GFile *file,
|
||||
NULL))
|
||||
{
|
||||
gint64 cl;
|
||||
int n;
|
||||
size_t n;
|
||||
const char *gint64_format = "%"G_GINT64_FORMAT"%n";
|
||||
wchar_t *gint64_format_w = g_utf8_to_utf16 (gint64_format, -1, NULL, NULL, NULL);
|
||||
|
||||
|
@ -165,7 +165,7 @@ g_winhttp_vfs_get_file_for_uri (GVfs *vfs,
|
||||
const char *uri)
|
||||
{
|
||||
GWinHttpVfs *winhttp_vfs = G_WINHTTP_VFS (vfs);
|
||||
int i;
|
||||
gsize i;
|
||||
GFile *ret = NULL;
|
||||
|
||||
/* If it matches one of "our" schemes, handle it */
|
||||
@ -192,7 +192,7 @@ g_winhttp_vfs_get_supported_uri_schemes (GVfs *vfs)
|
||||
{
|
||||
GWinHttpVfs *winhttp_vfs = G_WINHTTP_VFS (vfs);
|
||||
const gchar * const *wrapped_vfs_uri_schemes = g_vfs_get_supported_uri_schemes (winhttp_vfs->wrapped_vfs);
|
||||
int i, n;
|
||||
gsize i, n;
|
||||
const gchar **retval;
|
||||
|
||||
n = 0;
|
||||
|
@ -514,7 +514,7 @@ g_system_thread_new (GThreadFunc proxy,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (ResumeThread (thread->handle) == -1)
|
||||
if (ResumeThread (thread->handle) == (DWORD) -1)
|
||||
{
|
||||
message = "Error resuming new thread";
|
||||
goto error;
|
||||
|
@ -157,7 +157,7 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
gint start_year;
|
||||
guint start_year;
|
||||
gint32 std_offset;
|
||||
gint32 dlt_offset;
|
||||
TimeZoneDate dlt_start;
|
||||
@ -906,8 +906,7 @@ rules_from_windows_time_zone (const gchar *identifier,
|
||||
if (RegOpenKeyExW (HKEY_LOCAL_MACHINE, subkey_dynamic_w, 0,
|
||||
KEY_QUERY_VALUE, &key) == ERROR_SUCCESS)
|
||||
{
|
||||
DWORD first, last;
|
||||
int year, i;
|
||||
DWORD i, first, last, year;
|
||||
wchar_t s[12];
|
||||
|
||||
size = sizeof first;
|
||||
@ -1458,6 +1457,8 @@ set_tz_name (gchar **pos, gchar *buffer, guint size)
|
||||
gchar *name_pos = *pos;
|
||||
guint len;
|
||||
|
||||
g_assert (size != 0);
|
||||
|
||||
if (quoted)
|
||||
{
|
||||
name_pos++;
|
||||
@ -1479,7 +1480,7 @@ set_tz_name (gchar **pos, gchar *buffer, guint size)
|
||||
|
||||
memset (buffer, 0, size);
|
||||
/* name_pos isn't 0-terminated, so we have to limit the length expressly */
|
||||
len = *pos - name_pos > size - 1 ? size - 1 : *pos - name_pos;
|
||||
len = (guint) (*pos - name_pos) > size - 1 ? size - 1 : (guint) (*pos - name_pos);
|
||||
strncpy (buffer, name_pos, len);
|
||||
*pos += quoted;
|
||||
return TRUE;
|
||||
@ -1542,8 +1543,7 @@ rules_from_identifier (const gchar *identifier,
|
||||
#ifdef G_OS_WIN32
|
||||
/* Windows allows us to use the US DST boundaries if they're not given */
|
||||
{
|
||||
int i;
|
||||
guint rules_num = 0;
|
||||
guint i, rules_num = 0;
|
||||
|
||||
/* Use US rules, Windows' default is Pacific Standard Time */
|
||||
if ((rules_num = rules_from_windows_time_zone ("Pacific Standard Time",
|
||||
|
@ -534,7 +534,7 @@ g_win32_check_windows_version (const gint major,
|
||||
HMODULE hmodule;
|
||||
#endif
|
||||
/* We Only Support Checking for XP or later */
|
||||
g_return_val_if_fail (major >= 5 && (major <=6 || major == 10), FALSE);
|
||||
g_return_val_if_fail (major >= 5 && (major <= 6 || major == 10), FALSE);
|
||||
g_return_val_if_fail ((major >= 5 && minor >= 1) || major >= 6, FALSE);
|
||||
|
||||
/* Check for Service Pack Version >= 0 */
|
||||
@ -553,14 +553,14 @@ g_win32_check_windows_version (const gint major,
|
||||
RtlGetVersion (&osverinfo);
|
||||
|
||||
/* check the OS and Service Pack Versions */
|
||||
if (osverinfo.dwMajorVersion > major)
|
||||
if (osverinfo.dwMajorVersion > (DWORD) major)
|
||||
is_ver_checked = TRUE;
|
||||
else if (osverinfo.dwMajorVersion == major)
|
||||
else if (osverinfo.dwMajorVersion == (DWORD) major)
|
||||
{
|
||||
if (osverinfo.dwMinorVersion > minor)
|
||||
if (osverinfo.dwMinorVersion > (DWORD) minor)
|
||||
is_ver_checked = TRUE;
|
||||
else if (osverinfo.dwMinorVersion == minor)
|
||||
if (osverinfo.wServicePackMajor >= spver)
|
||||
else if (osverinfo.dwMinorVersion == (DWORD) minor)
|
||||
if (osverinfo.wServicePackMajor >= (DWORD) spver)
|
||||
is_ver_checked = TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user