gallium: Less confusing interface for timeouts.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 15 Apr 2008 06:40:35 +0000 (15:40 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 15 Apr 2008 06:40:35 +0000 (15:40 +0900)
src/gallium/auxiliary/util/u_time.c
src/gallium/auxiliary/util/u_time.h

index 04f85c42efb26f5d6178cc8030c1755835c5563b..01112ebe5aa9cb3794f7e746a773a75bf99f734c 100644 (file)
@@ -120,15 +120,15 @@ util_time_compare(const struct util_time *t1,
 }
 
 
-int 
+boolean 
 util_time_timeout(const struct util_time *start, 
                   const struct util_time *end,
                   const struct util_time *curr) 
 {
    if(util_time_compare(start, end) <= 0)
-      return util_time_compare(start, curr) <= 0 && util_time_compare(curr, end) < 0;
+      return !(util_time_compare(start, curr) <= 0 && util_time_compare(curr, end) < 0);
    else
-      return util_time_compare(start, curr) <= 0 || util_time_compare(curr, end) < 0;
+      return !(util_time_compare(start, curr) <= 0 || util_time_compare(curr, end) < 0);
 }
 
 
index 2133958446b8b9a973bde03204bc1552095f9336..c8836c137faa3f7e1f64bb710628ae64fa9333f8 100644 (file)
@@ -77,9 +77,9 @@ util_time_diff(const struct util_time *t1,
                const struct util_time *t2);
 
 /**
- * Returns zero when the timeout expires, non zero otherwise.
+ * Returns non-zero when the timeout expires.
  */
-int 
+boolean 
 util_time_timeout(const struct util_time *start, 
                   const struct util_time *end,
                   const struct util_time *curr);