From 2714e3ee488c69bc3478fb7e8768e73cf735f73b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 10 Dec 2022 18:47:34 +0100 Subject: [PATCH] [LIBWINE] Fix GCC build warning. (#4938) In file included from ../sdk/lib/3rdparty/libwine/debug_ros.c:9: ../sdk/lib/3rdparty/libwine/debug.c: In function 'get_temp_buffer': ../sdk/lib/3rdparty/libwine/debug.c:343:33: warning: passing argument 1 of '_InterlockedExchangeAdd' from incompatible pointer type [-Wincompatible-pointer-types] idx = interlocked_xchg_add( &pos, 1 ) % (sizeof(list)/sizeof(list[0])); ^~~~ In file included from ../sdk/include/crt/mingw32/intrin.h:98, from ../sdk/include/crt/intrin.h:1017, from sdk/include/psdk/winnt.h:48, from ../sdk/include/psdk/windef.h:202, from ../sdk/include/reactos/wine/debug.h:26, from ../sdk/lib/3rdparty/libwine/debug.c:32, from ../sdk/lib/3rdparty/libwine/debug_ros.c:9: ../sdk/include/crt/mingw32/intrin_x86.h:215:70: note: expected 'volatile long int *' but argument is of type 'int *' __INTRIN_INLINE long __cdecl _InterlockedExchangeAdd(volatile long * Addend, long Value) ~~~~~~~~~~~~~~~~^~~~~~ --- sdk/lib/3rdparty/libwine/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/lib/3rdparty/libwine/debug.c b/sdk/lib/3rdparty/libwine/debug.c index 9c6eba2c77f..b4814e63698 100644 --- a/sdk/lib/3rdparty/libwine/debug.c +++ b/sdk/lib/3rdparty/libwine/debug.c @@ -336,9 +336,9 @@ int ros_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *chann static char *get_temp_buffer( size_t size ) { static char *list[32]; - static int pos; + static long pos = 0; char *ret; - int idx; + long idx; idx = interlocked_xchg_add( &pos, 1 ) % (sizeof(list)/sizeof(list[0])); if ((ret = realloc( list[idx], size ))) list[idx] = ret;