aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-19 17:49:22 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-19 17:49:22 -0200
commitd49e4dd752928c5869a75c444b503060b2634968 (patch)
tree4e13ace68c6940dd12efae1014b18237e1004caa /lobject.h
parent981fddea022b6cad7768223353b4e7386080c271 (diff)
downloadlua-d49e4dd752928c5869a75c444b503060b2634968.tar.gz
lua-d49e4dd752928c5869a75c444b503060b2634968.tar.bz2
lua-d49e4dd752928c5869a75c444b503060b2634968.zip
MAX_WORD should not be bigger than MAX_INT
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/lobject.h b/lobject.h
index bc9be0ba..9e1f94d5 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 1.15 1998/01/13 13:27:25 roberto Exp $ 2** $Id: lobject.h,v 1.15 1998/01/14 13:48:28 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -25,8 +25,15 @@
25#define Byte lua_Byte /* some systems have Byte as a predefined type */ 25#define Byte lua_Byte /* some systems have Byte as a predefined type */
26typedef unsigned char Byte; /* unsigned 8 bits */ 26typedef unsigned char Byte; /* unsigned 8 bits */
27 27
28#define MAX_WORD (65534U) /* maximum value of a word (-2 for safety) */ 28
29#define MAX_INT (INT_MAX-2) /* maximum value of a int (-2 for safety) */ 29#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */
30
31/* maximum value of a word of 2 bytes (-2 for safety); must fit in an "int" */
32#if MAX_INT < 65534
33#define MAX_WORD MAX_INT
34#else
35#define MAX_WORD 65534
36#endif
30 37
31typedef unsigned int IntPoint; /* unsigned with same size as a pointer (for hashing) */ 38typedef unsigned int IntPoint; /* unsigned with same size as a pointer (for hashing) */
32 39