add LTT_TIME_MAX and LTT_TIME_MIN
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 6 Aug 2004 18:20:08 +0000 (18:20 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 6 Aug 2004 18:20:08 +0000 (18:20 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@669 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/time.h
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c

index d961f3738ac0eb110c5248722edc07061c7358b0..d904953099c96da1888fd1aa826966736eb91e84 100644 (file)
@@ -28,13 +28,13 @@ typedef struct _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_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) 
 {
@@ -110,6 +110,9 @@ static inline int ltt_time_compare(LttTime t1, LttTime t2)
   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)
 {
index c101c9c6c792d2624db211943c42fca489ab98c6..4ec7864f767e5f62e527338176ee0f1569b05d91 100644 (file)
@@ -1283,8 +1283,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
       lttv_traceset_context_position_save(tsc, events_request->start_position);
 
       /* 1.2. Remove start time */
-      events_request->start_time.tv_sec = G_MAXUINT;
-      events_request->start_time.tv_nsec = G_MAXUINT;
+      events_request->start_time = ltt_time_infinite;
       
       /* 1.3. Move from list_in to list_out */
       remove = TRUE;
index 28033ed480d1c2c619cc50e5474897eaad957c94..b4dea0e7e914e94b20c6b81702da9b8bfad30131 100644 (file)
@@ -602,15 +602,15 @@ void lttvwindow_report_focus(Tab *tab,
 
 
 /* Structure sent to the events request hook */
-                                                /* Value considered as empty */
+                                                /* Value considered as empty*/
 typedef struct _EventsRequest {
   gpointer                     owner;           /* Owner of the request     */
   gpointer                     viewer_data;     /* Unset : NULL             */
-  gboolean                     servicing;       /* service in progress: TRUE */ 
-  LttTime                      start_time;/* Unset : { G_MAXUINT, G_MAXUINT }*/
+  gboolean                     servicing;       /* service in progress: TRUE*/ 
+  LttTime                      start_time;      /* Unset : ltt_time_infinite*/
   LttvTracesetContextPosition *start_position;  /* Unset : NULL             */
   gboolean                     stop_flag;       /* Continue:TRUE Stop:FALSE */
-  LttTime                      end_time;/* Unset : { G_MAXUINT, G_MAXUINT } */
+  LttTime                      end_time;        /* Unset : ltt_time_infinite*/
   guint                        num_events;      /* Unset : G_MAXUINT        */
   LttvTracesetContextPosition *end_position;    /* Unset : NULL             */
   LttvHooks                   *before_chunk_traceset; /* Unset : NULL       */
index 5b34c8c5d071dfb77b6851c54f81db984f8caf74..05c24b7a7f7cfadadf4bb696817725d558cb7b30 100644 (file)
@@ -1024,7 +1024,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace)
   /* 2. call process traceset middle for a chunk */
   {
     /*(assert list_in is not empty! : should not even be called in that case)*/
-    LttTime end = { G_MAXUINT, G_MAXUINT };
+    LttTime end = ltt_time_infinite;
     g_assert(g_slist_length(*list_in) != 0);
     
     lttv_process_traceset_middle(tsc, end, CHUNK_NUM_EVENTS, NULL);
This page took 0.027982 seconds and 4 git commands to generate.