ntdll/tests: Avoid casting away const in comparison functions.
This commit is contained in:
parent
39eb51f978
commit
f7385699a9
|
@ -1145,20 +1145,30 @@ static void test_wcsrchr(void)
|
|||
|
||||
static __cdecl int intcomparefunc(const void *a, const void *b)
|
||||
{
|
||||
const int *p = a, *q = b;
|
||||
|
||||
ok (a != b, "must never get the same pointer\n");
|
||||
return (*(int*)a) - (*(int*)b);
|
||||
|
||||
return *p - *q;
|
||||
}
|
||||
|
||||
static __cdecl int charcomparefunc(const void *a, const void *b)
|
||||
{
|
||||
const char *p = a, *q = b;
|
||||
|
||||
ok (a != b, "must never get the same pointer\n");
|
||||
return (*(char*)a) - (*(char*)b);
|
||||
|
||||
return *p - *q;
|
||||
}
|
||||
|
||||
static __cdecl int strcomparefunc(const void *a, const void *b)
|
||||
{
|
||||
const char * const *p = a;
|
||||
const char * const *q = b;
|
||||
|
||||
ok (a != b, "must never get the same pointer\n");
|
||||
return lstrcmpA(*(char**)a,*(char**)b);
|
||||
|
||||
return lstrcmpA(*p, *q);
|
||||
}
|
||||
|
||||
static void test_qsort(void)
|
||||
|
|
Loading…
Reference in New Issue