From def8a7b071f0e65bcd0dfa6a4473ebb4f007bee4 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 16 Dec 2025 11:54:48 +0000 Subject: [PATCH] inotify: Fix a few trivial -Wsign-conversion warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Helps: #3405 --- gio/inotify/inotify-helper.c | 4 ++-- gio/inotify/inotify-kernel.c | 4 ++-- gio/inotify/inotify-path.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gio/inotify/inotify-helper.c b/gio/inotify/inotify-helper.c index ef4b741c3..374c08be7 100644 --- a/gio/inotify/inotify-helper.c +++ b/gio/inotify/inotify-helper.c @@ -260,7 +260,7 @@ ih_not_missing_callback (inotify_sub *sub) static GFileMonitorEvent ih_mask_to_EventFlags (guint32 mask) { - mask &= ~IN_ISDIR; + mask &= (guint32) ~IN_ISDIR; switch (mask) { case IN_MODIFY: @@ -287,6 +287,6 @@ ih_mask_to_EventFlags (guint32 mask) case IN_ACCESS: case IN_IGNORED: default: - return -1; + return (GFileMonitorEvent) -1; } } diff --git a/gio/inotify/inotify-kernel.c b/gio/inotify/inotify-kernel.c index fc78641db..33d552d09 100644 --- a/gio/inotify/inotify-kernel.c +++ b/gio/inotify/inotify-kernel.c @@ -144,7 +144,7 @@ ik_source_can_dispatch_now (InotifyKernelSource *iks, return 0 <= dispatch_time && dispatch_time <= now; } -static gsize +static size_t ik_source_read_some_events (InotifyKernelSource *iks, gchar *buffer, gsize buffer_len) @@ -169,7 +169,7 @@ again: else if (result == 0) g_error ("inotify unexpectedly hit eof"); - return result; + return (size_t) result; } static gchar * diff --git a/gio/inotify/inotify-path.c b/gio/inotify/inotify-path.c index b7343e462..f6a9182b1 100644 --- a/gio/inotify/inotify-path.c +++ b/gio/inotify/inotify-path.c @@ -482,7 +482,7 @@ ip_event_dispatch (GList *dir_list, */ if (sub->hardlinks) { - event->mask &= ~IP_INOTIFY_FILE_MASK; + event->mask &= (guint32) ~IP_INOTIFY_FILE_MASK; if (!event->mask) continue; }