Added gcc option '-Wconversion'

No warnings for standard numerical types. Still pending alternative
numerical types.
This commit is contained in:
Roberto Ierusalimschy
2024-07-27 13:32:59 -03:00
parent 15231d4fb2
commit 0acd55898d
44 changed files with 398 additions and 359 deletions

6
lmem.c
View File

@@ -95,7 +95,7 @@ static void *firsttry (global_State *g, void *block, size_t os, size_t ns) {
void *luaM_growaux_ (lua_State *L, void *block, int nelems, int *psize,
int size_elems, int limit, const char *what) {
unsigned size_elems, int limit, const char *what) {
void *newblock;
int size = *psize;
if (nelems + 1 <= size) /* does one extra element still fit? */
@@ -203,9 +203,9 @@ void *luaM_malloc_ (lua_State *L, size_t size, int tag) {
return NULL; /* that's all */
else {
global_State *g = G(L);
void *newblock = firsttry(g, NULL, tag, size);
void *newblock = firsttry(g, NULL, cast_sizet(tag), size);
if (l_unlikely(newblock == NULL)) {
newblock = tryagain(L, NULL, tag, size);
newblock = tryagain(L, NULL, cast_sizet(tag), size);
if (newblock == NULL)
luaM_error(L);
}