From 5491476845938cd48837a072b0df55ffa7210e77 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 12 Nov 2013 16:22:10 -0500 Subject: [PATCH] Expose text arrays the same way as regular arrays MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- formats/ctf/types/array.c | 2 -- types/array.c | 5 ----- 2 files changed, 7 deletions(-) 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; - } } } -- 2.34.1