From f65d8e87309c6971889d6da9a9794a46c9ce9909 Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Tue, 27 Jun 2023 14:15:34 -0400 Subject: [PATCH] app: silence warning in gimpimage-convert-indexed We had the following warning: In function 'make_remap_table', inlined from 'gimp_image_convert_indexed' at ../../gimp/app/core/gimpimage-convert-indexed.c:1057:7: D:/msys64/mingw64/include/glib-2.0/glib/gmem.h:261:19: warning: argument 1 range [18446744071562067968, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] This is apparently caused by inlining in combination with using a signed int. See also: https://gcc.gnu.org/bugzilla//show_bug.cgi?id=85783 Casting to (guint) silences the warning here. --- app/core/gimpimage-convert-indexed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/core/gimpimage-convert-indexed.c b/app/core/gimpimage-convert-indexed.c index 1194578f08..2f1f5ba9ce 100644 --- a/app/core/gimpimage-convert-indexed.c +++ b/app/core/gimpimage-convert-indexed.c @@ -636,7 +636,7 @@ make_remap_table (const guchar old_palette[], /* Third pass - rank all used indices to the beginning of the * palette. */ - palentries = g_new (PalEntry, used); + palentries = g_new (PalEntry, (guint) used); for (i = 0; i < used; i++) {