Add array and sequence "len" accessor
[babeltrace.git] / types / enum.c
index 3f7d46bd423127578fffa4e077a448c67eac01a7..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(struct declaration_integer *integer_declaration)
+       enum_declaration_new(struct declaration_integer *integer_declaration)
 {
        struct declaration_enum *enum_declaration;
 
@@ -403,8 +404,8 @@ 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;
This page took 0.023577 seconds and 4 git commands to generate.