time_infinite const
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 13 Jul 2004 17:59:06 +0000 (17:59 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 13 Jul 2004 17:59:06 +0000 (17:59 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@624 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/event.c
ltt/branches/poly/ltt/time.h
ltt/branches/poly/ltt/tracefile.c

index a7772d5daf40d10eee243350e5935daba6bd4f7b..7743cc9bbb0ae7f3d4e0d488c68c053ecb5461b9 100644 (file)
@@ -263,6 +263,7 @@ void ltt_event_position_set(LttEventPosition *ep,
 /*****************************************************************************
  * Function name
  *    ltt_event_position_compare : compare two positions
+ *    A NULL value is infinite.
  * Input params
  *    ep1                    : a pointer to event's position structure
  *    ep2                    : a pointer to event's position structure
@@ -278,6 +279,13 @@ gint ltt_event_position_compare(const LttEventPosition *ep1,
 {
   if(ep1->tf != ep2->tf)
     g_error("ltt_event_position_compare on different tracefiles makes no sense");
+  if(ep1 == NULL && ep2 == NULL)
+      return 0;
+  if(ep1 != NULL && ep2 == NULL)
+      return -1;
+  if(ep1 == NULL && ep2 != NULL)
+      return 1;
+    
   if(ep1->block_num < ep2->block_num)
     return -1;
   if(ep1->block_num > ep2->block_num)
@@ -305,8 +313,15 @@ gint ltt_event_position_compare(const LttEventPosition *ep1,
 gint ltt_event_event_position_compare(const LttEvent *event,
                                       const LttEventPosition *ep)
 {
-  g_assert(event->tracefile == ep->tf);
+  if(event == NULL && ep == NULL)
+      return 0;
+  if(event != NULL && ep == NULL)
+      return -1;
+  if(event == NULL && ep != NULL)
+      return 1;
 
+  g_assert(event->tracefile == ep->tf);
   if(event->which_block < ep->block_num)
     return -1;
   if(event->which_block > ep->block_num)
@@ -330,7 +345,10 @@ gint ltt_event_event_position_compare(const LttEvent *event,
 void ltt_event_position_copy(LttEventPosition *dest,
                              const LttEventPosition *src)
 {
-  *dest = *src;
+  if(src == NULL)
+    dest = NULL;
+  else
+    *dest = *src;
 }
 
 
index 2cce27608baaf2aaecf5969cdb72efdb6caf7482..dc1cb2201bdd4b809614954b49807e1cef81075b 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef LTT_TIME_H
 #define LTT_TIME_H
 
+#include <glib.h>
+
 
 typedef struct _LttTime {
   unsigned long tv_sec;
@@ -30,6 +32,7 @@ static const unsigned long NANOSECONDS_PER_SECOND = 1000000000;
 
 static const LttTime ltt_time_zero = { 0, 0};
 
+static const LttTime ltt_time_infinite = { G_MAXUINT, G_MAXUINT };
 
 static inline LttTime ltt_time_sub(LttTime t1, LttTime t2) 
 {
index 493ba559733031a5c7f930a291d23cb73eb44c57..efda5ce445f69caf6af5f65b82000ac1593ee237 100644 (file)
@@ -526,7 +526,8 @@ LttTrace *ltt_trace_open(const char *pathname)
   }
   
   //get control tracefile info
-  
+  getControlFileInfo(t,control);
+  /*
   if(getControlFileInfo(t,control)) {
     g_ptr_array_free(t->facilities, TRUE);
     g_ptr_array_free(t->per_cpu_tracefiles, TRUE);
@@ -535,7 +536,7 @@ LttTrace *ltt_trace_open(const char *pathname)
     g_free(t->pathname);
     g_free(t);
     return NULL;
-  }
+  }*/ // With fatal error
 
   //get cpu tracefile info
   if(getCpuFileInfo(t,cpu)) {
This page took 0.026418 seconds and 4 git commands to generate.