There is quite old code that I got, where exist such days delay calculation:
#define _SECOND ((ULONGLONG) 10000000)
#define _MINUTE (60 * _SECOND)
#define _HOUR (60 * _MINUTE)
#define _DAY (24 * _HOUR)
FILETIME CurTime;
GetSystemTimeAsFileTime(&CurTime);
ULONGLONG qwCurResult = (((ULONGLONG)CurTime.dwHighDateTime) << 32) + CurTime.dwLowDateTime;
DWORD days = (qwCurResult - SomeULONGLONGMoment) / _DAY;
and of course I receive message
warning C4244: 'argument' : conversion from 'ULONGLONG' to 'DWORD', possible loss of data
At modern VS2013 compiler. I know, that it will be number of full days between two moments that is possible to store in DWORD. How to avoid this message?
I don't want to disable all warnings with this number, because somewhere else they may be very useful. Does there exist right way to avoid possible loss of data? I can't counting days in any type except DWORD (or I will just move place with this warning to other part of code).
If you think it is not avoidable, and best solution will be to use another mechanism of getting current date - I will be able to use it just if there will be way to convert SomeULONGLONGMoment (that is ULONGLONG) to types it uses.