summaryrefslogtreecommitdiff
path: root/ptw32_timespec.c
diff options
context:
space:
mode:
authorrpj <rpj>2004-05-17 01:38:02 +0000
committerrpj <rpj>2004-05-17 01:38:02 +0000
commit771465fed0cf50ee2dd790723245fc091699c324 (patch)
treed8c18d095a33fe7c4564bd90c5f313bb9e4057dd /ptw32_timespec.c
parent8b14911744f58cbe3730703f3fcc41cd969fd0f3 (diff)
re-indentation, bug fixes, hooks for pre-emptive async cancelation
Diffstat (limited to 'ptw32_timespec.c')
-rw-r--r--ptw32_timespec.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/ptw32_timespec.c b/ptw32_timespec.c
index aa1640a..cad3327 100644
--- a/ptw32_timespec.c
+++ b/ptw32_timespec.c
@@ -48,7 +48,7 @@
( ((LONGLONG) 27111902 << 32) + (LONGLONG) 3577643008 )
INLINE void
-ptw32_timespec_to_filetime(const struct timespec *ts, FILETIME *ft)
+ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft)
/*
* -------------------------------------------------------------------
* converts struct timespec
@@ -58,13 +58,12 @@ ptw32_timespec_to_filetime(const struct timespec *ts, FILETIME *ft)
* -------------------------------------------------------------------
*/
{
- *(LONGLONG *)ft = ts->tv_sec * 10000000
- + (ts->tv_nsec + 50) / 100
- + PTW32_TIMESPEC_TO_FILETIME_OFFSET;
+ *(LONGLONG *) ft = ts->tv_sec * 10000000
+ + (ts->tv_nsec + 50) / 100 + PTW32_TIMESPEC_TO_FILETIME_OFFSET;
}
INLINE void
-ptw32_filetime_to_timespec(const FILETIME *ft, struct timespec *ts)
+ptw32_filetime_to_timespec (const FILETIME * ft, struct timespec *ts)
/*
* -------------------------------------------------------------------
* converts FILETIME (as set by GetSystemTimeAsFileTime), where the time is
@@ -74,8 +73,11 @@ ptw32_filetime_to_timespec(const FILETIME *ft, struct timespec *ts)
* -------------------------------------------------------------------
*/
{
- ts->tv_sec = (int)((*(LONGLONG *)ft - PTW32_TIMESPEC_TO_FILETIME_OFFSET) / 10000000);
- ts->tv_nsec = (int)((*(LONGLONG *)ft - PTW32_TIMESPEC_TO_FILETIME_OFFSET - ((LONGLONG)ts->tv_sec * (LONGLONG)10000000)) * 100);
+ ts->tv_sec =
+ (int) ((*(LONGLONG *) ft - PTW32_TIMESPEC_TO_FILETIME_OFFSET) / 10000000);
+ ts->tv_nsec =
+ (int) ((*(LONGLONG *) ft - PTW32_TIMESPEC_TO_FILETIME_OFFSET -
+ ((LONGLONG) ts->tv_sec * (LONGLONG) 10000000)) * 100);
}
#endif /* NEED_FTIME */