scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 56fa97c0542ea683fdc3c88549e6e1690bfe0878
parent 68a6009cc57f29ce227766ff7e81924300ee585b
Author: Quentin Rameau <quinq@fifth.space>
Date:   Sun, 19 Mar 2017 11:27:00 +0100

[cc1] Fix integer types ranges

Diffstat:
Mcc1/types.c | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/cc1/types.c b/cc1/types.c @@ -24,37 +24,37 @@ static struct limits limits[][4] = { { { /* 0 = unsigned 1 byte */ .min.i = 0, - .max.i = 255 + .max.i = 0xff }, { /* 1 = unsigned 2 bytes */ .min.i = 0, - .max.i = 65535u + .max.i = 0xffff }, { /* 2 = unsigned 4 bytes */ .min.i = 0, - .max.i = 4294967295u + .max.i = 0xffffffff }, { /* 3 = unsigned 8 bytes */ .min.i = 0, - .max.i = 18446744073709551615u + .max.i = 0xffffffffffffffff } }, { { /* 0 = signed 1 byte */ - .min.i = -127, - .max.i = 127 + .min.i = -0x7f-1, + .max.i = 0x7f }, { /* 1 = signed 2 byte */ - .min.i = -32767, - .max.i = 32767 + .min.i = -0x7fff-1, + .max.i = 0x7fff }, { /* 2 = signed 4 byte */ - .min.i = -2147483647L, - .max.i = 2147483647L + .min.i = -0x7fffffff-1, + .max.i = 0x7fffffff }, { /* 3 = signed 8 byte */ - .min.i = -9223372036854775807LL, - .max.i = 9223372036854775807LL, + .min.i = -0x7fffffffffffffff-1, + .max.i = 0x7fffffffffffffff, } }, {