diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-12-20 16:37:00 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-12-20 16:37:00 -0200 |
commit | 9903dd52a39fbe4531596b1266e226f01769de21 (patch) | |
tree | 98bce931ed24b087fffa52123c8f8c23fe39e4f4 /luaconf.h | |
parent | 24f6e236a3346183fe8a946568e6b0cd864abd42 (diff) | |
download | lua-9903dd52a39fbe4531596b1266e226f01769de21.tar.gz lua-9903dd52a39fbe4531596b1266e226f01769de21.tar.bz2 lua-9903dd52a39fbe4531596b1266e226f01769de21.zip |
Using LUAI_UAC* types more consistently on vararg calls
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.256 2016/07/18 17:55:59 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.257 2016/08/22 17:21:12 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 | */ |
@@ -416,7 +416,7 @@ | |||
416 | 416 | ||
417 | /* | 417 | /* |
418 | @@ LUA_NUMBER is the floating-point type used by Lua. | 418 | @@ LUA_NUMBER is the floating-point type used by Lua. |
419 | @@ LUAI_UACNUMBER is the result of an 'usual argument conversion' | 419 | @@ LUAI_UACNUMBER is the result of a 'default argument promotion' |
420 | @@ over a floating number. | 420 | @@ over a floating number. |
421 | @@ l_mathlim(x) corrects limit name 'x' to the proper float type | 421 | @@ l_mathlim(x) corrects limit name 'x' to the proper float type |
422 | ** by prefixing it with one of FLT/DBL/LDBL. | 422 | ** by prefixing it with one of FLT/DBL/LDBL. |
@@ -433,7 +433,8 @@ | |||
433 | 433 | ||
434 | #define l_floor(x) (l_mathop(floor)(x)) | 434 | #define l_floor(x) (l_mathop(floor)(x)) |
435 | 435 | ||
436 | #define lua_number2str(s,sz,n) l_sprintf((s), sz, LUA_NUMBER_FMT, (n)) | 436 | #define lua_number2str(s,sz,n) \ |
437 | l_sprintf((s), sz, LUA_NUMBER_FMT, (LUAI_UACNUMBER)(n)) | ||
437 | 438 | ||
438 | /* | 439 | /* |
439 | @@ lua_numbertointeger converts a float number to an integer, or | 440 | @@ lua_numbertointeger converts a float number to an integer, or |
@@ -510,7 +511,7 @@ | |||
510 | ** | 511 | ** |
511 | @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. | 512 | @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. |
512 | ** | 513 | ** |
513 | @@ LUAI_UACINT is the result of an 'usual argument conversion' | 514 | @@ LUAI_UACINT is the result of a 'default argument promotion' |
514 | @@ over a lUA_INTEGER. | 515 | @@ over a lUA_INTEGER. |
515 | @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. | 516 | @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. |
516 | @@ LUA_INTEGER_FMT is the format for writing integers. | 517 | @@ LUA_INTEGER_FMT is the format for writing integers. |
@@ -523,10 +524,12 @@ | |||
523 | /* The following definitions are good for most cases here */ | 524 | /* The following definitions are good for most cases here */ |
524 | 525 | ||
525 | #define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" | 526 | #define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" |
526 | #define lua_integer2str(s,sz,n) l_sprintf((s), sz, LUA_INTEGER_FMT, (n)) | ||
527 | 527 | ||
528 | #define LUAI_UACINT LUA_INTEGER | 528 | #define LUAI_UACINT LUA_INTEGER |
529 | 529 | ||
530 | #define lua_integer2str(s,sz,n) \ | ||
531 | l_sprintf((s), sz, LUA_INTEGER_FMT, (LUAI_UACINT)(n)) | ||
532 | |||
530 | /* | 533 | /* |
531 | ** use LUAI_UACINT here to avoid problems with promotions (which | 534 | ** use LUAI_UACINT here to avoid problems with promotions (which |
532 | ** can turn a comparison between unsigneds into a signed comparison) | 535 | ** can turn a comparison between unsigneds into a signed comparison) |
@@ -624,7 +627,8 @@ | |||
624 | ** provide its own implementation. | 627 | ** provide its own implementation. |
625 | */ | 628 | */ |
626 | #if !defined(LUA_USE_C89) | 629 | #if !defined(LUA_USE_C89) |
627 | #define lua_number2strx(L,b,sz,f,n) ((void)L, l_sprintf(b,sz,f,n)) | 630 | #define lua_number2strx(L,b,sz,f,n) \ |
631 | ((void)L, l_sprintf(b,sz,f,(LUAI_UACNUMBER)(n))) | ||
628 | #endif | 632 | #endif |
629 | 633 | ||
630 | 634 | ||