diff options
author | Mike Pall <mike> | 2012-11-15 00:21:01 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2012-11-15 00:26:34 +0100 |
commit | 16f23458bce22958e27176ca64f8df57c985cb1a (patch) | |
tree | 39b7f69943ccc81201c5c97ae6d5c939d050888e /doc | |
parent | 2689f32453eb891847d538a880c8adb6fbe2c5b5 (diff) | |
download | luajit-16f23458bce22958e27176ca64f8df57c985cb1a.tar.gz luajit-16f23458bce22958e27176ca64f8df57c985cb1a.tar.bz2 luajit-16f23458bce22958e27176ca64f8df57c985cb1a.zip |
FFI: Change priority of table initializer variants for structs.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ext_ffi_semantics.html | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html index bf9f9bee..30aa9648 100644 --- a/doc/ext_ffi_semantics.html +++ b/doc/ext_ffi_semantics.html | |||
@@ -517,17 +517,17 @@ A VLA is only initialized with the element(s) given in the table. | |||
517 | Depending on the use case, you may need to explicitly add a | 517 | Depending on the use case, you may need to explicitly add a |
518 | <tt>NULL</tt> or <tt>0</tt> terminator to a VLA.</li> | 518 | <tt>NULL</tt> or <tt>0</tt> terminator to a VLA.</li> |
519 | 519 | ||
520 | <li>If the table has a non-empty hash part, a | 520 | <li>A <tt>struct</tt>/<tt>union</tt> can be initialized in the |
521 | <tt>struct</tt>/<tt>union</tt> is initialized by looking up each field | ||
522 | name (as a string key) in the table. Each non-<tt>nil</tt> value is | ||
523 | used to initialize the corresponding field.</li> | ||
524 | |||
525 | <li>Otherwise a <tt>struct</tt>/<tt>union</tt> is initialized in the | ||
526 | order of the declaration of its fields. Each field is initialized with | 521 | order of the declaration of its fields. Each field is initialized with |
527 | the consecutive table elements, starting at either index <tt>[0]</tt> | 522 | consecutive table elements, starting at either index <tt>[0]</tt> |
528 | or <tt>[1]</tt>. This process stops at the first <tt>nil</tt> table | 523 | or <tt>[1]</tt>. This process stops at the first <tt>nil</tt> table |
529 | element.</li> | 524 | element.</li> |
530 | 525 | ||
526 | <li>Otherwise, if neither index <tt>[0]</tt> nor <tt>[1]</tt> is present, | ||
527 | a <tt>struct</tt>/<tt>union</tt> is initialized by looking up each field | ||
528 | name (as a string key) in the table. Each non-<tt>nil</tt> value is | ||
529 | used to initialize the corresponding field.</li> | ||
530 | |||
531 | <li>Uninitialized fields of a <tt>struct</tt> are filled with zero | 531 | <li>Uninitialized fields of a <tt>struct</tt> are filled with zero |
532 | bytes, except for the trailing VLA of a VLS.</li> | 532 | bytes, except for the trailing VLA of a VLS.</li> |
533 | 533 | ||