inotify: Fix a few trivial -Wsign-conversion warnings

When building GIO with `-Wsign-conversion` enabled.

In all of these cases, the implicit sign conversion cast is correct, so
let’s make it explicit to indicate that we‘ve checked it.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3405
This commit is contained in:
Philip Withnall
2025-12-16 11:54:48 +00:00
parent 1523eb1ee5
commit def8a7b071
3 changed files with 5 additions and 5 deletions

View File

@@ -260,7 +260,7 @@ ih_not_missing_callback (inotify_sub *sub)
static GFileMonitorEvent static GFileMonitorEvent
ih_mask_to_EventFlags (guint32 mask) ih_mask_to_EventFlags (guint32 mask)
{ {
mask &= ~IN_ISDIR; mask &= (guint32) ~IN_ISDIR;
switch (mask) switch (mask)
{ {
case IN_MODIFY: case IN_MODIFY:
@@ -287,6 +287,6 @@ ih_mask_to_EventFlags (guint32 mask)
case IN_ACCESS: case IN_ACCESS:
case IN_IGNORED: case IN_IGNORED:
default: default:
return -1; return (GFileMonitorEvent) -1;
} }
} }

View File

@@ -144,7 +144,7 @@ ik_source_can_dispatch_now (InotifyKernelSource *iks,
return 0 <= dispatch_time && dispatch_time <= now; return 0 <= dispatch_time && dispatch_time <= now;
} }
static gsize static size_t
ik_source_read_some_events (InotifyKernelSource *iks, ik_source_read_some_events (InotifyKernelSource *iks,
gchar *buffer, gchar *buffer,
gsize buffer_len) gsize buffer_len)
@@ -169,7 +169,7 @@ again:
else if (result == 0) else if (result == 0)
g_error ("inotify unexpectedly hit eof"); g_error ("inotify unexpectedly hit eof");
return result; return (size_t) result;
} }
static gchar * static gchar *

View File

@@ -482,7 +482,7 @@ ip_event_dispatch (GList *dir_list,
*/ */
if (sub->hardlinks) if (sub->hardlinks)
{ {
event->mask &= ~IP_INOTIFY_FILE_MASK; event->mask &= (guint32) ~IP_INOTIFY_FILE_MASK;
if (!event->mask) if (!event->mask)
continue; continue;
} }