diff options
author | Michi Henning <michi@zeroc.com> | 2002-07-05 04:05:42 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2002-07-05 04:05:42 +0000 |
commit | bb1b84d1436f26eb8c1941eedb97e943e81947bb (patch) | |
tree | 0dd48ac1ce692218bcb9e6578e6d7f5bee1ea2ba /cpp/include/Slice/Parser.h | |
parent | Added "i64" suffix for 64-bit integer literals. (diff) | |
download | ice-bb1b84d1436f26eb8c1941eedb97e943e81947bb.tar.bz2 ice-bb1b84d1436f26eb8c1941eedb97e943e81947bb.tar.xz ice-bb1b84d1436f26eb8c1941eedb97e943e81947bb.zip |
Changed the way 64-bit literals are done in the generated code. The
approach used now (a macro) makes the generated source more readable
than the previous one.
Diffstat (limited to 'cpp/include/Slice/Parser.h')
-rw-r--r-- | cpp/include/Slice/Parser.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h index ce3c9055488..222a8d880ab 100644 --- a/cpp/include/Slice/Parser.h +++ b/cpp/include/Slice/Parser.h @@ -37,22 +37,26 @@ namespace Slice # define STRTOLL(a, b, c) _atoi64(a) typedef __int64 Long; typedef double Double; - const Long INT32_MIN = -0x80000000i64; + const Long INT64_MAX = 0x7fffffffffffffffi64; + const Long INT64_MIN = -INT64_MAX - 1i64; const Long INT32_MAX = 0x7fffffffi64; + const Long INT32_MIN = -INT32_MAX - 1i64; #elif(__linux__) && defined(i386) # define STRTOLL(a, b, c) strtoll((a), (b), (c)) typedef long long Long; typedef double Double; - const Long INT32_MIN = -0x80000000LL; + const Long INT64_MAX = 0x7fffffffffffffffLL; + const Long INT64_MIN = -INT64_MAX - 1LL; const Long INT32_MAX = 0x7fffffffLL; + const Long INT32_MIN = -INT32_MAX - 1LL; #else # error "Unsupported operating system or platform!" #endif -const Long BYTE_MIN = 0x00; -const Long BYTE_MAX = 0xff; -const Long INT16_MIN = -0x8000; const Long INT16_MAX = 0x7fff; +const Long INT16_MIN = -INT16_MAX - 1; +const Long BYTE_MAX = 0xff; +const Long BYTE_MIN = 0x00; class GrammarBase; class SyntaxTreeBase; |