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 /lobject.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 'lobject.h')
-rw-r--r-- | lobject.h | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -432,13 +432,13 @@ typedef struct TString { | |||
432 | 432 | ||
433 | /* get string length from 'TString *ts' */ | 433 | /* get string length from 'TString *ts' */ |
434 | #define tsslen(ts) \ | 434 | #define tsslen(ts) \ |
435 | (strisshr(ts) ? cast_uint((ts)->shrlen) : (ts)->u.lnglen) | 435 | (strisshr(ts) ? cast_sizet((ts)->shrlen) : (ts)->u.lnglen) |
436 | 436 | ||
437 | /* | 437 | /* |
438 | ** Get string and length */ | 438 | ** Get string and length */ |
439 | #define getlstr(ts, len) \ | 439 | #define getlstr(ts, len) \ |
440 | (strisshr(ts) \ | 440 | (strisshr(ts) \ |
441 | ? (cast_void((len) = (ts)->shrlen), rawgetshrstr(ts)) \ | 441 | ? (cast_void((len) = cast_sizet((ts)->shrlen)), rawgetshrstr(ts)) \ |
442 | : (cast_void((len) = (ts)->u.lnglen), (ts)->contents)) | 442 | : (cast_void((len) = (ts)->u.lnglen), (ts)->contents)) |
443 | 443 | ||
444 | /* }================================================================== */ | 444 | /* }================================================================== */ |
@@ -517,8 +517,8 @@ typedef struct Udata0 { | |||
517 | 517 | ||
518 | /* compute the offset of the memory area of a userdata */ | 518 | /* compute the offset of the memory area of a userdata */ |
519 | #define udatamemoffset(nuv) \ | 519 | #define udatamemoffset(nuv) \ |
520 | ((nuv) == 0 ? offsetof(Udata0, bindata) \ | 520 | ((nuv) == 0 ? offsetof(Udata0, bindata) \ |
521 | : offsetof(Udata, uv) + (sizeof(UValue) * (nuv))) | 521 | : offsetof(Udata, uv) + (sizeof(UValue) * (nuv))) |
522 | 522 | ||
523 | /* get the address of the memory block inside 'Udata' */ | 523 | /* get the address of the memory block inside 'Udata' */ |
524 | #define getudatamem(u) (cast_charp(u) + udatamemoffset((u)->nuvalue)) | 524 | #define getudatamem(u) (cast_charp(u) + udatamemoffset((u)->nuvalue)) |
@@ -825,10 +825,10 @@ typedef struct Table { | |||
825 | ** 'module' operation for hashing (size is always a power of 2) | 825 | ** 'module' operation for hashing (size is always a power of 2) |
826 | */ | 826 | */ |
827 | #define lmod(s,size) \ | 827 | #define lmod(s,size) \ |
828 | (check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1))))) | 828 | (check_exp((size&(size-1))==0, (cast_uint(s) & cast_uint((size)-1)))) |
829 | 829 | ||
830 | 830 | ||
831 | #define twoto(x) (1<<(x)) | 831 | #define twoto(x) (1u<<(x)) |
832 | #define sizenode(t) (twoto((t)->lsizenode)) | 832 | #define sizenode(t) (twoto((t)->lsizenode)) |
833 | 833 | ||
834 | 834 | ||
@@ -836,16 +836,16 @@ typedef struct Table { | |||
836 | #define UTF8BUFFSZ 8 | 836 | #define UTF8BUFFSZ 8 |
837 | 837 | ||
838 | LUAI_FUNC int luaO_utf8esc (char *buff, unsigned long x); | 838 | LUAI_FUNC int luaO_utf8esc (char *buff, unsigned long x); |
839 | LUAI_FUNC int luaO_ceillog2 (unsigned int x); | 839 | LUAI_FUNC lu_byte luaO_ceillog2 (unsigned int x); |
840 | LUAI_FUNC unsigned int luaO_codeparam (unsigned int p); | 840 | LUAI_FUNC lu_byte luaO_codeparam (unsigned int p); |
841 | LUAI_FUNC l_obj luaO_applyparam (unsigned int p, l_obj x); | 841 | LUAI_FUNC l_obj luaO_applyparam (lu_byte p, l_obj x); |
842 | 842 | ||
843 | LUAI_FUNC int luaO_rawarith (lua_State *L, int op, const TValue *p1, | 843 | LUAI_FUNC int luaO_rawarith (lua_State *L, int op, const TValue *p1, |
844 | const TValue *p2, TValue *res); | 844 | const TValue *p2, TValue *res); |
845 | LUAI_FUNC void luaO_arith (lua_State *L, int op, const TValue *p1, | 845 | LUAI_FUNC void luaO_arith (lua_State *L, int op, const TValue *p1, |
846 | const TValue *p2, StkId res); | 846 | const TValue *p2, StkId res); |
847 | LUAI_FUNC size_t luaO_str2num (const char *s, TValue *o); | 847 | LUAI_FUNC size_t luaO_str2num (const char *s, TValue *o); |
848 | LUAI_FUNC int luaO_hexavalue (int c); | 848 | LUAI_FUNC lu_byte luaO_hexavalue (int c); |
849 | LUAI_FUNC void luaO_tostring (lua_State *L, TValue *obj); | 849 | LUAI_FUNC void luaO_tostring (lua_State *L, TValue *obj); |
850 | LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, | 850 | LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, |
851 | va_list argp); | 851 | va_list argp); |