Skip to content
Snippets Groups Projects
Commit 33c16ba7 authored by Lev Walkin's avatar Lev Walkin
Browse files

PRIdASN instead of lld

parent 11c3e170
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,7 @@ asn1c_lang_C_type_common_INTEGER(arg_t *arg) {
TQ_FOR(v, &(expr->members), next) {
switch(v->expr_type) {
case A1TC_UNIVERVAL:
OUT("\t%s\t= %lld,\n",
OUT("\t%s\t= %" PRIdASN ",\n",
asn1c_make_identifier(0,
expr->Identifier,
v->Identifier, 0),
......@@ -969,7 +969,7 @@ _print_tag(arg_t *arg, struct asn1p_type_tag_s *tag) {
case TC_NOCLASS:
break;
}
OUT(" | (%lld << 2))", tag->tag_value);
OUT(" | (%" PRIdASN " << 2))", tag->tag_value);
return 0;
}
......
......@@ -470,20 +470,20 @@ emit_range_comparison_code(arg_t *arg, asn1cnst_range_t *range, const char *varn
}
if(ignore_left) {
OUT("%s <= %lld", varname,
(long long)r->right.value);
OUT("%s <= %" PRIdASN, varname,
r->right.value);
} else if(ignore_right) {
OUT("%s >= %lld", varname,
(long long)r->left.value);
OUT("%s >= %" PRIdASN, varname,
r->left.value);
} else if(r->left.value == r->right.value) {
OUT("%s == %lld", varname,
(long long)r->right.value);
OUT("%s == %" PRIdASN, varname,
r->right.value);
} else {
OUT("%s >= %lld && %s <= %lld",
OUT("%s >= %" PRIdASN " && %s <= %" PRIdASN,
varname,
(long long)r->left.value,
r->left.value,
varname,
(long long)r->right.value);
r->right.value);
}
if(r != range) OUT(")");
generated_something = 1;
......
......@@ -157,7 +157,7 @@ _edge_value(const asn1cnst_edge_t *edge) {
case ARE_MIN: strcpy(buf, "MIN"); break;
case ARE_MAX: strcpy(buf, "MAX"); break;
case ARE_VALUE:
snprintf(buf, sizeof(buf), "%lld", (long long)edge->value);
snprintf(buf, sizeof(buf), "%" PRIdASN, edge->value);
}
return buf;
}
......@@ -280,9 +280,9 @@ static int _range_fill(asn1p_value_t *val, const asn1cnst_range_t *minmax, asn1c
switch(val->type) {
case ATV_INTEGER:
if(type != ACT_EL_RANGE && type != ACT_CT_SIZE) {
FATAL("Integer %lld value invalid "
FATAL("Integer %" PRIdASN " value invalid "
"for %s constraint at line %d",
(long long)val->value.v_integer,
val->value.v_integer,
asn1p_constraint_type2str(type), lineno);
return -1;
}
......
......@@ -102,9 +102,9 @@ asn1f_fix_enum(arg_t *arg) {
*/
FATAL(
"Enumeration %s at line %d: "
"Explicit value \"%s(%lld)\" "
"Explicit value \"%s(%" PRIdASN ")\" "
"is not greater "
"than previous values (max %lld)",
"than previous values (max %" PRIdASN ")",
expr->Identifier,
ev->_lineno,
ev->Identifier,
......
......@@ -51,8 +51,8 @@ asn1f_printable_value(asn1p_value_t *v) {
memcpy(buf + sizeof(buf) - 4, "...", 4);
return buf;
case ATV_INTEGER:
ret = snprintf(buf, sizeof(buf), "%lld",
(long long)v->value.v_integer);
ret = snprintf(buf, sizeof(buf), "%" PRIdASN,
v->value.v_integer);
if(ret >= (ssize_t)sizeof(buf))
memcpy(buf + sizeof(buf) - 4, "...", 4);
return buf;
......
......@@ -102,8 +102,7 @@ asn1print_oid(asn1p_oid_t *oid, enum asn1print_flags flags) {
if(oid->arcs[ac].name) {
printf("%s", oid->arcs[ac].name);
if(oid->arcs[ac].number >= 0) {
printf("(%lld)",
(long long)oid->arcs[ac].number);
printf("(%" PRIdASN ")", oid->arcs[ac].number);
}
accum += strlen(oid->arcs[ac].name);
} else {
......@@ -151,7 +150,7 @@ asn1print_tag(asn1p_expr_t *tc, enum asn1print_flags flags) {
case TC_CONTEXT_SPECIFIC:
break;
}
printf("%lld]", (long long)tag->tag_value);
printf("%" PRIdASN "]", tag->tag_value);
switch(tag->tag_mode) {
case TM_DEFAULT: break;
......@@ -178,7 +177,7 @@ asn1print_value(asn1p_value_t *val, enum asn1print_flags flags) {
printf("%f", val->value.v_double);
return 0;
case ATV_INTEGER:
printf("%lld", (long long)val->value.v_integer);
printf("%" PRIdASN, val->value.v_integer);
return 0;
case ATV_MIN: printf("MIN"); return 0;
case ATV_MAX: printf("MAX"); return 0;
......@@ -367,7 +366,7 @@ asn1print_crange_value(asn1cnst_edge_t *edge, int as_char) {
if(as_char) {
printf("\"%c\"", (unsigned char)edge->value);
} else {
printf("%lld", (long long)edge->value);
printf("%" PRIdASN, edge->value);
}
}
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment