From ddf83b7f8d740a52adfbfabc8d6864a6fc6f83a2 Mon Sep 17 00:00:00 2001 From: compudj Date: Tue, 23 May 2006 19:46:15 +0000 Subject: [PATCH] fix compare git-svn-id: http://ltt.polymtl.ca/svn@1837 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/time.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ltt/branches/poly/ltt/time.h b/ltt/branches/poly/ltt/time.h index 5b400522..2bf3048e 100644 --- a/ltt/branches/poly/ltt/time.h +++ b/ltt/branches/poly/ltt/time.h @@ -94,10 +94,10 @@ static inline int ltt_time_compare(LttTime t1, LttTime t2) //else if(unlikely(t1.tv_sec < t2.tv_sec)) ret = -1; //else if(likely(t1.tv_nsec > t2.tv_nsec)) ret = 1; //else if(unlikely(t1.tv_nsec < t2.tv_nsec)) ret = -1; - if(likely(t1.tv_sec - t2.tv_sec > 0)) ret = 1; - else if(unlikely(t1.tv_sec - t2.tv_sec < 0)) ret = -1; - else if(likely(t1.tv_nsec - t2.tv_nsec > 0)) ret = 1; - else if(unlikely(t1.tv_nsec - t2.tv_nsec < 0)) ret = -1; + if(likely((long)t1.tv_sec - (long)t2.tv_sec > 0)) ret = 1; + else if(unlikely((long)t1.tv_sec - (long)t2.tv_sec < 0)) ret = -1; + else if(likely((long)t1.tv_nsec - (long)t2.tv_nsec > 0)) ret = 1; + else if(unlikely((long)t1.tv_nsec - (long)t2.tv_nsec < 0)) ret = -1; return ret; } -- 2.34.1