aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Pall <mike>2012-11-15 00:21:01 +0100
committerMike Pall <mike>2012-11-15 00:26:34 +0100
commit16f23458bce22958e27176ca64f8df57c985cb1a (patch)
tree39b7f69943ccc81201c5c97ae6d5c939d050888e /doc
parent2689f32453eb891847d538a880c8adb6fbe2c5b5 (diff)
downloadluajit-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.html14
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.
517Depending on the use case, you may need to explicitly add a 517Depending 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
522name (as a string key) in the table. Each non-<tt>nil</tt> value is
523used to initialize the corresponding field.</li>
524
525<li>Otherwise a <tt>struct</tt>/<tt>union</tt> is initialized in the
526order of the declaration of its fields. Each field is initialized with 521order of the declaration of its fields. Each field is initialized with
527the consecutive table elements, starting at either index <tt>[0]</tt> 522consecutive table elements, starting at either index <tt>[0]</tt>
528or <tt>[1]</tt>. This process stops at the first <tt>nil</tt> table 523or <tt>[1]</tt>. This process stops at the first <tt>nil</tt> table
529element.</li> 524element.</li>
530 525
526<li>Otherwise, if neither index <tt>[0]</tt> nor <tt>[1]</tt> is present,
527a <tt>struct</tt>/<tt>union</tt> is initialized by looking up each field
528name (as a string key) in the table. Each non-<tt>nil</tt> value is
529used 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
532bytes, except for the trailing VLA of a VLS.</li> 532bytes, except for the trailing VLA of a VLS.</li>
533 533