diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-27 13:32:59 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-27 13:32:59 -0300 |
| commit | 0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b (patch) | |
| tree | 0ac634fed90877130b1f102bf4075af999de2158 /llimits.h | |
| parent | 15231d4fb2f6984b25e0353ff46eda1a180b686d (diff) | |
| download | lua-0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b.tar.gz lua-0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b.tar.bz2 lua-0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b.zip | |
Added gcc option '-Wconversion'
No warnings for standard numerical types. Still pending alternative
numerical types.
Diffstat (limited to 'llimits.h')
| -rw-r--r-- | llimits.h | 11 |
1 files changed, 11 insertions, 0 deletions
| @@ -130,6 +130,7 @@ typedef LUAI_UACINT l_uacInt; | |||
| 130 | #define cast_num(i) cast(lua_Number, (i)) | 130 | #define cast_num(i) cast(lua_Number, (i)) |
| 131 | #define cast_int(i) cast(int, (i)) | 131 | #define cast_int(i) cast(int, (i)) |
| 132 | #define cast_uint(i) cast(unsigned int, (i)) | 132 | #define cast_uint(i) cast(unsigned int, (i)) |
| 133 | #define cast_ulong(i) cast(unsigned long, (i)) | ||
| 133 | #define cast_byte(i) cast(lu_byte, (i)) | 134 | #define cast_byte(i) cast(lu_byte, (i)) |
| 134 | #define cast_uchar(i) cast(unsigned char, (i)) | 135 | #define cast_uchar(i) cast(unsigned char, (i)) |
| 135 | #define cast_char(i) cast(char, (i)) | 136 | #define cast_char(i) cast(char, (i)) |
| @@ -151,6 +152,16 @@ typedef LUAI_UACINT l_uacInt; | |||
| 151 | #define l_castU2S(i) ((lua_Integer)(i)) | 152 | #define l_castU2S(i) ((lua_Integer)(i)) |
| 152 | #endif | 153 | #endif |
| 153 | 154 | ||
| 155 | /* | ||
| 156 | ** cast a size_t to lua_Integer: These casts are always valid for | ||
| 157 | ** sizes of Lua objects (see MAX_SIZE) | ||
| 158 | */ | ||
| 159 | #define cast_st2S(sz) ((lua_Integer)(sz)) | ||
| 160 | |||
| 161 | /* Cast a ptrdiff_t to size_t, when it is known that the minuend | ||
| 162 | ** comes from the subtraend (the base) | ||
| 163 | */ | ||
| 164 | #define ct_diff2sz(df) ((size_t)(df)) | ||
| 154 | 165 | ||
| 155 | /* | 166 | /* |
| 156 | ** Special type equivalent to '(void*)' for functions (to suppress some | 167 | ** Special type equivalent to '(void*)' for functions (to suppress some |
