msvcrt: Remove extra pointers on lldiv() implementation and test.

Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Serge Gautherie 2020-07-11 20:02:45 +02:00 committed by Alexandre Julliard
parent d5f1c54950
commit 0a835c8da9
2 changed files with 14 additions and 6 deletions

View File

@ -2114,11 +2114,12 @@ MSVCRT_ldiv_t CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom)
/*********************************************************************
* lldiv (MSVCR100.@)
*/
MSVCRT_lldiv_t* CDECL MSVCRT_lldiv(MSVCRT_lldiv_t *ret,
MSVCRT_longlong num, MSVCRT_longlong denom)
MSVCRT_lldiv_t CDECL MSVCRT_lldiv(MSVCRT_longlong num, MSVCRT_longlong denom)
{
ret->quot = num / denom;
ret->rem = num % denom;
MSVCRT_lldiv_t ret;
ret.quot = num / denom;
ret.rem = num % denom;
return ret;
}

View File

@ -520,12 +520,19 @@ static void test__sopen_s(void)
static void test_lldiv(void)
{
static lldiv_t* (CDECL *p_lldiv)(lldiv_t*,LONGLONG,LONGLONG) = (void*)lldiv;
lldiv_t r;
p_lldiv(&r, (LONGLONG)0x111 << 32 | 0x222, (LONGLONG)1 << 32);
r = lldiv(((LONGLONG)0x111 << 32) + 0x222, (LONGLONG)1 << 32);
ok(r.quot == 0x111, "quot = %s\n", wine_dbgstr_longlong(r.quot));
ok(r.rem == 0x222, "rem = %s\n", wine_dbgstr_longlong(r.rem));
r = lldiv(((LONGLONG)0x69CF0012 << 32) + 0x0033E78A, 0x30);
ok(r.quot == ((LONGLONG)0x02345000 << 32) + 0x600114D2, "quot = %s\n", wine_dbgstr_longlong(r.quot));
ok(r.rem == 0x2A, "rem = %s\n", wine_dbgstr_longlong(r.rem));
r = lldiv(((LONGLONG)0x243A5678 << 32) + 0x9ABCDEF0, (LONGLONG)0x12 << 48);
ok(r.quot == 0x0203, "quot = %s\n", wine_dbgstr_longlong(r.quot));
ok(r.rem == ((LONGLONG)0x00045678 << 32) + 0x9ABCDEF0, "rem = %s\n", wine_dbgstr_longlong(r.rem));
}
static void test_isblank(void)