projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add LTT_TIME_MAX and LTT_TIME_MIN
[lttv.git]
/
ltt
/
branches
/
poly
/
ltt
/
time.h
diff --git
a/ltt/branches/poly/ltt/time.h
b/ltt/branches/poly/ltt/time.h
index d961f3738ac0eb110c5248722edc07061c7358b0..d904953099c96da1888fd1aa826966736eb91e84 100644
(file)
--- a/
ltt/branches/poly/ltt/time.h
+++ b/
ltt/branches/poly/ltt/time.h
@@
-28,13
+28,13
@@
typedef struct _LttTime {
} LttTime;
} LttTime;
-static const unsigned long NANOSECONDS_PER_SECOND = 1000000000;
+#define NANOSECONDS_PER_SECOND 1000000000
-static const LttTime ltt_time_zero = { 0, 0};
+static const LttTime ltt_time_zero = { 0, 0
};
static const LttTime ltt_time_one = { 0, 1 };
static const LttTime ltt_time_one = { 0, 1 };
-static const LttTime ltt_time_infinite = { G_MAXUINT,
G_MAXUINT
};
+static const LttTime ltt_time_infinite = { G_MAXUINT,
NANOSECONDS_PER_SECOND
};
static inline LttTime ltt_time_sub(LttTime t1, LttTime t2)
{
static inline LttTime ltt_time_sub(LttTime t1, LttTime t2)
{
@@
-110,6
+110,9
@@
static inline int ltt_time_compare(LttTime t1, LttTime t2)
return 0;
}
return 0;
}
+#define LTT_TIME_MIN(a,b) ((ltt_time_compare((a),(b)) < 0) ? (a) : (b))
+#define LTT_TIME_MAX(a,b) ((ltt_time_compare((a),(b)) > 0) ? (a) : (b))
+
#define MAX_TV_SEC_TO_DOUBLE 0x7FFFFF
static inline double ltt_time_to_double(LttTime t1)
{
#define MAX_TV_SEC_TO_DOUBLE 0x7FFFFF
static inline double ltt_time_to_double(LttTime t1)
{
This page took
0.024442 seconds
and
4
git commands to generate.