X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=types%2Farray.c;h=f592dba1ebdf9905cf3230586aaf990d0db9556c;hb=4d5678b9fb576c6235e7daa67a8d34a293bd9217;hp=cd7b31bf2724e8aedab636be99dd0cc0bcc1133f;hpb=d11e9c4975d88591e2324b6b11f426a22995833f;p=babeltrace.git diff --git a/types/array.c b/types/array.c index cd7b31bf..f592dba1 100644 --- a/types/array.c +++ b/types/array.c @@ -27,20 +27,24 @@ struct definition *_array_definition_new(struct declaration *declaration, static void _array_definition_free(struct definition *definition); -void array_rw(struct stream_pos *pos, struct definition *definition) +int array_rw(struct stream_pos *pos, struct definition *definition) { struct definition_array *array_definition = container_of(definition, struct definition_array, p); const struct declaration_array *array_declaration = array_definition->declaration; uint64_t i; + int ret; /* No need to align, because the first field will align itself. */ for (i = 0; i < array_declaration->len; i++) { struct definition *elem = g_array_index(array_definition->elems, struct field, i).definition; - generic_rw(pos, elem); + ret = generic_rw(pos, elem); + if (ret) + return ret; } + return 0; } static