From: Jérémie Galarneau Date: Tue, 12 Nov 2013 21:22:10 +0000 (-0500) Subject: Expose text arrays the same way as regular arrays X-Git-Tag: v1.2.0-rc1~52 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=5491476845938cd48837a072b0df55ffa7210e77;ds=sidebyside Expose text arrays the same way as regular arrays Store the content of text arrays both in the "elems" array and in a string. While it does duplicate the data, this makes it possible to access arrays containing UTF-8 or ASCII data the same way as regular arrays. Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/types/array.c b/formats/ctf/types/array.c index ea3ecfd8..04801d4f 100644 --- a/formats/ctf/types/array.c +++ b/formats/ctf/types/array.c @@ -56,8 +56,6 @@ int ctf_array_read(struct bt_stream_pos *ppos, struct bt_definition *definition) g_string_insert_len(array_definition->string, 0, (char *) ctf_get_pos_addr(pos), array_declaration->len); - ctf_move_pos(pos, array_declaration->len * CHAR_BIT); - return 0; } } } diff --git a/types/array.c b/types/array.c index c9b973bf..e4b43d8b 100644 --- a/types/array.c +++ b/types/array.c @@ -131,11 +131,6 @@ struct bt_definition * || integer_declaration->encoding == CTF_STRING_ASCII) { array->string = g_string_new(""); - - if (integer_declaration->len == CHAR_BIT - && integer_declaration->p.alignment == CHAR_BIT) { - return &array->p; - } } }