update quickstart
[lttv.git] / ltt / branches / poly / ltt / type.c
index 97a9593aad5a0a8bd3c36a0882b8dd1911f4d0bc..d650d35510f5ab07fb268a60b9b7a7cb4f882730 100644 (file)
@@ -1,19 +1,20 @@
 /* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Xiangxiu Yang, Mathieu Desnoyers
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *               2005 Mathieu Desnoyers
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License Version 2.1 as published by the Free Software Foundation.
  *
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, 
- * MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -140,15 +141,19 @@ LttTypeEnum ltt_type_class(LttType *t)
  *    returns 0 if erroneous, and show a critical warning message.
  ****************************************************************************/
 
-size_t ltt_type_size(LttTrace * trace, LttType *t)
+guint ltt_type_size(LttTrace * trace, LttType *t)
 {
-  size_t size;
+  guint size;
 
   switch(t->type_class) {
-
+    case LTT_INT_FIXED:
+    case LTT_UINT_FIXED:
+    case LTT_CHAR:
+    case LTT_UCHAR:
+    case LTT_SHORT:
+    case LTT_USHORT:
     case LTT_INT:
     case LTT_UINT:
-    case LTT_SEQUENCE:
     case LTT_ENUM:
       if(likely(t->size < INT_SIZES_NUMBER))
         size = intSizes[t->size];
@@ -166,11 +171,13 @@ size_t ltt_type_size(LttTrace * trace, LttType *t)
     case LTT_ULONG:
     case LTT_SIZE_T:
     case LTT_SSIZE_T:
+    case LTT_SEQUENCE:
     case LTT_OFF_T:
     case LTT_STRING:
     case LTT_ARRAY:
     case LTT_STRUCT:
     case LTT_UNION:
+    case LTT_NONE:
       goto error;
       break;
   }
@@ -370,7 +377,7 @@ int ltt_field_size(LttField * f)
 
 guint ltt_eventtype_num_fields(LttEventType *event_type)
 {
-  if(unlikely(!event_type)) return NULL;
+  if(unlikely(!event_type)) return 0;
 
   return event_type->fields->len;
   
This page took 0.02922 seconds and 4 git commands to generate.