Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
sofia-sip
Commits
4ecd1220
Commit
4ecd1220
authored
Nov 27, 2008
by
Pekka Pessi
Browse files
su/su_time0.c: fixed whitespace
darcs-hash:20081127130719-db55f-bdd89fd760f38436056aff28d79f5bd6e3b32623.gz
parent
cec2d547
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
libsofia-sip-ua/su/su_time0.c
libsofia-sip-ua/su/su_time0.c
+11
-11
No files found.
libsofia-sip-ua/su/su_time0.c
View file @
4ecd1220
...
...
@@ -31,7 +31,7 @@
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
* @author Jari Selin <Jari.Selin@nokia.com>
*
*
* @date Created: Fri May 10 18:13:19 2002 ppessi
*/
...
...
@@ -61,7 +61,7 @@
#endif
/** Seconds from 1.1.1900 to 1.1.1970 */
#define NTP_EPOCH 2208988800UL
#define NTP_EPOCH 2208988800UL
#define E9 (1000000000U)
#define E7 (10000000U)
...
...
@@ -92,7 +92,7 @@ void su_time(su_time_t *tv)
GetSystemTimeAsFileTime
(
date
.
ft
);
tv
->
tv_usec
=
(
unsigned
long
)
((
date
.
ull
->
QuadPart
%
E7
)
/
10
);
tv
->
tv_sec
=
(
unsigned
long
)
((
date
.
ull
->
QuadPart
/
E7
)
-
tv
->
tv_sec
=
(
unsigned
long
)
((
date
.
ull
->
QuadPart
/
E7
)
-
/* 1900-Jan-01 - 1601-Jan-01: 299 years, 72 leap years */
(
299
*
365
+
72
)
*
24
*
60
*
(
uint64_t
)
60
);
#else
...
...
@@ -122,7 +122,7 @@ su_nanotime_t su_nanotime(su_nanotime_t *return_time)
#if HAVE_CLOCK_GETTIME
{
struct
timespec
tv
;
if
(
clock_gettime
(
CLOCK_REALTIME
,
&
tv
)
==
0
)
{
now
=
((
su_nanotime_t
)
tv
.
tv_sec
+
NTP_EPOCH
)
*
E9
+
tv
.
tv_nsec
;
*
return_time
=
now
;
...
...
@@ -139,11 +139,11 @@ su_nanotime_t su_nanotime(su_nanotime_t *return_time)
FILETIME
ft
[
1
];
ULARGE_INTEGER
ull
[
1
];
}
date
;
GetSystemTimeAsFileTime
(
date
.
ft
);
now
=
100
*
(
date
.
ull
->
QuadPart
-
now
=
100
*
(
date
.
ull
->
QuadPart
-
/* 1900-Jan-01 - 1601-Jan-01: 299 years, 72 leap years */
((
su_nanotime_t
)(
299
*
365
+
72
)
*
24
*
60
*
60
)
*
E7
);
}
...
...
@@ -173,16 +173,16 @@ su_nanotime_t su_nanotime(su_nanotime_t *return_time)
* monotonic and never goes back - if the underlying system supports such a
* clock.
*
* @param return_time optional pointer to return the current time
* @param return_time optional pointer to return the current time
*
* @return Current time as nanoseconds
* @return Current time as nanoseconds
*/
su_nanotime_t
su_monotime
(
su_nanotime_t
*
return_time
)
{
#if HAVE_CLOCK_GETTIME && CLOCK_MONOTONIC
{
struct
timespec
tv
;
if
(
clock_gettime
(
CLOCK_MONOTONIC
,
&
tv
)
==
0
)
{
su_nanotime_t
now
=
(
su_nanotime_t
)
tv
.
tv_sec
*
E9
+
tv
.
tv_nsec
;
if
(
return_time
)
...
...
@@ -195,7 +195,7 @@ su_nanotime_t su_monotime(su_nanotime_t *return_time)
#if HAVE_NANOUPTIME
{
struct
timespec
tv
;
nanouptime
(
&
tv
);
now
=
(
su_nanotime_t
)
tv
.
tv_sec
*
E9
+
tv
.
tv_nsec
;
if
(
return_time
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment