From a6cf49812d3a703cdd9d958497476238d2150ac9 Mon Sep 17 00:00:00 2001 From: compudj Date: Fri, 11 Nov 2005 19:44:07 +0000 Subject: [PATCH] size known for alignment after variable length field git-svn-id: http://ltt.polymtl.ca/svn@1323 04897980-b3bd-0310-b5e0-8ef037075253 --- genevent-new/gentest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genevent-new/gentest.c b/genevent-new/gentest.c index b0908ccf..a918d541 100644 --- a/genevent-new/gentest.c +++ b/genevent-new/gentest.c @@ -222,7 +222,7 @@ static inline void lttng_write_sequence_mystruct_mysequence( *to = ltt_align(*to, sizeof(void *)); *to_base = *to_base+*to; *to = 0; - + /* Put source *from just after the C sequence */ *from = obj+1; } @@ -390,11 +390,11 @@ static inline void lttng_write_mystruct( /* Variable length field */ lttng_write_sequence_mystruct_mysequence(to_base, to, from, len, &obj->mysequence); + *to = 0; /* Force the compiler to know it's 0 */ /* After this previous write, we are sure that *to is 0, and *to_base is * aligned on the architecture size : to rest of alignment will be calculated * statically. */ - lttng_write_mystruct_myunion(to_base, to, from, len, &obj->myunion); /* Don't forget to flush last write..... */ -- 2.34.1