From ac963fe3e5d898b6f0b14589fe9f94a4002574a8 Mon Sep 17 00:00:00 2001 From: compudj Date: Sun, 4 Dec 2005 01:30:21 +0000 Subject: [PATCH] genevent compile fix for generated code git-svn-id: http://ltt.polymtl.ca/svn@1371 04897980-b3bd-0310-b5e0-8ef037075253 --- genevent-new/genevent.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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"); -- 2.34.1