Commit b22faf3d authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcr100: Fix lldiv implementation.

parent 48a7d4d0
...@@ -1938,12 +1938,11 @@ MSVCRT_ldiv_t CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom) ...@@ -1938,12 +1938,11 @@ MSVCRT_ldiv_t CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom)
/********************************************************************* /*********************************************************************
* lldiv (MSVCR100.@) * lldiv (MSVCR100.@)
*/ */
MSVCRT_lldiv_t CDECL MSVCRT_lldiv(MSVCRT_longlong num, MSVCRT_longlong denom) MSVCRT_lldiv_t* CDECL MSVCRT_lldiv(MSVCRT_lldiv_t *ret,
MSVCRT_longlong num, MSVCRT_longlong denom)
{ {
MSVCRT_lldiv_t ret; ret->quot = num / denom;
ret->rem = num % denom;
ret.quot = num / denom;
ret.rem = num % denom;
return ret; return ret;
} }
......
...@@ -114,7 +114,7 @@ static int (CDECL *p__ltoa_s)(LONG, char*, size_t, int); ...@@ -114,7 +114,7 @@ static int (CDECL *p__ltoa_s)(LONG, char*, size_t, int);
static char* (CDECL *p__get_narrow_winmain_command_line)(void); static char* (CDECL *p__get_narrow_winmain_command_line)(void);
static int (CDECL *p_sopen_dispatch)(const char *, int, int, int, int *, int); static int (CDECL *p_sopen_dispatch)(const char *, int, int, int, int *, int);
static int (CDECL *p_sopen_s)(int *, const char *, int, int, int); static int (CDECL *p_sopen_s)(int *, const char *, int, int, int);
static MSVCRT_lldiv_t (CDECL *p_lldiv)(LONGLONG,LONGLONG); static MSVCRT_lldiv_t* (CDECL *p_lldiv)(MSVCRT_lldiv_t*,LONGLONG,LONGLONG);
static int (CDECL *p__isctype)(int,int); static int (CDECL *p__isctype)(int,int);
static int (CDECL *p_isblank)(int); static int (CDECL *p_isblank)(int);
static int (CDECL *p__isblank_l)(int,_locale_t); static int (CDECL *p__isblank_l)(int,_locale_t);
...@@ -504,7 +504,7 @@ static void test_lldiv(void) ...@@ -504,7 +504,7 @@ static void test_lldiv(void)
{ {
MSVCRT_lldiv_t r; MSVCRT_lldiv_t r;
r = p_lldiv((LONGLONG)0x111 << 32 | 0x222, (LONGLONG)1 << 32); p_lldiv(&r, (LONGLONG)0x111 << 32 | 0x222, (LONGLONG)1 << 32);
ok(r.quot == 0x111, "quot = %s\n", wine_dbgstr_longlong(r.quot)); ok(r.quot == 0x111, "quot = %s\n", wine_dbgstr_longlong(r.quot));
ok(r.rem == 0x222, "rem = %s\n", wine_dbgstr_longlong(r.rem)); ok(r.rem == 0x222, "rem = %s\n", wine_dbgstr_longlong(r.rem));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment