Commit Graph

3919 Commits

Author SHA1 Message Date
Roberto Ierusalimschy
677d90165f no more generational collection !!! 2013-08-05 13:58:28 -03:00
Roberto Ierusalimschy
4244da96bf 'debug.subtype' -> 'math.type' (to distinguish integers and floats) 2013-07-22 13:05:53 -03:00
Roberto Ierusalimschy
fcf99bf788 'math.isfloat' replaced by 'debug.subtype' 2013-07-10 17:57:05 -03:00
Roberto Ierusalimschy
98d76cdcae bug: Wrong error message in some short-cut expressions 2013-07-10 17:32:36 -03:00
Roberto Ierusalimschy
2f8c51a552 use unsigneds for unary minus, too 2013-07-10 14:15:12 -03:00
Roberto Ierusalimschy
b5f5fcd782 use different constants (instead of different values for the same constant)
to define number sizes (LUA_INT_INT/LUA_INT_LONG/LUA_INT_LONGLONG and
LUA_REAL_FLOAT/LUA_REAL_DOUBLE/LUA_REAL_LONGDOUBLE) + use __int64 and
I64 instead of long long (and ll) for Windows
2013-07-09 15:31:35 -03:00
Roberto Ierusalimschy
2ef9bcfd11 avoid undefined shift of LUA_NBITS in rotate operation 2013-07-09 15:31:01 -03:00
Roberto Ierusalimschy
5fa680d47f no need for type 'b_uint' (lua_Unsigned must have at least 32 bits) 2013-07-09 14:49:50 -03:00
Roberto Ierusalimschy
48735da0d0 When loading a file, Lua may call the reader function again after
it returned end of input + luac listings choke on long strings
2013-07-05 15:02:28 -03:00
Roberto Ierusalimschy
2b4bd21585 'tonumber': base must be a number 2013-07-05 11:39:15 -03:00
Roberto Ierusalimschy
beff5b078a 'tonumber': does not accept numbers when given a base + convertion from
strings to numbers with a base moved to a separated function (more
modular)
2013-07-05 11:35:49 -03:00
Roberto Ierusalimschy
5519c98655 'lua_cvtonum' -> 'lua_strtonum'; converts only strings to numbers 2013-07-05 11:29:51 -03:00
Roberto Ierusalimschy
cbe164191c new function 'ifloor' 2013-07-03 14:23:19 -03:00
Roberto Ierusalimschy
66d046833d no need to check "bad conversion number->int;" in luaL_checkversion,
as now Lua does not use tricks for the conversion, but there is a
need to check the sizes of number types, as they can be different
in two modules
2013-06-27 15:32:33 -03:00
Roberto Ierusalimschy
15fdbd26fe 'numbits' moved from 'math' to 'debug' library 2013-06-25 16:37:00 -03:00
Roberto Ierusalimschy
2b4975dca7 LUA_SMALL_* changed to LUA_*SIZE + added support for long double + better
support for ANSI systems
2013-06-25 16:04:40 -03:00
Roberto Ierusalimschy
e39da66c8c macro 'lua_strx2number' does not need to be global 2013-06-25 15:58:32 -03:00
Roberto Ierusalimschy
483c2ccd0f avoid using raw representation of numbers for hashing, as number may
not use all its space (e.g., long double can have sizeof=12 but
use only 10 bytes)
2013-06-25 15:57:18 -03:00
Roberto Ierusalimschy
982aa7058f 'luaL_len' returns lua_Integer instead of 'int' 2013-06-25 11:05:26 -03:00
Roberto Ierusalimschy
80cdf39d0e avoid using 'modf' in the implementation of 'math.modf', to avoid
problems with 'double*'. (When using 'float' as lua_Number,
'float*' is not compatible with 'double*'...)
2013-06-25 11:02:18 -03:00
Roberto Ierusalimschy
45f3797a5b 'long' may have more than 32 bits in some machines; use 'int' for
small lua_Integer unless necessary to use 'long'
2013-06-21 14:42:28 -03:00
Roberto Ierusalimschy
de6e5a5919 small bugs uncovered in a 64-bit machine (where 'long' has 64 bits) 2013-06-21 14:27:24 -03:00
Roberto Ierusalimschy
81102d3689 try to avoid warnings when converting int to pointer 2013-06-20 18:59:13 -03:00
Roberto Ierusalimschy
6579bd4190 reorganization of warnings + update of explicit dependencies (gcc -MM) 2013-06-20 15:56:51 -03:00
Roberto Ierusalimschy
f45177f2d3 In the table that hashes constants, use a light userdata as keys
to integer values to avoid collisions with floats with the same
numerical value
2013-06-20 14:37:31 -03:00
Roberto Ierusalimschy
d6f5fb2d2c avoid warning for unary minus over an unsigned value 2013-06-20 12:12:43 -03:00
Roberto Ierusalimschy
7c4cc505db added "reasonable" limit for 'string.rep' (otherwise it is too easy
to crash the machine)
2013-06-20 12:06:51 -03:00
Roberto Ierusalimschy
453450d687 new macro 'l_floor' (allows 'floorf' even when other math operations
do not have an 'f' variant)
2013-06-20 12:02:49 -03:00
Roberto Ierusalimschy
55f566bd22 use lua_Integer for integer parameters to avoid truncation 2013-06-19 11:29:01 -03:00
Roberto Ierusalimschy
130c0e40e0 new constant 'MAX_SIZE', distinct from 'MAX_SIZET', for sizes visible
from Lua; these must fit in a lua_Integer
2013-06-19 11:27:00 -03:00
Roberto Ierusalimschy
c72fb1cf8e detail (removed 'assert') 2013-06-14 17:46:40 -03:00
Roberto Ierusalimschy
138e69cc55 correct error message for floating-point values out of (integer) range 2013-06-14 15:34:49 -03:00
Roberto Ierusalimschy
53210d7e5b correct way (I hope) to convert floats to unsigned int 2013-06-14 15:32:45 -03:00
Roberto Ierusalimschy
0394314c7a avoid using a negative value to test 'lua_tounsigned' 2013-06-14 15:12:53 -03:00
Roberto Ierusalimschy
0beeb4f6fa configuration of number sizes goes "mainstream" 2013-06-13 16:35:08 -03:00
Roberto Ierusalimschy
788b251157 'math.random' operates with integers when used for integer results
(1 or 2 parameters)
2013-06-13 16:32:52 -03:00
Roberto Ierusalimschy
318575627f avoid adding '.0' to "numbers" like "nan" and "inf" 2013-06-07 16:02:05 -03:00
Roberto Ierusalimschy
a14992992a new version (5.3) 2013-06-07 16:01:50 -03:00
Roberto Ierusalimschy
48adb6984c 'io.write' writes integers directly (and correctly) 2013-06-07 16:01:35 -03:00
Roberto Ierusalimschy
c5069528e1 details ('Type* id' -> 'Type *id') 2013-06-07 11:51:10 -03:00
Roberto Ierusalimschy
6fb0b11350 string contatenation handles conversion of integers to strings +
floats always format as floats (with decimal dot or exponent)
2013-06-04 16:36:42 -03:00
Roberto Ierusalimschy
932e7fb0e1 'lua_tounsigned' takes number modulo 2^numbits as a result when
number is a float
(That may change...)
2013-06-04 16:34:51 -03:00
Roberto Ierusalimschy
188192ce9a 'luai_hashnum' "inlined" into 'hashfloat' 2013-05-29 11:05:03 -03:00
Roberto Ierusalimschy
fc083f1138 removed all tricks for conversions + 'luai_hashnum' moved to ltable.c 2013-05-29 11:04:15 -03:00
Roberto Ierusalimschy
ee865b9fe7 new implementation for 'lua_strx2number' to correct small
problems with numbers like 0x10000...000p-100
2013-05-27 14:42:38 -03:00
Roberto Ierusalimschy
d630daca1a "legal" way to convert a float to an integer in C 2013-05-27 09:43:37 -03:00
Roberto Ierusalimschy
8c883cb4e8 'objlen' can return integers 2013-05-26 11:47:51 -03:00
Roberto Ierusalimschy
c75cca0559 detail (case '%d' of 'luaO_pushvfstring' should use integers) 2013-05-26 11:43:35 -03:00
Roberto Ierusalimschy
1414b7123c support for the case when 'l_mathop' does not conform to lua_Number
(problem with pointers to lua_Number solved by a typedef selected
automatically by 'l_mathop')
2013-05-26 10:45:24 -03:00
Roberto Ierusalimschy
3563b3f519 first version of control for number sizes (still in 'local' section) 2013-05-26 10:35:52 -03:00