summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@gnome.org>2023-12-04 12:59:12 +0000
committerPhilip Withnall <pwithnall@gnome.org>2023-12-04 13:00:20 +0000
commit83847839582fd91297d0cbee154778d1d4dc3cff (patch)
tree96bb0d6652531d9b0ed352f3413eb3113b6c038a
parentb17a65bc945e32e23f02d6bcfeee3ff4b7abc27a (diff)
xdgmimecache: Fix a signed/unsigned integer comparison warning
This fixes the warning: ``` xdgmimecache.c: In function ‘cache_lookup_icon’: xdgmimecache.c:84:33: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare] 84 | (((offset) & 0x3) || (offset) > (max) || (n) > ((max) - (offset)) / (record_size)) | ^ xdgmimecache.c:1106:11: note: in expansion of macro ‘OUT_OF_BOUNDS’ 1137 | if (OUT_OF_BOUNDS (header, 1, 4, cache->size)) | ^~~~~~~~~~~~~ cc1: all warnings being treated as errors ``` Signed-off-by: Philip Withnall <pwithnall@gnome.org>
-rw-r--r--src/xdgmimecache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xdgmimecache.c b/src/xdgmimecache.c
index 6d89f10..8722f8c 100644
--- a/src/xdgmimecache.c
+++ b/src/xdgmimecache.c
@@ -1088,7 +1088,7 @@ _xdg_mime_cache_list_mime_parents (const char *mime)
}
static const char *
-cache_lookup_icon (const char *mime, int header)
+cache_lookup_icon (const char *mime, size_t header)
{
const char *ptr;
int i, min, max, mid, cmp;