genevent compile fix for generated code
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 4 Dec 2005 01:30:21 +0000 (01:30 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 4 Dec 2005 01:30:21 +0000 (01:30 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1371 04897980-b3bd-0310-b5e0-8ef037075253

genevent-new/genevent.c

index 1f9a5e09fc4cbd8224c6292fd2dc242c9ebf8ae0..7c846bfafeeef281fc0f736c9e213baa1989eaa4 100644 (file)
@@ -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");
This page took 0.025725 seconds and 4 git commands to generate.