CTF float/types compile fixes
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 26 Feb 2011 21:01:55 +0000 (16:01 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 26 Feb 2011 21:01:55 +0000 (16:01 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/types/float.c
include/babeltrace/ctf/types.h
include/babeltrace/types.h

index 3651f0c3acf9c5338104ff1490489877e3967af9..000bc18361f2a081abcb2f7aa7825f3b1daafef2 100644 (file)
@@ -111,7 +111,7 @@ double ctf_double_read(struct stream_pos *srcp,
                       const struct type_class_float *float_class)
 {
        union doubleIEEE754 u;
-       struct type_class_float *dest_class = float_type_new(NULL,
+       struct type_class_float *dest_class = float_type_class_new(NULL,
                                DBL_MANT_DIG,
                                sizeof(double) * CHAR_BIT - DBL_MANT_DIG,
                                BYTE_ORDER,
@@ -121,7 +121,7 @@ double ctf_double_read(struct stream_pos *srcp,
        align_pos(srcp, float_class->p.alignment);
        init_pos(&destp, (char *) u.bits);
        _ctf_float_copy(&destp, dest_class, srcp, float_class);
-       float_type_free(dest_class);
+       type_class_unref(&dest_class->p);
        return u.v;
 }
 
@@ -130,7 +130,7 @@ void ctf_double_write(struct stream_pos *destp,
                      double v)
 {
        union doubleIEEE754 u;
-       struct type_class_float *src_class = float_type_new(NULL,
+       struct type_class_float *src_class = float_type_class_new(NULL,
                                DBL_MANT_DIG,
                                sizeof(double) * CHAR_BIT - DBL_MANT_DIG,
                                BYTE_ORDER,
@@ -141,14 +141,14 @@ void ctf_double_write(struct stream_pos *destp,
        align_pos(destp, float_class->p.alignment);
        init_pos(&srcp, (char *) u.bits);
        _ctf_float_copy(destp, float_class, &srcp, src_class);
-       float_type_free(src_class);
+       type_class_unref(&src_class->p);
 }
 
 long double ctf_ldouble_read(struct stream_pos *srcp,
                             const struct type_class_float *float_class)
 {
        union ldoubleIEEE754 u;
-       struct type_class_float *dest_class = float_type_new(NULL,
+       struct type_class_float *dest_class = float_type_class_new(NULL,
                                LDBL_MANT_DIG,
                                sizeof(long double) * CHAR_BIT - LDBL_MANT_DIG,
                                BYTE_ORDER,
@@ -158,7 +158,7 @@ long double ctf_ldouble_read(struct stream_pos *srcp,
        align_pos(srcp, float_class->p.alignment);
        init_pos(&destp, (char *) u.bits);
        _ctf_float_copy(&destp, dest_class, srcp, float_class);
-       float_type_free(dest_class);
+       type_class_unref(&dest_class->p);
        return u.v;
 }
 
@@ -167,7 +167,7 @@ void ctf_ldouble_write(struct stream_pos *destp,
                       long double v)
 {
        union ldoubleIEEE754 u;
-       struct type_class_float *src_class = float_type_new(NULL,
+       struct type_class_float *src_class = float_type_class_new(NULL,
                                LDBL_MANT_DIG,
                                sizeof(long double) * CHAR_BIT - LDBL_MANT_DIG,
                                BYTE_ORDER,
@@ -178,5 +178,5 @@ void ctf_ldouble_write(struct stream_pos *destp,
        align_pos(destp, float_class->p.alignment);
        init_pos(&srcp, (char *) u.bits);
        _ctf_float_copy(destp, float_class, &srcp, src_class);
-       float_type_free(src_class);
+       type_class_unref(&src_class->p);
 }
index c5ce9d2bddeb39676aa8a0c26bd44fd6be0207c2..6db8d27081848845a5674203ffc4f2a3fd0964a7 100644 (file)
@@ -74,6 +74,10 @@ void ctf_struct_begin(struct stream_pos *pos,
                      const struct type_class_struct *struct_class);
 void ctf_struct_end(struct stream_pos *pos,
                    const struct type_class_struct *struct_class);
+void ctf_variant_begin(struct stream_pos *pos,
+                      const struct type_class_variant *variant_class);
+void ctf_variant_end(struct stream_pos *pos,
+                    const struct type_class_variant *variant_class);
 void ctf_array_begin(struct stream_pos *pos,
                     const struct type_class_array *array_class);
 void ctf_array_end(struct stream_pos *pos,
index 242b905761b99b5695aa3d18fee40b57599cab2f..da2387d311853192dbc6885898a10a40505c407f 100644 (file)
@@ -87,6 +87,13 @@ char *get_pos_addr(struct stream_pos *pos)
 struct format;
 struct type;
 
+/* Type declaration scope */
+struct declaration_scope {
+       /* Hash table mapping type name GQuark to struct type_class */
+       GHashTable *type_classes;
+       struct declaration_scope *parent_scope;
+};
+
 struct type_class {
        GQuark name;            /* type name */
        size_t alignment;       /* type alignment, in bits */
@@ -277,13 +284,6 @@ struct type_sequence {
        struct field current_element;           /* struct field */
 };
 
-/* Type declaration scope */
-struct declaration_scope {
-       /* Hash table mapping type name GQuark to struct type_class */
-       GHashTable *type_classes;
-       struct declaration_scope *parent_scope;
-};
-
 struct type_class *lookup_type_class(GQuark qname,
                                     struct declaration_scope *scope);
 int register_type_class(struct type_class *type_class,
This page took 0.026656 seconds and 4 git commands to generate.