X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=types%2Fsequence.c;h=0e84b1d18ceb092fe28af8c45ce1eb8a9fcba23c;hp=ae91ef87798683b6958892d32fc331c3da09c0cb;hb=c462e188f3e7819c7bc74f671038cdbf36e8c3c0;hpb=518de31ce4f6ec7e12b81c9fed54e5af0ece7f4b diff --git a/types/sequence.c b/types/sequence.c index ae91ef87..0e84b1d1 100644 --- a/types/sequence.c +++ b/types/sequence.c @@ -16,10 +16,19 @@ * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include #include +#include #include static @@ -66,6 +75,11 @@ int sequence_rw(struct stream_pos *pos, struct definition *definition) *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; @@ -200,8 +214,8 @@ void _sequence_definition_free(struct definition *definition) field = g_ptr_array_index(sequence->elems, i); field->declaration->definition_free(field); } + (void) g_ptr_array_free(sequence->elems, TRUE); } - (void) g_ptr_array_free(sequence->elems, TRUE); definition_unref(len_definition); free_definition_scope(sequence->p.scope); declaration_unref(sequence->p.declaration);