diff options
author | Wayne Meissner <wmeissner@gmail.com> | 2010-04-17 23:20:12 +1000 |
---|---|---|
committer | Wayne Meissner <wmeissner@gmail.com> | 2010-04-17 23:20:12 +1000 |
commit | da09b05dad77e85113a0fd5521023ac824b8afb8 (patch) | |
tree | 18bfb548217faaeace33f3fccfd1684217f982a8 /lib/ffi/struct_layout_builder.rb | |
parent | d2965e1b7faa74c869fe4ed119a3134683a43928 (diff) | |
download | ffi-da09b05dad77e85113a0fd5521023ac824b8afb8.tar.gz |
StructLayoutBuilder#store_field() does not need the type param, as StructLayout::Field as all the type info
Diffstat (limited to 'lib/ffi/struct_layout_builder.rb')
-rw-r--r-- | lib/ffi/struct_layout_builder.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ffi/struct_layout_builder.rb b/lib/ffi/struct_layout_builder.rb index 51174cf..26688fc 100644 --- a/lib/ffi/struct_layout_builder.rb +++ b/lib/ffi/struct_layout_builder.rb @@ -98,7 +98,7 @@ module FFI type end - store_field(name, field, type) + store_field(name, field) end @@ -124,11 +124,11 @@ module FFI end - def store_field(name, field, type) + def store_field(name, field) @field_names << name @field_map[name] = field - @alignment = @packed ? @packed : [ @alignment, type.alignment ].max - @size = [ @size, type.size + (@union ? 0 : field.offset) ].max + @alignment = @packed ? @packed : [ @alignment, field.alignment ].max + @size = [ @size, field.size + (@union ? 0 : field.offset) ].max end end |