aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2011-06-24 20:47:56 +0200
committerMike Pall <mike>2011-06-24 20:47:56 +0200
commite613cb769581aa686c1699e427d07998e860dfb9 (patch)
tree2a2df1fd529818853cc9894c04a94a92ff08b07f
parent29e89adfa74d4c14db67d2a267215e002f03e2ce (diff)
downloadluajit-e613cb769581aa686c1699e427d07998e860dfb9.tar.gz
luajit-e613cb769581aa686c1699e427d07998e860dfb9.tar.bz2
luajit-e613cb769581aa686c1699e427d07998e860dfb9.zip
FFI: Clarify docs wrt. string initializers for byte arrays.
-rw-r--r--doc/ext_ffi_semantics.html8
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html
index aff7e162..ab394742 100644
--- a/doc/ext_ffi_semantics.html
+++ b/doc/ext_ffi_semantics.html
@@ -461,8 +461,8 @@ when a single initializer is given. Otherwise they are treated like
461regular arrays.</li> 461regular arrays.</li>
462 462
463<li>Aggregate types (arrays and structs) accept either a single 463<li>Aggregate types (arrays and structs) accept either a single
464<a href="#init_table">table initializer</a> or a flat list of initializers. 464<a href="#init_table">table initializer</a> or a flat list of
465Byte arrays can be initialized with a Lua string, too.</li> 465initializers.</li>
466 466
467<li>The elements of an array are initialized, starting at index zero. 467<li>The elements of an array are initialized, starting at index zero.
468If a single initializer is given for an array, it's repeated for all 468If 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
470are given: all remaining uninitialized elements are filled with zero 470are given: all remaining uninitialized elements are filled with zero
471bytes.</li> 471bytes.</li>
472 472
473<li>Byte arrays may also be initialized with a Lua string. This copies
474the whole string plus a terminating zero-byte. The copy stops early only
475if the array has a known, fixed size.</li>
476
473<li>The fields of a <tt>struct</tt> are initialized in the order of 477<li>The fields of a <tt>struct</tt> are initialized in the order of
474their declaration. Uninitialized fields are filled with zero 478their declaration. Uninitialized fields are filled with zero
475bytes.</li> 479bytes.</li>