mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
FFI: Clarify docs wrt. string initializers for byte arrays.
This commit is contained in:
parent
29e89adfa7
commit
e613cb7695
@ -461,8 +461,8 @@ when a single initializer is given. Otherwise they are treated like
|
||||
regular arrays.</li>
|
||||
|
||||
<li>Aggregate types (arrays and structs) accept either a single
|
||||
<a href="#init_table">table initializer</a> or a flat list of initializers.
|
||||
Byte arrays can be initialized with a Lua string, too.</li>
|
||||
<a href="#init_table">table initializer</a> or a flat list of
|
||||
initializers.</li>
|
||||
|
||||
<li>The elements of an array are initialized, starting at index zero.
|
||||
If a single initializer is given for an array, it's repeated for all
|
||||
@ -470,6 +470,10 @@ remaining elements. This doesn't happen if two or more initializers
|
||||
are given: all remaining uninitialized elements are filled with zero
|
||||
bytes.</li>
|
||||
|
||||
<li>Byte arrays may also be initialized with a Lua string. This copies
|
||||
the whole string plus a terminating zero-byte. The copy stops early only
|
||||
if the array has a known, fixed size.</li>
|
||||
|
||||
<li>The fields of a <tt>struct</tt> are initialized in the order of
|
||||
their declaration. Uninitialized fields are filled with zero
|
||||
bytes.</li>
|
||||
|
Loading…
Reference in New Issue
Block a user