Signed-off-by: Serge Gautherie winehq-git_serge_180711@gautherie.fr --- dlls/msvcrt/math.c | 9 +++++---- dlls/ucrtbase/tests/misc.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 2e91547..ae4a267 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -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; } diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index cd100cf..e4928b1 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -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)