deal with LTT_ALIGN (packed mode)
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 1 Dec 2005 20:41:06 +0000 (20:41 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 1 Dec 2005 20:41:06 +0000 (20:41 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1354 04897980-b3bd-0310-b5e0-8ef037075253

genevent-new/genevent.c

index 006c902fe721157a91bcc755497afbdd42efbe16..7f06edaa70fe8d0e5ed962ba4fcfedde72228cc2 100644 (file)
@@ -456,7 +456,8 @@ int print_type_declaration(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                        if(print_type(((field_t*)td->fields.array[1])->type,
                                                fd, tabs, basename, "")) return 1;
                        fprintf(fd, " *array;\n");
-                       fprintf(fd, "};\n");
+                       fprintf(fd, "};\n");    /* We do not LTT_ALIGN, because we never copy
+                                                                                                                        it to the buffer directly. */
                        fprintf(fd, "\n");
                break;
 
@@ -481,11 +482,10 @@ int print_type_declaration(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                                fprintf(fd, "%s", field->name);
                                fprintf(fd, ";\n");
                        }
-                       fprintf(fd, "};\n");
+                       fprintf(fd, "} LTT_ALIGN;\n");
                        fprintf(fd, "\n");
                        break;
        case UNION:
-                       /* TODO : Do not allow variable length fields in a union */
                        for(unsigned int i=0;i<td->fields.position;i++){
                                field_t *field = (field_t*)(td->fields.array[i]);
                                type_descriptor_t *type = field->type;
@@ -506,7 +506,7 @@ int print_type_declaration(type_descriptor_t * td, FILE *fd, unsigned int tabs,
                                fprintf(fd, "%s", field->name);
                                fprintf(fd, ";\n");
                        }
-                       fprintf(fd, "};\n");
+                       fprintf(fd, "} LTT_ALIGN;\n");
                        fprintf(fd, "\n");
                        break;
        default:
This page took 0.026447 seconds and 4 git commands to generate.