diff options
| -rw-r--r-- | lapi.c | 3 | ||||
| -rw-r--r-- | ldo.c | 2 | ||||
| -rw-r--r-- | lstate.h | 2 | ||||
| -rw-r--r-- | manual/manual.of | 34 |
4 files changed, 23 insertions, 18 deletions
| @@ -671,9 +671,8 @@ static int auxgetstr (lua_State *L, const TValue *t, const char *k) { | |||
| 671 | lu_byte tag; | 671 | lu_byte tag; |
| 672 | TString *str = luaS_new(L, k); | 672 | TString *str = luaS_new(L, k); |
| 673 | luaV_fastget(t, str, s2v(L->top.p), luaH_getstr, tag); | 673 | luaV_fastget(t, str, s2v(L->top.p), luaH_getstr, tag); |
| 674 | if (!tagisempty(tag)) { | 674 | if (!tagisempty(tag)) |
| 675 | api_incr_top(L); | 675 | api_incr_top(L); |
| 676 | } | ||
| 677 | else { | 676 | else { |
| 678 | setsvalue2s(L, L->top.p, str); | 677 | setsvalue2s(L, L->top.p, str); |
| 679 | api_incr_top(L); | 678 | api_incr_top(L); |
| @@ -367,7 +367,7 @@ void luaD_shrinkstack (lua_State *L) { | |||
| 367 | luaD_reallocstack(L, nsize, 0); /* ok if that fails */ | 367 | luaD_reallocstack(L, nsize, 0); /* ok if that fails */ |
| 368 | } | 368 | } |
| 369 | else /* don't change stack */ | 369 | else /* don't change stack */ |
| 370 | condmovestack(L,{},{}); /* (change only for debugging) */ | 370 | condmovestack(L,(void)0,(void)0); /* (change only for debugging) */ |
| 371 | luaE_shrinkCI(L); /* shrink CI list */ | 371 | luaE_shrinkCI(L); /* shrink CI list */ |
| 372 | } | 372 | } |
| 373 | 373 | ||
| @@ -186,7 +186,7 @@ typedef struct stringtable { | |||
| 186 | */ | 186 | */ |
| 187 | struct CallInfo { | 187 | struct CallInfo { |
| 188 | StkIdRel func; /* function index in the stack */ | 188 | StkIdRel func; /* function index in the stack */ |
| 189 | StkIdRel top; /* top for this function */ | 189 | StkIdRel top; /* top for this function */ |
| 190 | struct CallInfo *previous, *next; /* dynamic call link */ | 190 | struct CallInfo *previous, *next; /* dynamic call link */ |
| 191 | union { | 191 | union { |
| 192 | struct { /* only for Lua functions */ | 192 | struct { /* only for Lua functions */ |
diff --git a/manual/manual.of b/manual/manual.of index a441cea1..bb95148a 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
| @@ -1428,7 +1428,7 @@ except inside nested functions. | |||
| 1428 | A goto can jump to any visible label as long as it does not | 1428 | A goto can jump to any visible label as long as it does not |
| 1429 | enter into the scope of a local variable. | 1429 | enter into the scope of a local variable. |
| 1430 | A label should not be declared | 1430 | A label should not be declared |
| 1431 | where a label with the same name is visible, | 1431 | where a previous label with the same name is visible, |
| 1432 | even if this other label has been declared in an enclosing block. | 1432 | even if this other label has been declared in an enclosing block. |
| 1433 | 1433 | ||
| 1434 | The @Rw{break} statement terminates the execution of a | 1434 | The @Rw{break} statement terminates the execution of a |
| @@ -3835,7 +3835,7 @@ This macro may evaluate its arguments more than once. | |||
| 3835 | 3835 | ||
| 3836 | Converts the number at acceptable index @id{idx} to a string | 3836 | Converts the number at acceptable index @id{idx} to a string |
| 3837 | and puts the result in @id{buff}. | 3837 | and puts the result in @id{buff}. |
| 3838 | The buffer must have a size of at least @Lid{LUA_N2SBUFFSZ} bytes. | 3838 | The buffer must have a size of at least @defid{LUA_N2SBUFFSZ} bytes. |
| 3839 | The conversion follows a non-specified format @see{coercion}. | 3839 | The conversion follows a non-specified format @see{coercion}. |
| 3840 | The function returns the number of bytes written to the buffer | 3840 | The function returns the number of bytes written to the buffer |
| 3841 | (including the final zero), | 3841 | (including the final zero), |
| @@ -3997,25 +3997,22 @@ Lua will call @id{falloc} before raising the error. | |||
| 3997 | 3997 | ||
| 3998 | Pushes onto the stack a formatted string | 3998 | Pushes onto the stack a formatted string |
| 3999 | and returns a pointer to this string @see{constchar}. | 3999 | and returns a pointer to this string @see{constchar}. |
| 4000 | It is similar to the @ANSI{sprintf}, | 4000 | The result is a copy of @id{fmt} with |
| 4001 | but has two important differences. | 4001 | each @emph{conversion specifier} replaced by its respective |
| 4002 | First, | 4002 | extra argument. |
| 4003 | you do not have to allocate space for the result; | 4003 | A conversion specifier can be |
| 4004 | the result is a Lua string and Lua takes care of memory allocation | ||
| 4005 | (and deallocation, through garbage collection). | ||
| 4006 | Second, | ||
| 4007 | the conversion specifiers are quite restricted. | ||
| 4008 | There are no flags, widths, or precisions. | ||
| 4009 | The conversion specifiers can only be | ||
| 4010 | @Char{%%} (inserts the character @Char{%}), | 4004 | @Char{%%} (inserts the character @Char{%}), |
| 4011 | @Char{%s} (inserts a zero-terminated string, with no size restrictions), | 4005 | @Char{%s} (inserts a zero-terminated string, with no size restrictions), |
| 4012 | @Char{%f} (inserts a @Lid{lua_Number}), | 4006 | @Char{%f} (inserts a @Lid{lua_Number}), |
| 4013 | @Char{%I} (inserts a @Lid{lua_Integer}), | 4007 | @Char{%I} (inserts a @Lid{lua_Integer}), |
| 4014 | @Char{%p} (inserts a pointer), | 4008 | @Char{%p} (inserts a void pointer), |
| 4015 | @Char{%d} (inserts an @T{int}), | 4009 | @Char{%d} (inserts an @T{int}), |
| 4016 | @Char{%c} (inserts an @T{int} as a one-byte character), and | 4010 | @Char{%c} (inserts an @T{int} as a one-byte character), and |
| 4017 | @Char{%U} (inserts an @T{unsigned long} as a @x{UTF-8} byte sequence). | 4011 | @Char{%U} (inserts an @T{unsigned long} as a @x{UTF-8} byte sequence). |
| 4018 | 4012 | ||
| 4013 | Every occurrence of @Char{%} in the string @id{fmt} | ||
| 4014 | must form a valid conversion specifier. | ||
| 4015 | |||
| 4019 | } | 4016 | } |
| 4020 | 4017 | ||
| 4021 | @APIEntry{void lua_pushglobaltable (lua_State *L);| | 4018 | @APIEntry{void lua_pushglobaltable (lua_State *L);| |
| @@ -4413,7 +4410,7 @@ for the @Q{newindex} event @see{metatable}. | |||
| 4413 | @APIEntry{void lua_settop (lua_State *L, int index);| | 4410 | @APIEntry{void lua_settop (lua_State *L, int index);| |
| 4414 | @apii{?,?,e} | 4411 | @apii{?,?,e} |
| 4415 | 4412 | ||
| 4416 | Accepts any index, @N{or 0}, | 4413 | Receives any acceptable stack index, @N{or 0}, |
| 4417 | and sets the stack top to this index. | 4414 | and sets the stack top to this index. |
| 4418 | If the new top is greater than the old one, | 4415 | If the new top is greater than the old one, |
| 4419 | then the new elements are filled with @nil. | 4416 | then the new elements are filled with @nil. |
| @@ -9428,6 +9425,15 @@ Moreover, there were some changes in the parameters themselves. | |||
| 9428 | @itemize{ | 9425 | @itemize{ |
| 9429 | 9426 | ||
| 9430 | @item{ | 9427 | @item{ |
| 9428 | In @Lid{lua_call} and related functions, | ||
| 9429 | the maximum value for the number of required results | ||
| 9430 | (@id{nresults}) is 250. | ||
| 9431 | If you really need a larger value, | ||
| 9432 | use @Lid{LUA_MULTRET} and then adjust the stack size. | ||
| 9433 | Previously, this limit was unspecified. | ||
| 9434 | } | ||
| 9435 | |||
| 9436 | @item{ | ||
| 9431 | @Lid{lua_newstate} has a third parameter, | 9437 | @Lid{lua_newstate} has a third parameter, |
| 9432 | a seed for the hashing of strings. | 9438 | a seed for the hashing of strings. |
| 9433 | } | 9439 | } |
