From c787dccd9b5c3e55547a2c4bb598c0276de65034 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 16 Aug 1999 17:52:00 -0300 Subject: "const" !!! --- lmem.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'lmem.c') diff --git a/lmem.c b/lmem.c index 1c334b64..26aac9c6 100644 --- a/lmem.c +++ b/lmem.c @@ -1,5 +1,5 @@ /* -** $Id: lmem.c,v 1.16 1999/05/20 20:43:06 roberto Exp roberto $ +** $Id: lmem.c,v 1.17 1999/05/24 17:51:05 roberto Exp roberto $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ @@ -35,7 +35,7 @@ static unsigned long power2 (unsigned long n) { void *luaM_growaux (void *block, unsigned long nelems, int inc, int size, - char *errormsg, unsigned long limit) { + const char *errormsg, unsigned long limit) { unsigned long newn = nelems+inc; if (newn >= limit) lua_error(errormsg); if ((newn ^ nelems) <= nelems || /* still the same power of 2 limit? */ @@ -86,25 +86,23 @@ unsigned long totalmem = 0; static void *checkblock (void *block) { - if (block == NULL) - return NULL; - else { - unsigned long *b = blocksize(block); - unsigned long size = *b; - int i; - for (i=0;i