64-bit build fixes for ASN.1 compiler 64-bit integer support

This commit is contained in:
Nicolas Williams
2011-12-13 13:02:26 -06:00
parent 449fb4775e
commit a222521e68
6 changed files with 25 additions and 20 deletions

View File

@@ -192,19 +192,19 @@ range_check(const char *name,
"if ((%s)->%s > %lld) {\n"
"e = ASN1_MAX_CONSTRAINT; %s;\n"
"}\n",
name, length, r->max, forwstr);
name, length, (long long)r->max, forwstr);
if (r->min - 1 == r->max || r->min < r->max)
fprintf (codefile,
"if ((%s)->%s < %lld) {\n"
"e = ASN1_MIN_CONSTRAINT; %s;\n"
"}\n",
name, length, r->min, forwstr);
name, length, (long long)r->min, forwstr);
if (r->max == r->min)
fprintf (codefile,
"if ((%s)->%s != %lld) {\n"
"e = ASN1_EXACT_CONSTRAINT; %s;\n"
"}\n",
name, length, r->min, forwstr);
name, length, (long long)r->min, forwstr);
}
static int
@@ -262,7 +262,7 @@ decode_type (const char *name, const Type *t, int optional,
decode_primitive ("unsigned", name, forwstr);
} else
errx(1, "%s: unsupported range %lld -> %lld",
name, t->range->min, t->range->max);
name, (long long)t->range->min, (long long)t->range->max);
break;
case TBoolean:
decode_primitive ("boolean", name, forwstr);