better control of integer types and their limits

This commit is contained in:
Roberto Ierusalimschy
1994-12-20 19:20:36 -02:00
parent fe8338335d
commit 8cb8594a3b
14 changed files with 148 additions and 143 deletions

View File

@@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio
*/
char *rcs_mem = "$Id: mem.c,v 1.1 1994/11/16 17:38:08 roberto Exp $";
char *rcs_mem = "$Id: mem.c,v 1.2 1994/11/16 18:09:11 roberto Stab $";
#include <stdlib.h>
@@ -19,7 +19,7 @@ void luaI_free (void *block)
void *luaI_malloc (unsigned long size)
{
void *block = malloc(size);
void *block = malloc((size_t)size);
if (block == NULL)
lua_error("not enough memory");
return block;
@@ -28,7 +28,7 @@ void *luaI_malloc (unsigned long size)
void *luaI_realloc (void *oldblock, unsigned long size)
{
void *block = realloc(oldblock, size);
void *block = realloc(oldblock, (size_t)size);
if (block == NULL)
lua_error("not enough memory");
return block;