X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=types%2Fsequence.c;h=bd49d2a6507f116a5f916a423785761e06fd1cb5;hp=1066bc712d9a063a8cd489b6e5382105084a16c1;hb=b4b292cc76e04e9efda111e492251d8e7aefe451;hpb=a35173fe7e72fe456cbd19db34a5ff7a09a0c7ff diff --git a/types/sequence.c b/types/sequence.c index 1066bc71..bd49d2a6 100644 --- a/types/sequence.c +++ b/types/sequence.c @@ -3,7 +3,9 @@ * * BabelTrace - Sequence Type Converter * - * Copyright 2010, 2011 - Mathieu Desnoyers + * Copyright 2010-2011 EfficiOS Inc. and Linux Foundation + * + * Author: Mathieu Desnoyers * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -18,6 +20,7 @@ #include #include +#include #include static @@ -57,13 +60,18 @@ int sequence_rw(struct stream_pos *pos, struct definition *definition) str = g_string_new(""); g_string_printf(str, "[%" PRIu64 "]", i); - (void) g_string_free(str, TRUE); name = g_quark_from_string(str->str); + (void) g_string_free(str, TRUE); field = (struct definition **) &g_ptr_array_index(sequence_definition->elems, i); *field = sequence_declaration->elem->definition_new(sequence_declaration->elem, sequence_definition->p.scope, name, i, NULL); + } + for (i = 0; i < len; i++) { + struct definition **field; + + field = (struct definition **) &g_ptr_array_index(sequence_definition->elems, i); ret = generic_rw(pos, *field); if (ret) return ret;