fix compare
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 23 May 2006 19:58:09 +0000 (19:58 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 23 May 2006 19:58:09 +0000 (19:58 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1838 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/time.h

index 2bf3048e2f8b9ecbf234ce4bacc73dea9106c386..14c15d1d237c1d7d184033636750a510a63e8e16 100644 (file)
@@ -90,14 +90,10 @@ static inline LttTime ltt_time_add(LttTime t1, LttTime t2)
 static inline int ltt_time_compare(LttTime t1, LttTime t2)
 {
   int ret=0;
-  //if(likely(t1.tv_sec > t2.tv_sec)) ret = 1;
-  //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((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;
+  if(likely(t1.tv_sec > t2.tv_sec)) ret = 1;
+  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;
   
   return ret;
 }
This page took 0.023749 seconds and 4 git commands to generate.