aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-07-27 13:32:59 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-07-27 13:32:59 -0300
commit0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b (patch)
tree0ac634fed90877130b1f102bf4075af999de2158 /lobject.h
parent15231d4fb2f6984b25e0353ff46eda1a180b686d (diff)
downloadlua-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.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/lobject.h b/lobject.h
index 641e782c..fb66dff7 100644
--- a/lobject.h
+++ b/lobject.h
@@ -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
838LUAI_FUNC int luaO_utf8esc (char *buff, unsigned long x); 838LUAI_FUNC int luaO_utf8esc (char *buff, unsigned long x);
839LUAI_FUNC int luaO_ceillog2 (unsigned int x); 839LUAI_FUNC lu_byte luaO_ceillog2 (unsigned int x);
840LUAI_FUNC unsigned int luaO_codeparam (unsigned int p); 840LUAI_FUNC lu_byte luaO_codeparam (unsigned int p);
841LUAI_FUNC l_obj luaO_applyparam (unsigned int p, l_obj x); 841LUAI_FUNC l_obj luaO_applyparam (lu_byte p, l_obj x);
842 842
843LUAI_FUNC int luaO_rawarith (lua_State *L, int op, const TValue *p1, 843LUAI_FUNC int luaO_rawarith (lua_State *L, int op, const TValue *p1,
844 const TValue *p2, TValue *res); 844 const TValue *p2, TValue *res);
845LUAI_FUNC void luaO_arith (lua_State *L, int op, const TValue *p1, 845LUAI_FUNC void luaO_arith (lua_State *L, int op, const TValue *p1,
846 const TValue *p2, StkId res); 846 const TValue *p2, StkId res);
847LUAI_FUNC size_t luaO_str2num (const char *s, TValue *o); 847LUAI_FUNC size_t luaO_str2num (const char *s, TValue *o);
848LUAI_FUNC int luaO_hexavalue (int c); 848LUAI_FUNC lu_byte luaO_hexavalue (int c);
849LUAI_FUNC void luaO_tostring (lua_State *L, TValue *obj); 849LUAI_FUNC void luaO_tostring (lua_State *L, TValue *obj);
850LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, 850LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,
851 va_list argp); 851 va_list argp);