From 42f0a043f0dce96a7bf41ae8e66a0dbe4602df38 Mon Sep 17 00:00:00 2001 From: thurston Date: Mon, 31 Mar 2008 18:08:49 +0000 Subject: [PATCH] Added limits for the constant sizes. git-svn-id: http://svn.complang.org/ragel/trunk@421 052ea7fc-9027-0410-9066-f65837a77df0 --- common/common.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/common/common.cpp b/common/common.cpp index ba5b948..e15ff34 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -37,6 +37,30 @@ HostType hostTypesC[] = { "unsigned", "long", "ulong", false, 0, ULONG_MAX, sizeof(unsigned long) } }; +#define S8BIT_MIN -128 +#define S8BIT_MAX 127 + +#define U8BIT_MIN 0 +#define U8BIT_MAX 255 + +#define S16BIT_MIN -32768 +#define S16BIT_MAX 32767 + +#define U16BIT_MIN 0 +#define U16BIT_MAX 65535 + +#define S32BIT_MIN –2147483648l +#define S32BIT_MAX 2147483647l + +#define U32BIT_MIN 0 +#define U32BIT_MAX 4294967295l + +#define S64BIT_MIN –9223372036854775808ll +#define S64BIT_MAX 9223372036854775807ll + +#define U64BIT_MIN 0 +#define U64BIT_MAX 18446744073709551615ll + HostType hostTypesD[] = { { "byte", 0, "byte", true, CHAR_MIN, CHAR_MAX, 1 }, -- 2.7.4