Babeltrace type: build warning cleanup
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 21 Feb 2011 21:27:20 +0000 (16:27 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 21 Feb 2011 21:27:20 +0000 (16:27 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
types/array.c
types/float.c
types/integer.c
types/sequence.c
types/string.c
types/struct.c
types/types.c

index 43aee466e26c6919a053a54d18dfb9f9e6f056d8..01483b520017e4fbfb84fd5800fbb029babdae46 100644 (file)
@@ -72,7 +72,7 @@ struct type_class_array *array_type_new(const char *name, size_t len,
        type_class->ref = 1;
 
        if (type_class->name) {
-               ret = ctf_register_type(type_class);
+               ret = register_type(type_class);
                if (ret)
                        goto error_register;
        }
index abbd86d5fb4d2aff1c0d5eb6da61f43b79eae216..2ce6b5929d50d5f5609ef1ee8c96787208acd9df 100644 (file)
@@ -59,7 +59,6 @@ struct type_class_float *float_type_new(const char *name,
                                        size_t alignment)
 {
        struct type_class_float *float_class;
-       struct type_class_integer *int_class;
        struct type_class *type_class;
        int ret;
 
@@ -87,7 +86,7 @@ struct type_class_float *float_type_new(const char *name,
                goto error_exp;
 
        if (float_class->p.name) {
-               ret = ctf_register_type(&float_class->p);
+               ret = register_type(&float_class->p);
                if (ret)
                        goto error_register;
        }
index bbbf4b3e0145da9e8c80d84b6e54db900de4cbfc..1e926f7b4041e4c4f19c0e745a010d0e62eb6e41 100644 (file)
@@ -71,7 +71,7 @@ struct type_class_integer *integer_type_new(const char *name,
        int_class->byte_order = byte_order;
        int_class->signedness = signedness;
        if (int_class->p.name) {
-               ret = ctf_register_type(&int_class->p);
+               ret = register_type(&int_class->p);
                if (ret) {
                        g_free(int_class);
                        return NULL;
index f6025af61b3470fdda7c43ff2e8feefbdfa373e1..4967182821d74a031fb7c4e5de6c51d18352cd4d 100644 (file)
 #include <babeltrace/compiler.h>
 #include <babeltrace/format.h>
 
+#ifndef max
+#define max(a, b)      ((a) < (b) ? (b) : (a))
+#endif
+
 void sequence_copy(struct stream_pos *dest, const struct format *fdest, 
                   struct stream_pos *src, const struct format *fsrc,
                   const struct type_class *type_class)
@@ -82,7 +86,7 @@ sequence_type_new(const char *name, struct type_class_integer *len_class,
        type_class->ref = 1;
 
        if (type_class->name) {
-               ret = ctf_register_type(type_class);
+               ret = register_type(type_class);
                if (ret)
                        goto error_register;
        }
index f81c1a7e62904ecb8339986181b50cd93d60da58..d38d3cf33b45a24920a1114e1555d0521f73bc00 100644 (file)
@@ -62,7 +62,7 @@ struct type_class_string *string_type_new(const char *name)
        string_class->p.free = _string_type_free;
        string_class->p.ref = 1;
        if (string_class->p.name) {
-               ret = ctf_register_type(&string_class->p);
+               ret = register_type(&string_class->p);
                if (ret) {
                        g_free(string_class);
                        return NULL;
index a1bfbf431055539b610791c221144c4dec6da4e4..d3e9f3c484cd11e88aeed88daeb4003a03623c5b 100644 (file)
 #include <babeltrace/compiler.h>
 #include <babeltrace/format.h>
 
+#ifndef max
+#define max(a, b)      ((a) < (b) ? (b) : (a))
+#endif
+
 void struct_copy(struct stream_pos *dest, const struct format *fdest, 
                 struct stream_pos *src, const struct format *fsrc,
                 const struct type_class *type_class)
@@ -85,7 +89,7 @@ struct type_class_struct *struct_type_new(const char *name)
        type_class->ref = 1;
 
        if (type_class->name) {
-               ret = ctf_register_type(type_class);
+               ret = register_type(type_class);
                if (ret)
                        goto error_register;
        }
index fbd1ed50bb26b621ce06c852bef68a8f6bcf434a..6fb3e5989269e11b029f7494d0d53a2d08e7ff76 100644 (file)
@@ -42,7 +42,7 @@ static void free_type(struct type_class *type_class)
 
 int register_type(struct type_class *type_class)
 {
-       if (ctf_lookup_type_class(type_class->name))
+       if (lookup_type(type_class->name))
                return -EEXIST;
 
        g_hash_table_insert(type_classes,
@@ -74,4 +74,5 @@ int init_types(void)
 int finalize_types(void)
 {
        g_hash_table_destroy(type_classes);
+       return 0;
 }
This page took 0.039704 seconds and 4 git commands to generate.