[LIBWINE] Fix GCC build warning. (#4938) 4938/head
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 10 Dec 2022 17:47:34 +0000 (18:47 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 6 Jan 2023 12:17:21 +0000 (13:17 +0100)
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

index 9c6eba2..b4814e6 100644 (file)
@@ -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;