diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-05-21 12:24:21 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-05-21 12:24:21 -0300 |
commit | e966e5379195a3414c0e8f6be6e25052702305ff (patch) | |
tree | 3207b4865ee1819e268d6577c377738d94d52603 /luaconf.h | |
parent | c4eff10322f5e1e8213c9004f8b91c3c7bd36e3f (diff) | |
download | lua-e966e5379195a3414c0e8f6be6e25052702305ff.tar.gz lua-e966e5379195a3414c0e8f6be6e25052702305ff.tar.bz2 lua-e966e5379195a3414c0e8f6be6e25052702305ff.zip |
no more use of 'scanf' for reading numbers
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.201 2014/05/11 13:03:48 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.202 2014/05/15 15:24:32 roberto Exp roberto $ |
3 | ** Configuration file for Lua | 3 | ** Configuration file for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -431,7 +431,6 @@ | |||
431 | @@ over a floating number. | 431 | @@ over a floating number. |
432 | ** | 432 | ** |
433 | @@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. | 433 | @@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. |
434 | @@ LUA_NUMBER_SCAN is the format for reading floats. | ||
435 | @@ LUA_NUMBER_FMT is the format for writing floats. | 434 | @@ LUA_NUMBER_FMT is the format for writing floats. |
436 | @@ lua_number2str converts a float to a string. | 435 | @@ lua_number2str converts a float to a string. |
437 | ** | 436 | ** |
@@ -447,7 +446,6 @@ | |||
447 | #define LUAI_UACNUMBER double | 446 | #define LUAI_UACNUMBER double |
448 | 447 | ||
449 | #define LUA_NUMBER_FRMLEN "" | 448 | #define LUA_NUMBER_FRMLEN "" |
450 | #define LUA_NUMBER_SCAN "%f" | ||
451 | #define LUA_NUMBER_FMT "%.7g" | 449 | #define LUA_NUMBER_FMT "%.7g" |
452 | 450 | ||
453 | #define l_mathop(op) op##f | 451 | #define l_mathop(op) op##f |
@@ -462,7 +460,6 @@ | |||
462 | #define LUAI_UACNUMBER long double | 460 | #define LUAI_UACNUMBER long double |
463 | 461 | ||
464 | #define LUA_NUMBER_FRMLEN "L" | 462 | #define LUA_NUMBER_FRMLEN "L" |
465 | #define LUA_NUMBER_SCAN "%Lf" | ||
466 | #define LUA_NUMBER_FMT "%.19Lg" | 463 | #define LUA_NUMBER_FMT "%.19Lg" |
467 | 464 | ||
468 | #define l_mathop(op) op##l | 465 | #define l_mathop(op) op##l |
@@ -476,7 +473,6 @@ | |||
476 | #define LUAI_UACNUMBER double | 473 | #define LUAI_UACNUMBER double |
477 | 474 | ||
478 | #define LUA_NUMBER_FRMLEN "" | 475 | #define LUA_NUMBER_FRMLEN "" |
479 | #define LUA_NUMBER_SCAN "%lf" | ||
480 | #define LUA_NUMBER_FMT "%.14g" | 476 | #define LUA_NUMBER_FMT "%.14g" |
481 | 477 | ||
482 | #define l_mathop(op) op | 478 | #define l_mathop(op) op |
@@ -552,7 +548,6 @@ | |||
552 | @@ LUAI_UACINT is the result of an 'usual argument conversion' | 548 | @@ LUAI_UACINT is the result of an 'usual argument conversion' |
553 | @@ over a lUA_INTEGER. | 549 | @@ over a lUA_INTEGER. |
554 | @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. | 550 | @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. |
555 | @@ LUA_INTEGER_SCAN is the format for reading integers. | ||
556 | @@ LUA_INTEGER_FMT is the format for writing integers. | 551 | @@ LUA_INTEGER_FMT is the format for writing integers. |
557 | @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. | 552 | @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. |
558 | @@ LUA_MININTEGER is the minimum value for a LUA_INTEGER. | 553 | @@ LUA_MININTEGER is the minimum value for a LUA_INTEGER. |
@@ -563,7 +558,6 @@ | |||
563 | 558 | ||
564 | /* The following definitions are good for most cases here */ | 559 | /* The following definitions are good for most cases here */ |
565 | 560 | ||
566 | #define LUA_INTEGER_SCAN "%" LUA_INTEGER_FRMLEN "d" | ||
567 | #define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" | 561 | #define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" |
568 | #define lua_integer2str(s,n) sprintf((s), LUA_INTEGER_FMT, (n)) | 562 | #define lua_integer2str(s,n) sprintf((s), LUA_INTEGER_FMT, (n)) |
569 | 563 | ||
@@ -634,9 +628,6 @@ | |||
634 | #undef LUAI_UACINT | 628 | #undef LUAI_UACINT |
635 | #define LUAI_UACINT int | 629 | #define LUAI_UACINT int |
636 | 630 | ||
637 | #undef LUA_INTEGER_SCAN | ||
638 | #define LUA_INTEGER_SCAN "%hd" | ||
639 | |||
640 | #undef LUAI_MAXSTACK | 631 | #undef LUAI_MAXSTACK |
641 | #define LUAI_MAXSTACK 15000 | 632 | #define LUAI_MAXSTACK 15000 |
642 | 633 | ||