From: compudj Date: Sun, 4 Dec 2005 01:30:21 +0000 (+0000) Subject: genevent compile fix for generated code X-Git-Tag: v0.12.20~2118 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ac963fe3e5d898b6f0b14589fe9f94a4002574a8;p=lttv.git genevent compile fix for generated code git-svn-id: http://ltt.polymtl.ca/svn@1371 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/genevent-new/genevent.c b/genevent-new/genevent.c index 1f9a5e09..7c846bfa 100644 --- a/genevent-new/genevent.c +++ b/genevent-new/genevent.c @@ -1256,10 +1256,6 @@ int print_event_logging_function(char *basename, facility_t *fac, print_tabs(1, fd); fprintf(fd, "size_t *to = &real_to;\n"); print_tabs(1, fd); - fprintf(fd, "const void *real_from;\n"); - print_tabs(1, fd); - fprintf(fd, "const void **from = &real_from;\n"); - print_tabs(1, fd); fprintf(fd, "size_t real_len = 0;\n"); print_tabs(1, fd); fprintf(fd, "size_t *len = &real_len;\n"); @@ -1268,8 +1264,14 @@ int print_event_logging_function(char *basename, facility_t *fac, print_tabs(1, fd); fprintf(fd, "size_t slot_size;\n"); print_tabs(1, fd); - fprintf(fd, "size_t size;\n"); - print_tabs(1, fd); + if(event->fields.position > 0) { + fprintf(fd, "size_t size;\n"); + print_tabs(1, fd); + fprintf(fd, "const void *real_from;\n"); + print_tabs(1, fd); + fprintf(fd, "const void **from = &real_from;\n"); + print_tabs(1, fd); + } fprintf(fd, "cycles_t tsc;\n"); print_tabs(1, fd); fprintf(fd, "size_t before_hdr_pad, after_hdr_pad, header_size;\n");