From: Mathieu Desnoyers Date: Mon, 21 Feb 2011 21:27:20 +0000 (-0500) Subject: Babeltrace type: build warning cleanup X-Git-Tag: v0.1~195 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=be85c1c7633af07e35db7b415d6ee8447c30e80a Babeltrace type: build warning cleanup Signed-off-by: Mathieu Desnoyers --- diff --git a/types/array.c b/types/array.c index 43aee466..01483b52 100644 --- a/types/array.c +++ b/types/array.c @@ -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; } diff --git a/types/float.c b/types/float.c index abbd86d5..2ce6b592 100644 --- a/types/float.c +++ b/types/float.c @@ -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; } diff --git a/types/integer.c b/types/integer.c index bbbf4b3e..1e926f7b 100644 --- a/types/integer.c +++ b/types/integer.c @@ -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; diff --git a/types/sequence.c b/types/sequence.c index f6025af6..49671828 100644 --- a/types/sequence.c +++ b/types/sequence.c @@ -19,6 +19,10 @@ #include #include +#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; } diff --git a/types/string.c b/types/string.c index f81c1a7e..d38d3cf3 100644 --- a/types/string.c +++ b/types/string.c @@ -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; diff --git a/types/struct.c b/types/struct.c index a1bfbf43..d3e9f3c4 100644 --- a/types/struct.c +++ b/types/struct.c @@ -19,6 +19,10 @@ #include #include +#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; } diff --git a/types/types.c b/types/types.c index fbd1ed50..6fb3e598 100644 --- a/types/types.c +++ b/types/types.c @@ -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; }