Add array and sequence "len" accessor
[babeltrace.git] / types / enum.c
index 36e310b0d80ede1ef07b410d21231dccc161ef34..368c21a6910187dc8d6e9ce45dd80fc547b2757a 100644 (file)
@@ -371,7 +371,8 @@ void enum_copy(struct stream_pos *dest, const struct format *fdest,
         * now to test enum read and write code.
         */
        v = g_array_index(array, GQuark, 0);
-       return fdest->enum_write(dest, enum_declaration, v);
+       if (fdest)
+               fdest->enum_write(dest, enum_declaration, v);
 }
 
 static
@@ -392,7 +393,7 @@ void _enum_declaration_free(struct declaration *declaration)
 }
 
 struct declaration_enum *
-       _enum_declaration_new(const char *name, struct declaration_integer *integer_declaration)
+       enum_declaration_new(struct declaration_integer *integer_declaration)
 {
        struct declaration_enum *enum_declaration;
 
@@ -403,13 +404,12 @@ struct declaration_enum *
                                                            enum_val_free,
                                                            enum_range_set_free);
        CDS_INIT_LIST_HEAD(&enum_declaration->table.range_to_quark);
-       enum_declaration->table.quark_to_range_set = g_hash_table_new_full(g_int_hash,
-                                                       g_int_equal,
+       enum_declaration->table.quark_to_range_set = g_hash_table_new_full(g_direct_hash,
+                                                       g_direct_equal,
                                                        NULL, enum_range_set_free);
        declaration_ref(&integer_declaration->p);
        enum_declaration->integer_declaration = integer_declaration;
        enum_declaration->p.id = CTF_TYPE_ENUM;
-       enum_declaration->p.name = g_quark_from_string(name);
        enum_declaration->p.alignment = 1;
        enum_declaration->p.copy = enum_copy;
        enum_declaration->p.declaration_free = _enum_declaration_free;
This page took 0.028092 seconds and 4 git commands to generate.