Commit Graph

26 Commits

Author SHA1 Message Date
Roberto Ierusalimschy
deac067ed3 Avoid overflows when incrementing parameters in C
Any C function can receive maxinteger as an integer argument, and
therefore cannot increment it without some care (e.g., doing unsigned
arithmetic as the core does).
2021-09-22 13:10:39 -03:00
Roberto Ierusalimschy
aa8d4a782d Details (more uniformity in error messages) 2020-05-27 11:46:47 -03:00
Roberto Ierusalimschy
9e0a8475cd Added 'simplesect' sections to the manual
'simplesect' encloses the introductory text of sections with
subsections, so that each section either is all text or is all
subsections. (This commit also corrects a small brace error in the
manual and extra spaces/tabs in some other files.)
2020-04-13 13:42:40 -03:00
Roberto Ierusalimschy
b96b0b5abb Added macro 'luaL_pushfail'
The macro 'luaL_pushfail' documents all places in the standard libraries
that return nil to signal some kind of failure. It is defined as
'lua_pushnil'. The manual also got a notation (@fail) to document those
returns. The tests were changed to be agnostic regarding whether 'fail'
is 'nil' or 'false'.
2019-08-16 14:58:02 -03:00
Roberto Ierusalimschy
279c3a6961 A few changes in tests about number of bits in integers
- The preprocessor must work with at least 'long', and therefore must
do shifts of up to 31 bits correctly.
- Whenever possible, use unsigned types in shifts.
2019-05-13 16:17:21 -03:00
Roberto Ierusalimschy
49c42f3615 Some improvements in 'luaconf.h'
Added '#if !defined' in some definitions to allow external definitions;
more comments; other small changes.
2019-05-13 14:24:10 -03:00
Roberto Ierusalimschy
39bb3cf242 Name 'nonstrict' in the UTF-8 library changed to 'lax'
It is not a good idea to use negative words to describe boolean
values. (When we negate that boolean we create a double negative...)
2019-03-19 11:15:49 -03:00
Roberto Ierusalimschy
1e0c73d5b6 Changes in the validation of UTF-8
All UTF-8 encoding functionality (including the escape
sequence '\u') accepts all values from the original UTF-8
specification (with sequences of up to six bytes).

By default, the decoding functions in the UTF-8 library do not
accept invalid Unicode code points, such as surrogates. A new
parameter 'nonstrict' makes them accept all code points up to
(2^31)-1, as in the original UTF-8 specification.
2019-03-15 13:14:17 -03:00
Roberto Ierusalimschy
fb18346ddd Avoid using 'int' for UTF-8 values
An 'int' may have only 16 bits, so it may not be big enough for UTF-8
values. The new type 'utfint' (in the utf8 library) ensures at least
21 bits for those values.
2018-07-12 15:56:44 -03:00
Roberto Ierusalimschy
1a1b2f3d7f added 'return' to calls to 'luaL_error' (to signal to the compiler
that the function cannot continue past that call)
2017-03-14 09:40:44 -03:00
Roberto Ierusalimschy
2a235312f0 detail (removing spaces at end of lines) 2016-12-22 11:08:50 -02:00
Roberto Ierusalimschy
f2a813ae10 details (avoid some 'lint' warnings) 2015-03-28 16:16:55 -03:00
Roberto Ierusalimschy
297512b34c avoid using 'lua_pushliteral' in a non-zero-terminated string 2015-03-05 13:07:46 -03:00
Roberto Ierusalimschy
28fdbcf393 added include for 'lprefix.h', for stuff that must be added before
any other header file
2014-11-02 17:19:04 -02:00
Roberto Ierusalimschy
745618d941 'charpatt' -> 'charpattern' 2014-10-15 11:31:10 -03:00
Roberto Ierusalimschy
34b6664dcb better to use 'long' to represent UTF-8 code points 2014-10-01 08:52:33 -03:00
Roberto Ierusalimschy
f14662fca6 detail (added placeholders for non-function fields to preallocate
space for them)
2014-07-16 10:56:14 -03:00
Roberto Ierusalimschy
e58ef8d0bb missing macro 'LUAMOD_API' in function to open library 2014-05-14 15:33:37 -03:00
Roberto Ierusalimschy
e1daf10e4c details in comments 2014-04-11 15:19:07 -03:00
Roberto Ierusalimschy
144afa4d47 several changes in 'utf8.offset' 2014-04-03 10:45:09 -03:00
Roberto Ierusalimschy
3a044de5a1 new implementation for 'utf8.len' 2014-04-02 14:01:22 -03:00
Roberto Ierusalimschy
607be77ec8 some details to avoid warnings 2014-04-01 11:39:55 -03:00
Roberto Ierusalimschy
738b3b64af detail (to avoid warnings with '-O3') 2014-03-20 16:36:02 -03:00
Roberto Ierusalimschy
7707f3e7c3 'posrelat' -> 'u_posrelat' (to avoid name conflict in 'one.c') 2014-03-20 11:11:00 -03:00
Roberto Ierusalimschy
68df7c6279 added proper headers for a standard lib file 2014-02-06 18:03:24 -02:00
Roberto Ierusalimschy
6ccf150039 new library: utf8 2014-02-06 15:32:33 -02:00