Author: hbelusca
Date: Fri Nov 11 21:37:09 2016
New Revision: 73205
URL:
http://svn.reactos.org/svn/reactos?rev=73205&view=rev
Log:
[MSAFD]
- In C, void functions should better have 'VOID' mentioned in their prototypes.
- Simplify GetCurrentTimeInSeconds code.
Modified:
trunk/reactos/dll/win32/msafd/misc/dllmain.c
Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Fri Nov 11 21:37:09 2016
@@ -1321,18 +1321,18 @@
}
DWORD
-GetCurrentTimeInSeconds()
+GetCurrentTimeInSeconds(VOID)
{
- FILETIME Time;
- FILETIME Adjustment;
- ULARGE_INTEGER lTime, lAdj;
- SYSTEMTIME st = { 1970,1,0,1,0,0,0 };
- SystemTimeToFileTime(&st, &Adjustment);
- memcpy(&lAdj, &Adjustment, sizeof(lAdj));
- GetSystemTimeAsFileTime(&Time);
- memcpy(&lTime, &Time, sizeof(lTime));
- lTime.QuadPart -= lAdj.QuadPart;
- return (DWORD)(lTime.QuadPart / 10000000LLU);
+ SYSTEMTIME st1970 = { 1970, 1, 0, 1, 0, 0, 0, 0 };
+ union
+ {
+ FILETIME ft;
+ ULONGLONG ll;
+ } u1970, Time;
+
+ GetSystemTimeAsFileTime(&Time.ft);
+ SystemTimeToFileTime(&st1970, &u1970.ft);
+ return (DWORD)((Time.ll - u1970.ll) / 10000000ULL);
}
SOCKET