((n)-1) may be negative (-1), and so it is not wise to keep it as unsigned

This commit is contained in:
Roberto Ierusalimschy 2000-10-18 15:19:09 -02:00
parent e93c4547fe
commit 2779ceeb12
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
** $Id: lfunc.c,v 1.31 2000/09/29 12:42:13 roberto Exp roberto $
** $Id: lfunc.c,v 1.32 2000/10/10 19:52:58 roberto Exp roberto $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
@ -14,7 +14,7 @@
#include "lstate.h"
#define sizeclosure(n) (sizeof(Closure) + (lint32)sizeof(TObject)*((n)-1))
#define sizeclosure(n) ((int)sizeof(Closure) + (int)sizeof(TObject)*((n)-1))
Closure *luaF_newclosure (lua_State *L, int nelems) {