From d49e4dd752928c5869a75c444b503060b2634968 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 19 Jan 1998 17:49:22 -0200 Subject: MAX_WORD should not be bigger than MAX_INT --- lobject.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index bc9be0ba..9e1f94d5 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 1.15 1998/01/13 13:27:25 roberto Exp $ +** $Id: lobject.h,v 1.15 1998/01/14 13:48:28 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -25,8 +25,15 @@ #define Byte lua_Byte /* some systems have Byte as a predefined type */ typedef unsigned char Byte; /* unsigned 8 bits */ -#define MAX_WORD (65534U) /* maximum value of a word (-2 for safety) */ -#define MAX_INT (INT_MAX-2) /* maximum value of a int (-2 for safety) */ + +#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ + +/* maximum value of a word of 2 bytes (-2 for safety); must fit in an "int" */ +#if MAX_INT < 65534 +#define MAX_WORD MAX_INT +#else +#define MAX_WORD 65534 +#endif typedef unsigned int IntPoint; /* unsigned with same size as a pointer (for hashing) */ -- cgit v1.2.3-55-g6feb