genevent 0.5
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 12 Jan 2006 17:42:11 +0000 (17:42 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 12 Jan 2006 17:42:11 +0000 (17:42 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1473 04897980-b3bd-0310-b5e0-8ef037075253

genevent-new/genevent.c

index a691d48150be7f133c5c9c8ec0b763c1145b049f..aba40e528d204b411c2dcef8c54ec93d245b85e7 100644 (file)
@@ -1068,8 +1068,15 @@ int print_type_write_fct(type_descriptor_t * td, FILE *fd, unsigned int tabs,
 
        fprintf(fd, "{\n");
 
-       print_tabs(1, fd);
-       fprintf(fd, "size_t size;\n");
+       switch(td->type) {
+               case STRING:
+                       print_tabs(1, fd);
+                       fprintf(fd, "size_t size;\n");
+                       break;
+               default:
+                       break;
+       }
+
        print_tabs(1, fd);
        fprintf(fd, "size_t align;\n");
        fprintf(fd, "\n");
@@ -1126,11 +1133,9 @@ int print_type_write_fct(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                fprintf(fd, "/* Contains only fixed size fields : use compiler sizeof() */\n");
                fprintf(fd, "\n");
                print_tabs(1, fd);
-               fprintf(fd, "size = sizeof(");
+               fprintf(fd, "*len += sizeof(");
                if(print_type(td, fd, 0, basename, field_name)) return 1;
                fprintf(fd, ");\n");
-               print_tabs(1, fd);
-               fprintf(fd, "*len += size;\n");
        } else {
                /* The type contains nested variable size subtypes :
                 * we must write field by field. */
This page took 0.024935 seconds and 4 git commands to generate.