pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-cbc/+/28658 )
Change subject: sbcap: Update asn1c skeleton files
......................................................................
sbcap: Update asn1c skeleton files
Update skeleton files using newest asn1c with APER support [1],
commit eb4cd0c2a891a7dbfe90b4cb8cca545879b6d622.
This contains APER fixes for 32bit architectures.
[1]
https://github.com/mouse07410/asn1c/tree/vlm_master/
Change-Id: I9ca556dec639223a8d37badb908fab254826192e
---
M src/sbcap/gen/INTEGER_aper.c
M src/sbcap/gen/NativeEnumerated_aper.c
M src/sbcap/gen/OCTET_STRING_aper.c
M src/sbcap/gen/aper_opentype.c
M src/sbcap/gen/aper_support.c
M src/sbcap/gen/constr_CHOICE_aper.c
M src/sbcap/gen/constr_SEQUENCE_OF_aper.c
M src/sbcap/gen/constr_SEQUENCE_aper.c
M src/sbcap/gen/constr_SET_OF_aper.c
9 files changed, 51 insertions(+), 41 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/sbcap/gen/INTEGER_aper.c b/src/sbcap/gen/INTEGER_aper.c
index bd19de1..fc88268 100644
--- a/src/sbcap/gen/INTEGER_aper.c
+++ b/src/sbcap/gen/INTEGER_aper.c
@@ -87,8 +87,8 @@
? asn_uint642INTEGER(st, (unsigned long)value)
: asn_int642INTEGER(st, value))
ASN__DECODE_FAILED;
- ASN_DEBUG("Got value %ld + low %ld",
- value, ct->lower_bound);
+ ASN_DEBUG("Got value %ld + low %lld",
+ value, (long long int)ct->lower_bound);
} else {
long value = 0;
if (ct->range_bits < 8) {
@@ -111,8 +111,8 @@
? asn_ulong2INTEGER(st, value)
: asn_long2INTEGER(st, value))
ASN__DECODE_FAILED;
- ASN_DEBUG("Got value %ld + low %ld",
- value, ct->lower_bound);
+ ASN_DEBUG("Got value %ld + low %lld",
+ value, (long long int)ct->lower_bound);
}
return rval;
} else {
@@ -191,9 +191,10 @@
|| uval > (unsigned long)ct->upper_bound)
inext = 1;
}
- ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
+ ASN_DEBUG("Value %lu (%02x/%zu) lb %lld ub %lld %s",
uval, st->buf[0], st->size,
- ct->lower_bound, ct->upper_bound,
+ (long long int)ct->lower_bound,
+ (long long int)ct->upper_bound,
inext ? "ext" : "fix");
value = uval;
} else {
@@ -207,9 +208,10 @@
|| value > ct->upper_bound)
inext = 1;
}
- ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
+ ASN_DEBUG("Value %lu (%02x/%zu) lb %lld ub %lld %s",
value, st->buf[0], st->size,
- ct->lower_bound, ct->upper_bound,
+ (long long int)ct->lower_bound,
+ (long long int)ct->upper_bound,
inext ? "ext" : "fix");
}
if(ct->flags & APC_EXTENSIBLE) {
@@ -226,8 +228,9 @@
unsigned long v;
/* #10.5.6 */
- ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits",
- value, value - ct->lower_bound, ct->range_bits);
+ ASN_DEBUG("Encoding integer %ld (%lld) with range %d bits",
+ value, (long long int)(value - ct->lower_bound),
+ ct->range_bits);
v = value - ct->lower_bound;
@@ -284,7 +287,7 @@
}
if(ct && ct->lower_bound) {
- ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
+ ASN_DEBUG("Adjust lower bound to %lld", (long long
int)ct->lower_bound);
/* TODO: adjust lower bound */
ASN__ENCODE_FAILED;
}
diff --git a/src/sbcap/gen/NativeEnumerated_aper.c
b/src/sbcap/gen/NativeEnumerated_aper.c
index 817a783..5c4c256 100644
--- a/src/sbcap/gen/NativeEnumerated_aper.c
+++ b/src/sbcap/gen/NativeEnumerated_aper.c
@@ -42,8 +42,10 @@
if(ct && ct->upper_bound >= 255) {
int padding = 0;
padding = (8 - (pd->moved % 8)) % 8;
- ASN_DEBUG("For NativeEnumerated %s,offset= %lu Padding bits = %d",
td->name, pd->moved, padding);
- ASN_DEBUG("For NativeEnumerated %s, upper bound = %lu", td->name,
ct->upper_bound);
+ ASN_DEBUG("For NativeEnumerated %s,offset = %zu Padding bits = %d",
+ td->name, pd->moved, padding);
+ ASN_DEBUG("For NativeEnumerated %s, upper bound = %llu",
+ td->name, (unsigned long long)ct->upper_bound);
if(padding > 0)
per_get_few_bits(pd, padding);
}
diff --git a/src/sbcap/gen/OCTET_STRING_aper.c b/src/sbcap/gen/OCTET_STRING_aper.c
index fb760c4..0373fe6 100644
--- a/src/sbcap/gen/OCTET_STRING_aper.c
+++ b/src/sbcap/gen/OCTET_STRING_aper.c
@@ -100,9 +100,10 @@
if(!st) RETURN(RC_FAIL);
}
- ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+ ASN_DEBUG("PER Decoding %s size %lld .. %lld bits %d",
csiz->flags & APC_EXTENSIBLE ? "extensible" :
"non-extensible",
- csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+ (long long int)csiz->lower_bound, (long long int)csiz->upper_bound,
+ csiz->effective_bits);
if(csiz->flags & APC_EXTENSIBLE) {
int inext = per_get_few_bits(pd, 1);
@@ -136,8 +137,8 @@
RETURN(RC_FAIL);
}
if(bpc) {
- ASN_DEBUG("Decoding OCTET STRING size %ld",
- csiz->upper_bound);
+ ASN_DEBUG("Decoding OCTET STRING size %lld",
+ (long long int)csiz->upper_bound);
ret = OCTET_STRING_per_get_characters(pd, st->buf,
csiz->upper_bound,
bpc, unit_bits,
@@ -146,8 +147,8 @@
pc);
if(ret > 0) RETURN(RC_FAIL);
} else {
- ASN_DEBUG("Decoding BIT STRING size %ld",
- csiz->upper_bound);
+ ASN_DEBUG("Decoding BIT STRING size %lld",
+ (long long int)csiz->upper_bound);
ret = per_get_many_bits(pd, st->buf, 0,
unit_bits * csiz->upper_bound);
}
@@ -307,9 +308,10 @@
}
ASN_DEBUG("Encoding %s into %d units of %d bits"
- " (%ld..%ld, effective %d)%s",
+ " (%lld..%lld, effective %d)%s",
td->name, sizeinunits, unit_bits,
- csiz->lower_bound, csiz->upper_bound,
+ (long long int)csiz->lower_bound,
+ (long long int)csiz->upper_bound,
csiz->effective_bits, ct_extensible ? " EXT" : "");
/* Figure out wheter size lies within PER visible constraint */
@@ -339,8 +341,8 @@
/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
if(csiz->effective_bits >= 0) {
- ASN_DEBUG("Encoding %lu bytes (%ld), length in %d bits",
- st->size, sizeinunits - csiz->lower_bound,
+ ASN_DEBUG("Encoding %zu bytes (%lld), length in %d bits",
+ st->size, (long long int)(sizeinunits - csiz->lower_bound),
csiz->effective_bits);
if (csiz->effective_bits > 0) {
ret = aper_put_length(po, csiz->lower_bound, csiz->upper_bound,
@@ -369,7 +371,7 @@
ASN__ENCODED_OK(er);
}
- ASN_DEBUG("Encoding %lu bytes", st->size);
+ ASN_DEBUG("Encoding %zu bytes", st->size);
if(sizeinunits == 0) {
if(aper_put_length(po, -1, -1, 0, NULL) < 0)
diff --git a/src/sbcap/gen/aper_opentype.c b/src/sbcap/gen/aper_opentype.c
index 97cc410..cdd5999 100644
--- a/src/sbcap/gen/aper_opentype.c
+++ b/src/sbcap/gen/aper_opentype.c
@@ -115,7 +115,7 @@
FREEMEM(buf);
if(toGo) return -1;
- ASN_DEBUG("Open type put %s of length %ld + overhead (1byte?)",
+ ASN_DEBUG("Open type put %s of length %zd + overhead (1byte?)",
td->name, size);
return 0;
diff --git a/src/sbcap/gen/aper_support.c b/src/sbcap/gen/aper_support.c
index 9ca8614..1f34c60 100644
--- a/src/sbcap/gen/aper_support.c
+++ b/src/sbcap/gen/aper_support.c
@@ -59,7 +59,7 @@
if(per_get_few_bits(pd, 1) == 0) {
length = per_get_few_bits(pd, 6) + 1;
if(length <= 0) return -1;
- ASN_DEBUG("l=%ld", length);
+ ASN_DEBUG("l=%zd", length);
return length;
} else {
int repeat;
diff --git a/src/sbcap/gen/constr_CHOICE_aper.c b/src/sbcap/gen/constr_CHOICE_aper.c
index 0df8568..88daaf2 100644
--- a/src/sbcap/gen/constr_CHOICE_aper.c
+++ b/src/sbcap/gen/constr_CHOICE_aper.c
@@ -13,12 +13,12 @@
const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t
*pd) {
const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t
*)td->specifics;
asn_dec_rval_t rv;
- const asn_per_constraint_t *ct;
- asn_TYPE_member_t *elm; /* CHOICE's element */
- void *memb_ptr;
- void **memb_ptr2;
+ const asn_per_constraint_t *ct = NULL;
+ asn_TYPE_member_t *elm = NULL; /* CHOICE's element */
+ void *memb_ptr = NULL;
+ void **memb_ptr2 = NULL;
void *st = *sptr;
- int value;
+ int value = 0;
if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
ASN__DECODE_FAILED;
diff --git a/src/sbcap/gen/constr_SEQUENCE_OF_aper.c
b/src/sbcap/gen/constr_SEQUENCE_OF_aper.c
index 038657a..ff3ae8b 100644
--- a/src/sbcap/gen/constr_SEQUENCE_OF_aper.c
+++ b/src/sbcap/gen/constr_SEQUENCE_OF_aper.c
@@ -33,8 +33,9 @@
if(ct) {
int not_in_root = (list->count < ct->lower_bound
|| list->count > ct->upper_bound);
- ASN_DEBUG("lb %ld ub %ld %s",
- ct->lower_bound, ct->upper_bound,
+ ASN_DEBUG("lb %lld ub %lld %s",
+ (long long int)ct->lower_bound,
+ (long long int)ct->upper_bound,
ct->flags & APC_EXTENSIBLE ? "ext" :
"fix");
if(ct->flags & APC_EXTENSIBLE) {
/* Declare whether size is in extension root */
diff --git a/src/sbcap/gen/constr_SEQUENCE_aper.c b/src/sbcap/gen/constr_SEQUENCE_aper.c
index 5d05921..895b6da 100644
--- a/src/sbcap/gen/constr_SEQUENCE_aper.c
+++ b/src/sbcap/gen/constr_SEQUENCE_aper.c
@@ -175,7 +175,7 @@
memset(&epmd, 0, sizeof(epmd));
epmd.buffer = epres;
epmd.nbits = bmlength;
- ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)",
+ ASN_DEBUG("Read in extensions bitmap for %s of %zd bits (%x..)",
td->name, bmlength, *epres);
/* Deal with padding */
@@ -190,7 +190,7 @@
int present;
if(!IN_EXTENSION_GROUP(specs, edx)) {
- ASN_DEBUG("%ld is not extension", edx);
+ ASN_DEBUG("%zu is not extension", edx);
continue;
}
@@ -288,7 +288,7 @@
int present;
if(!IN_EXTENSION_GROUP(specs, edx)) {
- ASN_DEBUG("%s (@%ld) is not extension", elm->type->name,
edx);
+ ASN_DEBUG("%s (@%zu) is not extension", elm->type->name,
edx);
continue;
}
@@ -302,7 +302,7 @@
present = 1;
}
- ASN_DEBUG("checking %s (@%ld) present => %d",
+ ASN_DEBUG("checking %s (@%zu) present => %d",
elm->type->name, edx, present);
exts_count++;
exts_present += present;
@@ -410,7 +410,7 @@
if(elm->flags & ATF_POINTER) {
memb_ptr2 = (const void * const *)((const char *)sptr +
elm->memb_offset);
if(!*memb_ptr2) {
- ASN_DEBUG("Element %s %ld not present",
+ ASN_DEBUG("Element %s %zu not present",
elm->name, edx);
if(elm->optional)
continue;
diff --git a/src/sbcap/gen/constr_SET_OF_aper.c b/src/sbcap/gen/constr_SET_OF_aper.c
index 72d52a6..87c341e 100644
--- a/src/sbcap/gen/constr_SET_OF_aper.c
+++ b/src/sbcap/gen/constr_SET_OF_aper.c
@@ -34,7 +34,9 @@
if(ct) {
int not_in_root =
(list->count < ct->lower_bound || list->count >
ct->upper_bound);
- ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound,
+ ASN_DEBUG("lb %lld ub %lld %s",
+ (long long int)ct->lower_bound,
+ (long long int)ct->upper_bound,
ct->flags & APC_EXTENSIBLE ? "ext" :
"fix");
if(ct->flags & APC_EXTENSIBLE) {
/* Declare whether size is in extension root */
@@ -130,8 +132,8 @@
if(ct && ct->effective_bits >= 0) {
/* X.691, #19.5: No length determinant */
nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound + 1);
- ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
- (long)nelems, ct->lower_bound, td->name);
+ ASN_DEBUG("Preparing to fetch %ld+%lld elements from %s",
+ (long)nelems, (long long int)ct->lower_bound, td->name);
if(nelems < 0) ASN__DECODE_STARVED;
nelems += ct->lower_bound;
} else {
--
To view, visit
https://gerrit.osmocom.org/c/osmo-cbc/+/28658
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: I9ca556dec639223a8d37badb908fab254826192e
Gerrit-Change-Number: 28658
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged