From 16f23458bce22958e27176ca64f8df57c985cb1a Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Thu, 15 Nov 2012 00:21:01 +0100 Subject: FFI: Change priority of table initializer variants for structs. --- doc/ext_ffi_semantics.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'doc') 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. Depending on the use case, you may need to explicitly add a NULL or 0 terminator to a VLA. -
  • If the table has a non-empty hash part, a -struct/union is initialized by looking up each field -name (as a string key) in the table. Each non-nil value is -used to initialize the corresponding field.
  • - -
  • Otherwise a struct/union is initialized in the +
  • A struct/union can be initialized in the order of the declaration of its fields. Each field is initialized with -the consecutive table elements, starting at either index [0] +consecutive table elements, starting at either index [0] or [1]. This process stops at the first nil table element.
  • +
  • Otherwise, if neither index [0] nor [1] is present, +a struct/union is initialized by looking up each field +name (as a string key) in the table. Each non-nil value is +used to initialize the corresponding field.
  • +
  • Uninitialized fields of a struct are filled with zero bytes, except for the trailing VLA of a VLS.
  • -- cgit v1.2.3-55-g6feb