diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 686984709af..3c6d48d41cc 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -431,10 +431,10 @@ void CDECL _vcomp_atomic_and_i1(char *dest, char val) do old = *dest; while (interlocked_cmpxchg8(dest, old & val, old) != old); } -void CDECL _vcomp_atomic_div_i1(char *dest, char val) +void CDECL _vcomp_atomic_div_i1(signed char *dest, signed char val) { - char old; - do old = *dest; while (interlocked_cmpxchg8(dest, old / val, old) != old); + signed char old; + do old = *dest; while ((signed char)interlocked_cmpxchg8((char *)dest, old / val, old) != old); } void CDECL _vcomp_atomic_div_ui1(unsigned char *dest, unsigned char val) @@ -461,10 +461,10 @@ void CDECL _vcomp_atomic_shl_i1(char *dest, unsigned int val) do old = *dest; while (interlocked_cmpxchg8(dest, old << val, old) != old); } -void CDECL _vcomp_atomic_shr_i1(char *dest, unsigned int val) +void CDECL _vcomp_atomic_shr_i1(signed char *dest, unsigned int val) { - char old; - do old = *dest; while (interlocked_cmpxchg8(dest, old >> val, old) != old); + signed char old; + do old = *dest; while ((signed char)interlocked_cmpxchg8((char *)dest, old >> val, old) != old); } void CDECL _vcomp_atomic_shr_ui1(unsigned char *dest, unsigned int val) diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index ea629097561..a8b80a0e22a 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -1549,7 +1549,7 @@ static void test_atomic_integer8(void) struct { void (CDECL *func)(char *, char); - char v1, v2, expected; + signed char v1, v2, expected; } tests1[] = { @@ -1566,9 +1566,9 @@ static void test_atomic_integer8(void) struct { void (CDECL *func)(char *, unsigned int); - char v1; + signed char v1; unsigned int v2; - char expected; + signed char expected; } tests2[] = { @@ -1616,14 +1616,14 @@ static void test_atomic_integer8(void) for (i = 0; i < ARRAY_SIZE(tests1); i++) { - char val = tests1[i].v1; - tests1[i].func(&val, tests1[i].v2); + signed char val = tests1[i].v1; + tests1[i].func((char *)&val, tests1[i].v2); ok(val == tests1[i].expected, "test %d: expected val == %d, got %d\n", i, tests1[i].expected, val); } for (i = 0; i < ARRAY_SIZE(tests2); i++) { - char val = tests2[i].v1; - tests2[i].func(&val, tests2[i].v2); + signed char val = tests2[i].v1; + tests2[i].func((char *)&val, tests2[i].v2); ok(val == tests2[i].expected, "test %d: expected val == %d, got %d\n", i, tests2[i].expected, val); } for (i = 0; i < ARRAY_SIZE(tests3); i++)