]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Clarify docs wrt. string initializers for byte arrays.
authorMike Pall <mike>
Fri, 24 Jun 2011 18:47:56 +0000 (20:47 +0200)
committerMike Pall <mike>
Fri, 24 Jun 2011 18:47:56 +0000 (20:47 +0200)
doc/ext_ffi_semantics.html

index aff7e16256a1a17886944176bd89cbcdf05bac05..ab394742789398e3a81f57c62a52776647d4dfc9 100644 (file)
@@ -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>