From dd05873d0c648a629344381238f4af732b84ea9d Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 15 Dec 2011 14:37:09 -0600 Subject: [PATCH] Fix regression in ASN.1 int type generation The 64-bit integer support changed the logic for deciding when an INTEGER should map to a signed or unsigned 32- or 64-bit integer type. The upshot is that two places where we had {0, INT_MAX} ranges needed to be changed to be {0, UINT_MAX}. We need to tweak the integer type mapping logic to have a bias for unsigned integer types. Unsigned is better. --- lib/asn1/gen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/asn1/gen.c b/lib/asn1/gen.c index 16b908603..a43903d19 100644 --- a/lib/asn1/gen.c +++ b/lib/asn1/gen.c @@ -752,7 +752,7 @@ define_type (int level, const char *name, const char *basename, Type *t, int typ case TBitString: { Member *m; Type i; - struct range range = { 0, INT_MAX }; + struct range range = { 0, UINT_MAX }; i.type = TInteger; i.range = ⦥ @@ -851,7 +851,7 @@ define_type (int level, const char *name, const char *basename, Type *t, int typ case TSetOf: case TSequenceOf: { Type i; - struct range range = { 0, INT_MAX }; + struct range range = { 0, UINT_MAX }; getnewbasename(&newbasename, typedefp, basename, name);