get rid of LTTTypes.h
authoryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 30 Oct 2003 21:27:49 +0000 (21:27 +0000)
committeryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 30 Oct 2003 21:27:49 +0000 (21:27 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@328 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/include/ltt/LTTTypes.h [deleted file]
ltt/branches/poly/include/ltt/Makefile.am
ltt/branches/poly/include/ltt/ltt-private.h
ltt/branches/poly/include/ltt/ltt.h
ltt/branches/poly/ltt/event.c
ltt/branches/poly/ltt/facility.c
ltt/branches/poly/ltt/tracefile.c
ltt/branches/poly/ltt/type.c
ltt/branches/poly/lttv/modules/guiEvents.c

diff --git a/ltt/branches/poly/include/ltt/LTTTypes.h b/ltt/branches/poly/include/ltt/LTTTypes.h
deleted file mode 100644 (file)
index d33bf1b..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * LTTTypes.h
- *
- * Copyright (C) 2000 Karim Yaghmour (karym@opersys.com).
- *
- * This is distributed under GPL.
- *
- * Header for LTT-secific types.
- *
- * History : 
- *    K.Y.  07/09/2001, Added David Schleef's architecture independent ltt_set_bit/ltt_clear_bit/ltt_test_bit
- *    JAL,  05/01/2001, Modified PPC bit manipulation functions for x86 compatibility.
- *                      (andy_lowe@mvista.com)
- *    K.Y., 31/05/2000, Initial typing.
- */
-
-#ifndef __TRACE_TOOLKIT_TYPES_HEADER__
-#define __TRACE_TOOLKIT_TYPES_HEADER__
-
-#include <sys/types.h>
-#include <sys/time.h>
-
-#if defined(sun)
-
-typedef unsigned char          u_int8_t;
-typedef unsigned short         u_int16_t;
-typedef unsigned int           u_int32_t;
-#ifdef _LP64
-typedef unsigned long          u_int64_t;
-#else  /* _ILP32 */
-#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
-typedef unsigned long long     u_int64_t;
-#endif /* __STDC__ - 0 == 0 && !defined(_NO_LONGLONG) */
-#endif /* _LP64 */
-
-#endif /* defined(sun) */
-
-extern __inline__ int ltt_set_bit(int nr, void * addr)
-{
-  unsigned char *p = addr;
-  unsigned char mask = 1 << (nr&7);
-  unsigned char old;
-
-  p += nr>>3;
-  old = *p;
-  *p |= mask;
-  return ((old & mask) != 0);
-}
-
-extern __inline__ int ltt_clear_bit(int nr, void * addr)
-{
-  unsigned char *p = addr;
-  unsigned char mask = 1 << (nr&7);
-  unsigned char old;
-
-  p += nr>>3;
-  old = *p;
-  *p &= ~mask;
-  return ((old & mask) != 0);
-}
-
-extern __inline__ int ltt_test_bit(int nr,void *addr)
-{
-  unsigned char *p = addr;
-  unsigned char mask = 1 << (nr&7);
-  p += nr>>3;
-  return ((*p & mask) != 0);
-}
-
-/* Big-endian/little-endian conversion macros for cross-development. */
-#if TARGET_NATIVE
-/* For native development, these conversion macros aren't needed. */
-#define BREV16(x)   (x)
-#define BREV32(x)   (x)
-#define BREV64(x)   (x)
-#define RFT8(db,x)  (x)
-#define RFT16(db,x) (x)
-#define RFT32(db,x) (x)
-#define RFT64(db,x) (x)
-
-/* Non-native development */
-#else
-        /* BREV16: byte-reverse a 16-bit integer */
-#define BREV16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8))
-       /* BREV32: byte-reverse a 32-bit integer */
-#define BREV32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) \
-                | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
-       /* BREV64: byte-reverse a 64-bit integer */
-#define BREV64(x) ((((x) & 0xff00000000000000) >> 56) \
-                 | (((x) & 0x00ff000000000000) >> 40) \
-                | (((x) & 0x0000ff0000000000) >> 24) \
-                | (((x) & 0x000000ff00000000) >>  8) \
-                | (((x) & 0x00000000ff000000) <<  8) \
-                | (((x) & 0x0000000000ff0000) << 24) \
-                | (((x) & 0x000000000000ff00) << 40) \
-                | (((x) & 0x00000000000000ff) << 56))
-       /* RFTn: Read From Trace
-        *      Conditionally byte-reverse an 8-, 16-, 32-, or 64-bit integer
-        *      based on the value of the ByteRev member of the trace database
-        *      structure pointer passed as the first argument..
-        */
-#define RFT8(db,x)  (x)
-#define RFT16(db,x) ((db)->ByteRev ? BREV16(x) : (x))
-#define RFT32(db,x) ((db)->ByteRev ? BREV32(x) : (x))
-#define RFT64(db,x) ((db)->ByteRev ? BREV64(x) : (x))
-#endif /* TRACE_TARGET_NATIVE */
-
-#if !defined(sun)
-/* Some type corrections, just in case */
-#ifndef uint8_t
-#define uint8_t u_int8_t
-#endif
-#ifndef uint16_t
-#define uint16_t u_int16_t
-#endif
-#ifndef uint32_t
-#define uint32_t u_int32_t
-#endif
-#ifndef uint64_t
-#define uint64_t u_int64_t
-#endif
-#endif /* !defined(sun) */
-
-/* Structure packing */
-#if LTT_UNPACKED_STRUCTS
-#define LTT_PACKED_STRUCT
-#else
-#define LTT_PACKED_STRUCT __attribute__ ((packed))
-#endif /* UNPACKED_STRUCTS */
-
-/* Trace mask */
-typedef uint64_t trace_event_mask;
-
-/* Boolean stuff */ /* Now in glib */
-//#define TRUE  1
-//#define FALSE 0
-
-#endif /* __TRACE_TOOLKIT_TYPES_HEADER__ */
index be3e9f10bfd6ebd16622ac65f92ef4a628fde6a2..70065316b53458bff6c5e646dd6e384f274ea66b 100644 (file)
@@ -1,5 +1,4 @@
 lttinclude_HEADERS = \
-       LTTTypes.h\
        event.h\
        facility.h\
        ltt-private.h\
index c516bb49e56d4c40c4d129ec5b35000f6d988c0f..faf2baffe29a3d3e51a8be65ab755ca030029e18 100644 (file)
@@ -2,11 +2,13 @@
 #define LTT_PRIVATE_H
 
 #include <glib.h>
+#include <sys/types.h>
 #include <ltt/ltt.h>
-#include <ltt/LTTTypes.h>
 #include <ltt/type.h>
 #include <ltt/trace.h>
 
+#define LTT_PACKED_STRUCT __attribute__ ((packed))
+
 /* enumeration definition */
 
 typedef enum _BuildinEvent{
@@ -22,19 +24,19 @@ typedef enum _BuildinEvent{
 typedef struct _FacilityLoad{
   char * name;
   LttChecksum checksum;
-  uint32_t base_code;
+  guint32     base_code;
 } LTT_PACKED_STRUCT FacilityLoad;
 
 typedef struct _BlockStart {
   LttTime       time;       //Time stamp of this block
   LttCycleCount cycle_count; //cycle count of the event
-  uint32_t      block_id;    //block id 
+  guint32       block_id;    //block id 
 } LTT_PACKED_STRUCT BlockStart;
 
 typedef struct _BlockEnd {
   LttTime       time;       //Time stamp of this block
   LttCycleCount cycle_count; //cycle count of the event
-  uint32_t      block_id;    //block id 
+  guint32       block_id;    //block id 
 } LTT_PACKED_STRUCT BlockEnd;
 
 typedef struct _TimeHeartbeat {
@@ -97,8 +99,8 @@ struct _LttField{
 };
 
 struct _LttEvent{
-  uint16_t event_id;
-  uint32_t time_delta;
+  guint16  event_id;
+  guint32  time_delta;
   LttTime event_time;
   LttCycleCount event_cycle_count;
   LttTracefile * tracefile;
@@ -111,7 +113,7 @@ struct _LttFacility{
   char * name;               //facility name 
   int event_number;          //number of events in the facility 
   LttChecksum checksum;      //checksum of the facility 
-  uint32_t base_id;          //base id of the facility
+  guint32  base_id;          //base id of the facility
   LttEventType ** events;    //array of event types 
   LttType ** named_types;
   int  named_types_number;
@@ -171,8 +173,8 @@ struct _LttEventPosition{
 /*****************************************************************************
  macro for size of some data types
  *****************************************************************************/
-#define EVENT_ID_SIZE     sizeof(uint16_t)
-#define TIME_DELTA_SIZE   sizeof(uint32_t)
+#define EVENT_ID_SIZE     sizeof(guint16)
+#define TIME_DELTA_SIZE   sizeof(guint32)
 #define EVENT_HEADER_SIZE (EVENT_ID_SIZE + TIME_DELTA_SIZE)
 
 
index a5f3fee076c84496fd4a783b38a0b6ac45876a93..9e14dece46b4c1145ac5108b604daebfa30ce2e9 100644 (file)
@@ -2,7 +2,7 @@
 #define LTT_H
 
 #include <ltt/time.h>
-#include <ltt/LTTTypes.h>
+#include <glib.h>
 
 /* A trace is associated with a tracing session run on a single, possibly
    multi-cpu, system. It is defined as a pathname to a directory containing
@@ -83,7 +83,7 @@ typedef struct _TimeInterval{
 } TimeInterval;
 
 
-typedef uint64_t LttCycleCount;
+typedef guint64 LttCycleCount;
 
 
 /* Event positions are used to seek within a tracefile based on
index 46333ffbb4fb50df99703e1f69dfcfc3322ad806..9b3ff0d9984b63155baaf14ab3c6b54fa4c90c45 100644 (file)
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <asm/types.h>
 #include <linux/byteorder/swab.h>
-#include <ltt/LTTTypes.h> 
 #include "parser.h"
 #include <ltt/event.h>
 
@@ -337,17 +336,26 @@ unsigned ltt_event_get_unsigned(LttEvent *e, LttField *f)
     g_error("The type of the field is not unsigned int\n");
 
   if(f->field_size == 1){
-    uint8_t x = *(uint8_t*)(e->data + f->offset_root);
+    guint8 x = *(guint8 *)(e->data + f->offset_root);
     return (unsigned int) x;    
   }else if(f->field_size == 2){
-    uint16_t x = *(uint16_t*)(e->data + f->offset_root);
-    return (unsigned int) (revFlag ? BREV16(x): x);    
+    guint16 x = *(guint16 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (unsigned int) (revFlag ? GUINT16_FROM_BE(x): x);    
+    else
+      return (unsigned int) (revFlag ? GUINT16_FROM_LE(x): x);          
   }else if(f->field_size == 4){
-    uint32_t x = *(uint32_t*)(e->data + f->offset_root);
-    return (unsigned int) (revFlag ? BREV32(x): x);    
+    guint32 x = *(guint32 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (unsigned int) (revFlag ? GUINT32_FROM_BE(x): x);    
+    else
+      return (unsigned int) (revFlag ? GUINT32_FROM_LE(x): x);    
   }else if(f->field_size == 8){
-    uint64_t x = *(uint64_t*)(e->data + f->offset_root);
-    return (unsigned int) (revFlag ? BREV64(x): x);    
+    guint64 x = *(guint64 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (unsigned int) (revFlag ? GUINT64_FROM_BE(x): x);    
+    else
+      return (unsigned int) (revFlag ? GUINT64_FROM_LE(x): x);    
   }
 }
 
@@ -360,17 +368,26 @@ int ltt_event_get_int(LttEvent *e, LttField *f)
     g_error("The type of the field is not int\n");
 
   if(f->field_size == 1){
-    int8_t x = *(int8_t*)(e->data + f->offset_root);
+    gint8 x = *(gint8 *)(e->data + f->offset_root);
     return (int) x;    
   }else if(f->field_size == 2){
-    int16_t x = *(int16_t*)(e->data + f->offset_root);
-    return (int) (revFlag ? BREV16(x): x);    
+    gint16 x = *(gint16 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (int) (revFlag ? GINT16_FROM_BE(x): x);    
+    else
+      return (int) (revFlag ? GINT16_FROM_LE(x): x);    
   }else if(f->field_size == 4){
-    int32_t x = *(int32_t*)(e->data + f->offset_root);
-    return (int) (revFlag ? BREV32(x): x);    
+    gint32 x = *(gint32 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (int) (revFlag ? GINT32_FROM_BE(x): x);    
+    else
+      return (int) (revFlag ? GINT32_FROM_LE(x): x);    
   }else if(f->field_size == 8){
-    int64_t x = *(int64_t*)(e->data + f->offset_root);
-    return (int) (revFlag ? BREV64(x): x);    
+    gint64 x = *(gint64 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (int) (revFlag ? GINT64_FROM_BE(x): x);    
+    else
+      return (int) (revFlag ? GINT64_FROM_LE(x): x);    
   }
 }
 
@@ -384,17 +401,26 @@ unsigned long ltt_event_get_long_unsigned(LttEvent *e, LttField *f)
     g_error("The type of the field is not unsigned long\n");
 
   if(f->field_size == 1){
-    uint8_t x = *(uint8_t*)(e->data + f->offset_root);
+    guint8 x = *(guint8 *)(e->data + f->offset_root);
     return (unsigned long) x;    
   }else if(f->field_size == 2){
-    uint16_t x = *(uint16_t*)(e->data + f->offset_root);
-    return (unsigned long) (revFlag ? BREV16(x): x);    
+    guint16 x = *(guint16 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (unsigned long) (revFlag ? GUINT16_FROM_BE(x): x);  
+    else
+      return (unsigned long) (revFlag ? GUINT16_FROM_LE(x): x);    
   }else if(f->field_size == 4){
-    uint32_t x = *(uint32_t*)(e->data + f->offset_root);
-    return (unsigned long) (revFlag ? BREV32(x): x);    
+    guint32 x = *(guint32 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (unsigned long) (revFlag ? GUINT32_FROM_BE(x): x);    
+    else
+      return (unsigned long) (revFlag ? GUINT32_FROM_LE(x): x);    
   }else if(f->field_size == 8){
-    uint64_t x = *(uint64_t*)(e->data + f->offset_root);
-    return (unsigned long) (revFlag ? BREV64(x): x);    
+    guint64 x = *(guint64 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (unsigned long) (revFlag ? GUINT64_FROM_BE(x): x);    
+    else
+      return (unsigned long) (revFlag ? GUINT64_FROM_LE(x): x);    
   }
 }
 
@@ -407,17 +433,26 @@ long int ltt_event_get_long_int(LttEvent *e, LttField *f)
     g_error("The type of the field is not long int\n");
 
   if(f->field_size == 1){
-    int8_t x = *(int8_t*)(e->data + f->offset_root);
+    gint8 x = *(gint8 *)(e->data + f->offset_root);
     return (long) x;    
   }else if(f->field_size == 2){
-    int16_t x = *(int16_t*)(e->data + f->offset_root);
-    return (long) (revFlag ? BREV16(x): x);    
+    gint16 x = *(gint16 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (long) (revFlag ? GINT16_FROM_BE(x): x);    
+    else
+      return (long) (revFlag ? GINT16_FROM_LE(x): x);    
   }else if(f->field_size == 4){
-    int32_t x = *(int32_t*)(e->data + f->offset_root);
-    return (long) (revFlag ? BREV32(x): x);    
+    gint32 x = *(gint32 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (long) (revFlag ? GINT32_FROM_BE(x): x);    
+    else
+      return (long) (revFlag ? GINT32_FROM_LE(x): x);    
   }else if(f->field_size == 8){
-    int64_t x = *(int64_t*)(e->data + f->offset_root);
-    return (long) (revFlag ? BREV64(x): x);    
+    gint64 x = *(gint64 *)(e->data + f->offset_root);
+    if(e->tracefile->trace->my_arch_endian == LTT_LITTLE_ENDIAN)
+      return (long) (revFlag ? GINT64_FROM_BE(x): x);    
+    else
+      return (long) (revFlag ? GINT64_FROM_LE(x): x);    
   }
 }
 
@@ -432,7 +467,7 @@ float ltt_event_get_float(LttEvent *e, LttField *f)
 
   if(revFlag == 0) return *(float *)(e->data + f->offset_root);
   else{
-    uint32_t aInt;
+    guint32 aInt;
     memcpy((void*)&aInt, e->data + f->offset_root, 4);
     aInt = ___swab32(aInt);
     return *((float*)&aInt);
@@ -450,7 +485,7 @@ double ltt_event_get_double(LttEvent *e, LttField *f)
 
   if(revFlag == 0) return *(double *)(e->data + f->offset_root);
   else{
-    uint64_t aInt;
+    guint64 aInt;
     memcpy((void*)&aInt, e->data + f->offset_root, 8);
     aInt = ___swab64(aInt);
     return *((double *)&aInt);
index 3cd638d57f81cdc6ae359f0e00c42e440f556ce5..6d70d5728af3a1d7e0de8553433a80c1ff2f95b8 100644 (file)
@@ -2,7 +2,6 @@
 #include <string.h>
 #include <stdio.h>
 
-#include <ltt/LTTTypes.h>  
 #include "parser.h"
 #include <ltt/facility.h>
 
index 6186fc2ca5e70da0cfb75b8745b5fa3d7b53451e..ba8981e9f40f535b092f870ac61b5dbce8bcea50 100644 (file)
@@ -5,7 +5,6 @@
 #include <dirent.h>
 #include <linux/errno.h>  
 
-#include <ltt/LTTTypes.h>  
 #include "parser.h"
 #include <ltt/trace.h>
 
@@ -108,7 +107,7 @@ void ltt_tracefile_open_control(LttTrace *t, char * control_name)
   LttTracefile * tf;
   LttEvent * ev;
   LttFacility * f;
-  uint16_t evId;
+  guint16 evId;
   void * pos;
   FacilityLoad fLoad;
   int i;
@@ -128,7 +127,7 @@ void ltt_tracefile_open_control(LttTrace *t, char * control_name)
        pos = ev->data;
        fLoad.name = (char*)pos;
        fLoad.checksum = *(LttChecksum*)(pos + strlen(fLoad.name));
-       fLoad.base_code = *(uint32_t*)(pos + strlen(fLoad.name) + sizeof(LttChecksum));
+       fLoad.base_code = *(guint32 *)(pos + strlen(fLoad.name) + sizeof(LttChecksum));
 
        for(i=0;i<t->facility_number;i++){
          f = (LttFacility*)g_ptr_array_index(t->facilities,i);
@@ -856,14 +855,14 @@ LttEvent *ltt_tracefile_read(LttTracefile *t)
     if(err)g_error("Can not read tracefile");    
   }
 
-  lttEvent->event_id = (int)(*(uint16_t *)(t->cur_event_pos));
+  lttEvent->event_id = (int)(*(guint16 *)(t->cur_event_pos));
   if(lttEvent->event_id == TRACE_TIME_HEARTBEAT)
     t->cur_heart_beat_number++;
 
   t->prev_event_time  = t->current_event_time;
   //  t->current_event_time = getEventTime(t);
 
-  lttEvent->time_delta = *(uint32_t*)(t->cur_event_pos + EVENT_ID_SIZE);
+  lttEvent->time_delta = *(guint32 *)(t->cur_event_pos + EVENT_ID_SIZE);
   lttEvent->event_time = t->current_event_time;
 
   lttEvent->tracefile = t;
@@ -919,7 +918,7 @@ int readFile(int fd, void * buf, size_t size, char * mesg)
 int readBlock(LttTracefile * tf, int whichBlock)
 {
   off_t nbBytes;
-  uint32_t lostSize;
+  guint32 lostSize;
 
   if(whichBlock - tf->which_block == 1 && tf->which_block != 0){
     tf->prev_block_end_time = tf->a_block_end->time;
@@ -938,7 +937,7 @@ int readBlock(LttTracefile * tf, int whichBlock)
     return EIO;
 
   tf->a_block_start=(BlockStart *) (tf->buffer + EVENT_HEADER_SIZE);
-  lostSize = *(uint32_t*)(tf->buffer + tf->block_size - sizeof(uint32_t));
+  lostSize = *(guint32 *)(tf->buffer + tf->block_size - sizeof(guint32));
   tf->a_block_end=(BlockEnd *)(tf->buffer + tf->block_size - 
                                lostSize + EVENT_HEADER_SIZE); 
   tf->last_event_pos = tf->buffer + tf->block_size - lostSize;
@@ -991,7 +990,7 @@ int skipEvent(LttTracefile * t)
   LttEventType * evT;
   LttField * rootFld;
 
-  evId   = (int)(*(uint16_t *)(t->cur_event_pos));
+  evId   = (int)(*(guint16 *)(t->cur_event_pos));
   evData = t->cur_event_pos + EVENT_HEADER_SIZE;
 
   evT    = ltt_trace_eventtype_get(t->trace,(unsigned)evId);
@@ -1066,12 +1065,12 @@ LttTime getEventTime(LttTracefile * tf)
   LttCycleCount lEventTotalCycle; // Total cycles from start for event
   double        lEventNSec;       // Total usecs from start for event
   LttTime       lTimeOffset;      // Time offset in struct LttTime
-  uint16_t      evId;
-  int64_t       nanoSec, tmpCycleCount = (((uint64_t)1)<<32);
+  guint16       evId;
+  gint64        nanoSec, tmpCycleCount = (((guint64)1)<<32);
   static LttCycleCount preCycleCount = 0;
   static int   count = 0;
 
-  evId = *(uint16_t*)tf->cur_event_pos;
+  evId = *(guint16 *)tf->cur_event_pos;
   if(evId == TRACE_BLOCK_START){
     count = 0;
     preCycleCount = 0;
@@ -1085,7 +1084,7 @@ LttTime getEventTime(LttTracefile * tf)
   }
   
   // Calculate total time in cycles from start of buffer for this event
-  cycle_count = (LttCycleCount)*(uint32_t*)(tf->cur_event_pos + EVENT_ID_SIZE);
+  cycle_count = (LttCycleCount)*(guint32 *)(tf->cur_event_pos + EVENT_ID_SIZE);
   
   if(cycle_count < preCycleCount)count++;
   preCycleCount = cycle_count;
@@ -1273,11 +1272,11 @@ int getFieldtypeSize(LttTracefile * t, LttEventType * evT, int offsetRoot,
 
 int getIntNumber(int size, void *evD)
 {
-  int64_t i;
-  if(size == 1)      i = *(int8_t *)evD;
-  else if(size == 2) i = *(int16_t *)evD;
-  else if(size == 4) i = *(int32_t *)evD;
-  else if(size == 8) i = *(int64_t *)evD;
+  gint64 i;
+  if(size == 1)      i = *(gint8 *)evD;
+  else if(size == 2) i = *(gint16 *)evD;
+  else if(size == 4) i = *(gint32 *)evD;
+  else if(size == 8) i = *(gint64 *)evD;
  
   return (int) i;
 }
index a2c73f229c428f9c42822a6a9aa8892c7606d72c..be96a3c732c0f6333061ed3b057cea0a2b189036 100644 (file)
@@ -1,6 +1,5 @@
 #include <stdio.h>
 
-#include <ltt/LTTTypes.h> 
 #include "parser.h"
 #include <ltt/type.h>
 
index bd5668c31b064fe4d9abf5dd03a4eefda6caf431..ca7cd1355b21f69f85b10e8c99ee948b4aafc945 100644 (file)
@@ -1164,10 +1164,10 @@ gboolean update_current_time(void * hook_data, void * call_data)
 {
   EventViewerData *event_viewer_data = (EventViewerData*) hook_data;
   event_viewer_data->current_time = *(LttTime*)call_data;
-  uint64_t nsec = event_viewer_data->current_time.tv_sec * NANOSECONDS_PER_SECOND 
+  guint64 nsec = event_viewer_data->current_time.tv_sec * NANOSECONDS_PER_SECOND 
                   + event_viewer_data->current_time.tv_nsec;
   GtkTreeIter iter;
-  uint64_t time;
+  guint64 time;
   int count = 0;
   GtkTreeModel* model = (GtkTreeModel*)event_viewer_data->store_m;
 
This page took 0.032775 seconds and 4 git commands to generate.