vcomp: Fix signed char issues.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-11-04 15:14:35 +01:00
parent 15ecb13d9c
commit 010d44a2ac
2 changed files with 13 additions and 13 deletions

View File

@ -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)

View File

@ -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++)