diff options
author | Mike Pall <mike> | 2011-06-24 20:47:56 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-06-24 20:47:56 +0200 |
commit | e613cb769581aa686c1699e427d07998e860dfb9 (patch) | |
tree | 2a2df1fd529818853cc9894c04a94a92ff08b07f | |
parent | 29e89adfa74d4c14db67d2a267215e002f03e2ce (diff) | |
download | luajit-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.html | 8 |
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 | |||
461 | regular arrays.</li> | 461 | regular 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 |
465 | Byte arrays can be initialized with a Lua string, too.</li> | 465 | initializers.</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. |
468 | If a single initializer is given for an array, it's repeated for all | 468 | 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 | |||
470 | are given: all remaining uninitialized elements are filled with zero | 470 | are given: all remaining uninitialized elements are filled with zero |
471 | bytes.</li> | 471 | bytes.</li> |
472 | 472 | ||
473 | <li>Byte arrays may also be initialized with a Lua string. This copies | ||
474 | the whole string plus a terminating zero-byte. The copy stops early only | ||
475 | if 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 |
474 | their declaration. Uninitialized fields are filled with zero | 478 | their declaration. Uninitialized fields are filled with zero |
475 | bytes.</li> | 479 | bytes.</li> |