Commit d84f6032 authored by Lev Walkin's avatar Lev Walkin

ensure compilation with -std=89 and make constness explicit.

parent aa067a98
......@@ -186,8 +186,8 @@ asn_dec_rval_t
ANY_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_ANY_specs;
size_t consumed_myself = 0;
int repeat;
......
......@@ -319,8 +319,8 @@ BIT_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
const asn_per_constraints_t *pc =
constraints ? constraints : td->encoding_constraints.per_constraints;
......@@ -422,8 +422,8 @@ asn_enc_rval_t
BIT_STRING_encode_uper(asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void *sptr,
asn_per_outp_t *po) {
asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
const asn_per_constraints_t *pc =
constraints ? constraints : td->encoding_constraints.per_constraints;
......@@ -486,9 +486,9 @@ BIT_STRING_encode_uper(asn_TYPE_descriptor_t *td,
}
if(csiz->effective_bits >= 0 && !inext) {
int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound;
ASN_DEBUG("Encoding %zu bytes (%ld), length in %d bits", st->size,
size_in_bits - csiz->lower_bound, csiz->effective_bits);
int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound;
ret = per_put_few_bits(
po,
add_trailer ? csiz->lower_bound : size_in_bits - csiz->lower_bound,
......@@ -542,8 +542,8 @@ asn_random_fill_result_t
BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
const asn_encoding_constraints_t *constraints,
size_t max_length) {
asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
......
CFLAGS = $(filter-out $(CODE_COVERAGE_CFLAGS), @CFLAGS@)
AM_CFLAGS = $(SKELETONS_CFLAGS)
CFLAGS += ${SKELETONS_CFLAGS} # Put -std=c89 at the end!
dist_pkgdata_DATA = \
${srcdir}/README \
......
......@@ -180,8 +180,8 @@ asn_dec_rval_t
OCTET_STRING_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td,
void **sptr, const void *buf_ptr, size_t size, int tag_mode) {
asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs;
BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
asn_dec_rval_t rval;
......@@ -258,7 +258,7 @@ OCTET_STRING_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
?size:(size_t)sel->left);
ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel,
ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", (void *)sel,
(long)(sel?sel->left:0),
(long)(sel?sel->want_nulls:0),
(long)(sel?sel->got:0)
......@@ -495,7 +495,7 @@ OCTET_STRING_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
if(sel) {
ASN_DEBUG("3sel p=%p, wn=%d, l=%ld, g=%ld, size=%ld",
sel->prev, sel->want_nulls,
(void *)sel->prev, sel->want_nulls,
(long)sel->left, (long)sel->got, (long)size);
if(sel->prev || sel->want_nulls > 1 || sel->left > 0) {
RETURN(RC_WMORE);
......@@ -536,8 +536,8 @@ OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
int tag_mode, ber_tlv_tag_t tag,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er;
asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs;
BIT_STRING_t *st = (BIT_STRING_t *)sptr;
enum asn_OS_Subvariant type_variant = specs->subvariant;
......@@ -1125,8 +1125,8 @@ OCTET_STRING__decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
int have_more)
) {
OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs;
const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
asn_struct_ctx_t *ctx; /* Per-structure parser context */
......@@ -1348,8 +1348,8 @@ OCTET_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs;
const asn_per_constraints_t *pc =
constraints ? constraints : td->encoding_constraints.per_constraints;
......@@ -1497,8 +1497,8 @@ asn_enc_rval_t
OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void *sptr,
asn_per_outp_t *po) {
asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs;
const asn_per_constraints_t *pc = constraints ? constraints
: td->encoding_constraints.per_constraints;
......@@ -1699,7 +1699,7 @@ void
OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr,
enum asn_struct_free_method method) {
OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
asn_OCTET_STRING_specifics_t *specs;
const asn_OCTET_STRING_specifics_t *specs;
asn_struct_ctx_t *ctx;
struct _stack *stck;
......@@ -1707,7 +1707,7 @@ OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr,
return;
specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs;
ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
......@@ -1739,7 +1739,8 @@ OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr,
break;
case ASFM_FREE_UNDERLYING_AND_RESET:
memset(sptr, 0,
((asn_OCTET_STRING_specifics_t *)(td->specifics))->struct_size);
((const asn_OCTET_STRING_specifics_t *)(td->specifics))
->struct_size);
break;
}
}
......@@ -1865,8 +1866,8 @@ asn_random_fill_result_t
OCTET_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
const asn_encoding_constraints_t *constraints,
size_t max_length) {
asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs;
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
......
......@@ -71,7 +71,7 @@ OCTET_STRING_t *OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td,
* Internally useful stuff. *
****************************/
typedef const struct asn_OCTET_STRING_specifics_s {
typedef struct asn_OCTET_STRING_specifics_s {
/*
* Target structure description.
*/
......
......@@ -14,10 +14,9 @@ OCTET_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) {
asn_OCTET_STRING_specifics_t *specs =
td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
: (asn_OCTET_STRING_specifics_t *)&asn_SPC_OCTET_STRING_specs;
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs;
OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
const asn_oer_constraints_t *cts =
constraints ? constraints : td->encoding_constraints.oer_constraints;
......@@ -104,10 +103,9 @@ asn_enc_rval_t
OCTET_STRING_encode_oer(asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_OCTET_STRING_specifics_t *specs =
td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics
: (asn_OCTET_STRING_specifics_t *)&asn_SPC_OCTET_STRING_specs;
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs;
OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
const asn_oer_constraints_t *cts =
constraints ? constraints : td->encoding_constraints.oer_constraints;
......
......@@ -107,7 +107,8 @@ OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *t
}
if(*memb_ptr2) {
asn_CHOICE_specifics_t *specs = selected.type_descriptor->specifics;
const asn_CHOICE_specifics_t *specs =
selected.type_descriptor->specifics;
if(elm->flags & ATF_POINTER) {
ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
*memb_ptr2 = NULL;
......@@ -228,7 +229,8 @@ OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *t
* will have to be restarted.
*/
if(*memb_ptr2) {
asn_CHOICE_specifics_t *specs = selected.type_descriptor->specifics;
const asn_CHOICE_specifics_t *specs =
selected.type_descriptor->specifics;
if(elm->flags & ATF_POINTER) {
ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
*memb_ptr2 = NULL;
......@@ -343,7 +345,8 @@ OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
case RC_WMORE:
case RC_FAIL:
if(*memb_ptr2) {
asn_CHOICE_specifics_t *specs = selected.type_descriptor->specifics;
const asn_CHOICE_specifics_t *specs =
selected.type_descriptor->specifics;
if(elm->flags & ATF_POINTER) {
ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
*memb_ptr2 = NULL;
......
......@@ -77,7 +77,8 @@ OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *t
}
if(*memb_ptr2) {
asn_CHOICE_specifics_t *specs = selected.type_descriptor->specifics;
const asn_CHOICE_specifics_t *specs =
selected.type_descriptor->specifics;
if(elm->flags & ATF_POINTER) {
ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
*memb_ptr2 = NULL;
......
......@@ -172,7 +172,7 @@ asn_put_few_bits(asn_bit_outp_t *po, uint32_t bits, int obits) {
if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
obits, (int)bits, po->buffer, (int)po->nboff);
obits, (int)bits, (void *)po->buffer, (int)po->nboff);
/*
* Normalize position indicator.
......
......@@ -55,14 +55,14 @@ int asn_debug_indent;
__FILE__, __LINE__); \
} while(0)
#else /* !__GNUC__ */
void ASN_DEBUG_f(const char *fmt, ...);
void CC_PRINTFLIKE(1, 2) ASN_DEBUG_f(const char *fmt, ...);
#define ASN_DEBUG ASN_DEBUG_f
#endif /* __GNUC__ */
#else /* EMIT_ASN_DEBUG != 1 */
#if __STDC_VERSION__ >= 199901L
#define ASN_DEBUG(...) do{}while(0)
#else /* not C99 */
static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
static void CC_PRINTFLIKE(1, 2) ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
#endif /* C99 or better */
#endif /* EMIT_ASN_DEBUG */
#endif /* ASN_DEBUG */
......
......@@ -133,8 +133,9 @@ typedef unsigned int uint32_t;
#endif /* __GNUC__ */
#endif /* MIN */
#if __STDC_VERSION__ >= 199901L
#ifndef SIZE_MAX
#define SIZE_MAX ULONG_MAX
#define SIZE_MAX ((~((size_t)0)) >> 1)
#endif
#ifndef RSIZE_MAX /* C11, Annex K */
......@@ -143,5 +144,13 @@ typedef unsigned int uint32_t;
#ifndef RSSIZE_MAX /* Halve signed size even further than unsigned */
#define RSSIZE_MAX ((ssize_t)(RSIZE_MAX >> 1))
#endif
#else /* Old compiler */
#undef SIZE_MAX
#undef RSIZE_MAX
#undef RSSIZE_MAX
#define SIZE_MAX ((~((size_t)0)) >> 1)
#define RSIZE_MAX (SIZE_MAX >> 1)
#define RSSIZE_MAX ((ssize_t)(RSIZE_MAX >> 1))
#endif
#endif /* ASN_SYSTEM_H */
......@@ -108,7 +108,8 @@ CHOICE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *t
/*
* Bring closer parts of structure description.
*/
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs =
(const asn_CHOICE_specifics_t *)td->specifics;
asn_TYPE_member_t *elements = td->elements;
/*
......@@ -362,7 +363,7 @@ asn_enc_rval_t
CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
int tag_mode, ber_tlv_tag_t tag,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
asn_TYPE_member_t *elm; /* CHOICE element */
asn_enc_rval_t erval;
void *memb_ptr;
......@@ -451,7 +452,7 @@ CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
ber_tlv_tag_t
CHOICE_outmost_tag(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
unsigned present;
assert(tag_mode == 0); (void)tag_mode;
......@@ -484,7 +485,7 @@ CHOICE_outmost_tag(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mod
int
CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
unsigned present;
if(!sptr) {
......@@ -549,7 +550,7 @@ CHOICE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *t
/*
* Bring closer parts of structure description.
*/
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
/*
......@@ -776,7 +777,7 @@ asn_enc_rval_t
CHOICE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
int ilevel, enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_CHOICE_specifics_t *specs=(asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs=(const asn_CHOICE_specifics_t *)td->specifics;
asn_enc_rval_t er;
unsigned present;
......@@ -828,8 +829,9 @@ asn_dec_rval_t
CHOICE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
asn_dec_rval_t rv;
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;
......@@ -910,7 +912,7 @@ asn_enc_rval_t
CHOICE_encode_uper(asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void *sptr,
asn_per_outp_t *po) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
asn_TYPE_member_t *elm; /* CHOICE's element */
const asn_per_constraint_t *ct;
void *memb_ptr;
......@@ -994,7 +996,7 @@ CHOICE_encode_uper(asn_TYPE_descriptor_t *td,
int
CHOICE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
unsigned present;
if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
......@@ -1035,8 +1037,9 @@ CHOICE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
void
CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr,
enum asn_struct_free_method method) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
unsigned present;
const asn_CHOICE_specifics_t *specs =
(const asn_CHOICE_specifics_t *)td->specifics;
unsigned present;
if(!td || !ptr)
return;
......@@ -1127,7 +1130,8 @@ _set_present_idx(void *struct_ptr, unsigned pres_offset, unsigned pres_size,
static const void *
_get_member_ptr(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_TYPE_member_t **elm_ptr, unsigned *present_out) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs =
(const asn_CHOICE_specifics_t *)td->specifics;
unsigned present;
if(!sptr) {
......@@ -1196,7 +1200,8 @@ CHOICE_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bp
*/
unsigned
CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, const void *sptr) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs =
(const asn_CHOICE_specifics_t *)td->specifics;
return _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
}
......@@ -1209,7 +1214,8 @@ CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, const void *sptr) {
int
CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, void *sptr,
unsigned present) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs =
(const asn_CHOICE_specifics_t *)td->specifics;
unsigned old_present;
if(!sptr) {
......
......@@ -12,7 +12,7 @@
extern "C" {
#endif
typedef const struct asn_CHOICE_specifics_s {
typedef struct asn_CHOICE_specifics_s {
/*
* Target structure description.
*/
......
......@@ -131,7 +131,8 @@ CHOICE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *t
/*
* Bring closer parts of structure description.
*/
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs =
(const asn_CHOICE_specifics_t *)td->specifics;
asn_TYPE_member_t *elements = td->elements;
/*
......@@ -311,7 +312,8 @@ asn_enc_rval_t
CHOICE_encode_oer(asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
const asn_CHOICE_specifics_t *specs =
(const asn_CHOICE_specifics_t *)td->specifics;
asn_TYPE_member_t *elm; /* CHOICE element */
unsigned present;
void *memb_ptr;
......
......@@ -115,7 +115,7 @@ SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t
/*
* Bring closer parts of structure description.
*/
asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
asn_TYPE_member_t *elements = td->elements;
/*
......@@ -634,8 +634,8 @@ SEQUENCE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t
/*
* Bring closer parts of structure description.
*/
asn_SEQUENCE_specifics_t *specs
= (asn_SEQUENCE_specifics_t *)td->specifics;
const asn_SEQUENCE_specifics_t *specs
= (const asn_SEQUENCE_specifics_t *)td->specifics;
asn_TYPE_member_t *elements = td->elements;
const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
......@@ -1020,8 +1020,9 @@ SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr,
case ASFM_FREE_UNDERLYING:
break;
case ASFM_FREE_UNDERLYING_AND_RESET:
memset(sptr, 0,
((asn_SEQUENCE_specifics_t *)(td->specifics))->struct_size);
memset(
sptr, 0,
((const asn_SEQUENCE_specifics_t *)(td->specifics))->struct_size);
break;
}
}
......@@ -1078,7 +1079,7 @@ asn_dec_rval_t
SEQUENCE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
void *st = *sptr; /* Target structure. */
int extpresent; /* Extension additions are present */
uint8_t *opres; /* Presence of optional root members */
......@@ -1298,8 +1299,8 @@ SEQUENCE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t
static int
SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
asn_per_outp_t *po1, asn_per_outp_t *po2) {
asn_SEQUENCE_specifics_t *specs
= (asn_SEQUENCE_specifics_t *)td->specifics;
const asn_SEQUENCE_specifics_t *specs
= (const asn_SEQUENCE_specifics_t *)td->specifics;
int exts_present = 0;
int exts_count = 0;
size_t edx;
......@@ -1351,8 +1352,8 @@ asn_enc_rval_t
SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void *sptr,
asn_per_outp_t *po) {
asn_SEQUENCE_specifics_t *specs
= (asn_SEQUENCE_specifics_t *)td->specifics;
const asn_SEQUENCE_specifics_t *specs
= (const asn_SEQUENCE_specifics_t *)td->specifics;
asn_enc_rval_t er;
int n_extensions;
size_t edx;
......
......@@ -11,7 +11,7 @@
extern "C" {
#endif
typedef const struct asn_SEQUENCE_specifics_s {
typedef struct asn_SEQUENCE_specifics_s {
/*
* Target structure description.
*/
......
......@@ -92,7 +92,7 @@ SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, int ilevel,
enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er;
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
asn_TYPE_member_t *elm = td->elements;
asn_anonymous_sequence_ *list = _A_SEQUENCE_FROM_VOID(sptr);
const char *mname = specs->as_XMLValueList
......
......@@ -79,7 +79,8 @@ asn_dec_rval_t
SEQUENCE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **struct_ptr,
const void *ptr, size_t size) {
asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
const asn_SEQUENCE_specifics_t *specs =
(const asn_SEQUENCE_specifics_t *)td->specifics;
asn_dec_rval_t rval = {RC_OK, 0};
void *st = *struct_ptr; /* Target structure */
asn_struct_ctx_t *ctx; /* Decoder context */
......@@ -390,7 +391,7 @@ asn_enc_rval_t
SEQUENCE_encode_oer(asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
size_t computed_size = 0;
int has_extensions_bit = (specs->ext_before >= 0);
size_t preamble_bits = (has_extensions_bit + specs->roms_count);
......
......@@ -99,7 +99,7 @@ SET_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/*
* Bring closer parts of structure description.
*/
asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics;
const asn_SET_specifics_t *specs = (const asn_SET_specifics_t *)td->specifics;
asn_TYPE_member_t *elements = td->elements;
/*
......@@ -393,7 +393,7 @@ SET_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
static int
_SET_is_populated(asn_TYPE_descriptor_t *td, void *st) {
asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics;
const asn_SET_specifics_t *specs = (const asn_SET_specifics_t *)td->specifics;
size_t edx;
/*
......@@ -435,7 +435,7 @@ asn_enc_rval_t
SET_encode_der(asn_TYPE_descriptor_t *td,
void *sptr, int tag_mode, ber_tlv_tag_t tag,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics;
const asn_SET_specifics_t *specs = (const asn_SET_specifics_t *)td->specifics;
size_t computed_size = 0;
asn_enc_rval_t er;
int t2m_build_own = (specs->tag2el_count != td->elements_count);
......@@ -611,7 +611,7 @@ SET_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/*
* Bring closer parts of structure description.
*/
asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics;
const asn_SET_specifics_t *specs = (const asn_SET_specifics_t *)td->specifics;
asn_TYPE_member_t *elements = td->elements;
const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
......@@ -824,7 +824,7 @@ asn_enc_rval_t
SET_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
int ilevel, enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics;
const asn_SET_specifics_t *specs = (const asn_SET_specifics_t *)td->specifics;
asn_enc_rval_t er;
int xcan = (flags & XER_F_CANONICAL);
const asn_TYPE_tag2member_t *t2m = specs->tag2el_cxer;
......@@ -958,7 +958,8 @@ SET_free(const asn_TYPE_descriptor_t *td, void *ptr,
case ASFM_FREE_UNDERLYING:
break;
case ASFM_FREE_UNDERLYING_AND_RESET:
memset(ptr, 0, ((asn_SET_specifics_t *)(td->specifics))->struct_size);
memset(ptr, 0,
((const asn_SET_specifics_t *)(td->specifics))->struct_size);
break;
}
}
......
......@@ -12,7 +12,7 @@ extern "C" {
#endif
typedef const struct asn_SET_specifics_s {
typedef struct asn_SET_specifics_s {
/*
* Target structure description.
*/
......
......@@ -71,7 +71,7 @@ SET_OF_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *t
/*
* Bring closer parts of structure description.
*/
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
asn_TYPE_member_t *elm = td->elements; /* Single one */
/*
......@@ -472,7 +472,7 @@ SET_OF_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *t
/*
* Bring closer parts of structure description.
*/
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
asn_TYPE_member_t *element = td->elements;
const char *elm_tag;
const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
......@@ -655,7 +655,7 @@ SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
int ilevel, enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er;
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
asn_TYPE_member_t *elm = td->elements;
asn_anonymous_set_ *list = _A_SET_FROM_VOID(sptr);
const char *mname = specs->as_XMLValueList
......@@ -785,7 +785,7 @@ void
SET_OF_free(const asn_TYPE_descriptor_t *td, void *ptr,
enum asn_struct_free_method method) {
if(td && ptr) {
asn_SET_OF_specifics_t *specs;
const asn_SET_OF_specifics_t *specs;
asn_TYPE_member_t *elm = td->elements;
asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr);
asn_struct_ctx_t *ctx; /* Decoder context */
......@@ -804,7 +804,7 @@ SET_OF_free(const asn_TYPE_descriptor_t *td, void *ptr,
asn_set_empty(list); /* Remove (list->array) */
specs = (asn_SET_OF_specifics_t *)td->specifics;
specs = (const asn_SET_OF_specifics_t *)td->specifics;
ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset);
if(ctx->ptr) {
ASN_STRUCT_FREE(*elm->type, ctx->ptr);
......@@ -864,7 +864,7 @@ SET_OF_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
asn_dec_rval_t rv;
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
asn_TYPE_member_t *elm = td->elements; /* Single one */
void *st = *sptr;
asn_anonymous_set_ *list;
......
......@@ -11,7 +11,7 @@
extern "C" {
#endif
typedef const struct asn_SET_OF_specifics_s {
typedef struct asn_SET_OF_specifics_s {
/*
* Target structure description.
*/
......
......@@ -110,7 +110,7 @@ asn_dec_rval_t
SET_OF_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **struct_ptr,
const void *ptr, size_t size) {
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
asn_dec_rval_t rval = {RC_OK, 0};
void *st = *struct_ptr; /* Target structure */
asn_struct_ctx_t *ctx; /* Decoder context */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment