[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Question about luaM_reallocv in lmem.h
- From: Bogdan Marinescu <bogdan.marinescu@...>
- Date: Mon, 14 Mar 2005 10:04:30 +0200
While trying to port lua to an embedded 16-bit platform, the
compiler warns me that the comparison in luaM_reallocv is always true:
#define luaM_reallocv(L,b,on,n,e) \
((cast(unsigned int, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
On my platform, size_t is 4 bytes (long), while 'int' is 2 bytes.
I changed the previous cast to 'unsigned long' and I didn't get the
warning anymore, but I wonder how does this affect Lua.