constness fixes, round-trip and fuzz-testing for CHOICE
diff --git a/skeletons/OPEN_TYPE.c b/skeletons/OPEN_TYPE.c
index 4786799..c672992 100644
--- a/skeletons/OPEN_TYPE.c
+++ b/skeletons/OPEN_TYPE.c
@@ -37,9 +37,9 @@
} while(0)
asn_dec_rval_t
-OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
- void *sptr, asn_TYPE_member_t *elm, const void *ptr,
- size_t size) {
+OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx,
+ const asn_TYPE_descriptor_t *td, void *sptr,
+ const asn_TYPE_member_t *elm, const void *ptr, size_t size) {
size_t consumed_myself = 0;
asn_type_selector_result_t selected;
void *memb_ptr; /* Pointer to the member */
@@ -122,9 +122,9 @@
}
asn_dec_rval_t
-OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
- void *sptr, asn_TYPE_member_t *elm, const void *ptr,
- size_t size) {
+OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx,
+ const asn_TYPE_descriptor_t *td, void *sptr,
+ const asn_TYPE_member_t *elm, const void *ptr, size_t size) {
size_t consumed_myself = 0;
asn_type_selector_result_t selected;
void *memb_ptr; /* Pointer to the member */
@@ -287,8 +287,8 @@
asn_dec_rval_t
OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
- asn_TYPE_descriptor_t *td, void *sptr,
- asn_TYPE_member_t *elm, asn_per_data_t *pd) {
+ const asn_TYPE_descriptor_t *td, void *sptr,
+ const asn_TYPE_member_t *elm, asn_per_data_t *pd) {
asn_type_selector_result_t selected;
void *memb_ptr; /* Pointer to the member */
void **memb_ptr2; /* Pointer to that pointer */
@@ -361,10 +361,10 @@
}
asn_enc_rval_t
-OPEN_TYPE_encode_uper(asn_TYPE_descriptor_t *td,
- const asn_per_constraints_t *constraints, void *sptr,
- asn_per_outp_t *po) {
- void *memb_ptr; /* Pointer to the member */
+OPEN_TYPE_encode_uper(const asn_TYPE_descriptor_t *td,
+ const asn_per_constraints_t *constraints,
+ const void *sptr, asn_per_outp_t *po) {
+ const void *memb_ptr; /* Pointer to the member */
asn_TYPE_member_t *elm; /* CHOICE's element */
asn_enc_rval_t er;
unsigned present;
@@ -383,10 +383,11 @@
elm = &td->elements[present];
if(elm->flags & ATF_POINTER) {
/* Member is a pointer to another structure */
- memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
+ memb_ptr =
+ *(const void *const *)((const char *)sptr + elm->memb_offset);
if(!memb_ptr) ASN__ENCODE_FAILED;
} else {
- memb_ptr = (char *)sptr + elm->memb_offset;
+ memb_ptr = (const char *)sptr + elm->memb_offset;
}
if(uper_open_type_put(elm->type, NULL, memb_ptr, po) < 0) {