mirror of
https://github.com/reactos/reactos.git
synced 2025-06-04 00:40:31 +00:00
[MSAFD]
- In C, void functions should better have 'VOID' mentioned in their prototypes. - Simplify GetCurrentTimeInSeconds code. svn path=/trunk/; revision=73205
This commit is contained in:
parent
47cea24f67
commit
ed21369043
1 changed files with 11 additions and 11 deletions
|
@ -1321,18 +1321,18 @@ WSPSelect(IN int nfds,
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
GetCurrentTimeInSeconds()
|
GetCurrentTimeInSeconds(VOID)
|
||||||
{
|
{
|
||||||
FILETIME Time;
|
SYSTEMTIME st1970 = { 1970, 1, 0, 1, 0, 0, 0, 0 };
|
||||||
FILETIME Adjustment;
|
union
|
||||||
ULARGE_INTEGER lTime, lAdj;
|
{
|
||||||
SYSTEMTIME st = { 1970,1,0,1,0,0,0 };
|
FILETIME ft;
|
||||||
SystemTimeToFileTime(&st, &Adjustment);
|
ULONGLONG ll;
|
||||||
memcpy(&lAdj, &Adjustment, sizeof(lAdj));
|
} u1970, Time;
|
||||||
GetSystemTimeAsFileTime(&Time);
|
|
||||||
memcpy(&lTime, &Time, sizeof(lTime));
|
GetSystemTimeAsFileTime(&Time.ft);
|
||||||
lTime.QuadPart -= lAdj.QuadPart;
|
SystemTimeToFileTime(&st1970, &u1970.ft);
|
||||||
return (DWORD)(lTime.QuadPart / 10000000LLU);
|
return (DWORD)((Time.ll - u1970.ll) / 10000000ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
SOCKET
|
SOCKET
|
||||||
|
|
Loading…
Reference in a new issue