Expose text arrays the same way as regular arrays
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 12 Nov 2013 21:22:10 +0000 (16:22 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 13 Nov 2013 02:57:17 +0000 (21:57 -0500)
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 <jeremie.galarneau@efficios.com>
formats/ctf/types/array.c
types/array.c

index ea3ecfd8a656d5db9b4f389ee1302b5b6b5926ca..04801d4f05455df71160f85b4cd0ed6d58c9d180 100644 (file)
@@ -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;
                        }
                }
        }
index c9b973bfa13a3d3719c9bdf1d07259c1d7880fa8..e4b43d8b5fe692f44eee37b11c7947229ca6356a 100644 (file)
@@ -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;
-                       }
                }
        }
 
This page took 0.033562 seconds and 4 git commands to generate.