slightly more accurate structure alignment code - I need to do proper
authorAndrew Tridgell <tridge@samba.org>
Wed, 19 Nov 2003 07:29:55 +0000 (07:29 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 19 Nov 2003 07:29:55 +0000 (07:29 +0000)
recursive alignment soon

source/build/pidl/parser.pm
source/build/pidl/util.pm

index 5a39903b8f2770ba9bd0ac8e71b2b460758f499d..e227d0d374aa39283f8aff0dbf331f15e3367dc3 100644 (file)
@@ -80,8 +80,7 @@ sub fn_prefix($)
 sub struct_alignment($)
 {
        my $s = shift;
-       # why do we need a minimum alignment of 4 ?? 
-       my $align = 4;
+       my $align = 1;
        for my $e (@{$s->{ELEMENTS}}) {
                if ($align < util::type_align($e)) {
                        $align = util::type_align($e);
index 67f97e647e8273125d6faa2409fdd6d4834d97f6..244a78af099206d1f765ad8b9b9be28a1dd8ea93 100644 (file)
@@ -214,7 +214,7 @@ sub type_align($)
     return 2, if ($type eq "wchar_t");
     return 4, if ($type eq "DATA_BLOB");
 
-    return 0;
+    return 4;
 }
 
 # this is used to determine if the ndr push/pull functions will need