Commit c17d90fb authored by Lev Walkin's avatar Lev Walkin

no lvalue casting

parent 6164294a
...@@ -176,7 +176,8 @@ NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, ...@@ -176,7 +176,8 @@ NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
int *Int = (int *)*sptr; int *Int = (int *)*sptr;
if(!Int) { if(!Int) {
(void *)Int = *sptr = CALLOC(1, sizeof(int)); *sptr = CALLOC(1, sizeof(int));
Int = (int *)*sptr;
if(!Int) { if(!Int) {
rval.code = RC_FAIL; rval.code = RC_FAIL;
rval.consumed = 0; rval.consumed = 0;
......
...@@ -54,7 +54,8 @@ NativeReal_decode_ber(asn_codec_ctx_t *opt_codec_ctx, ...@@ -54,7 +54,8 @@ NativeReal_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
* If the structure is not there, allocate it. * If the structure is not there, allocate it.
*/ */
if(Dbl == NULL) { if(Dbl == NULL) {
(void *)Dbl = *dbl_ptr = CALLOC(1, sizeof(*Dbl)); *dbl_ptr = CALLOC(1, sizeof(*Dbl));
Dbl = (double *)*dbl_ptr;
if(Dbl == NULL) { if(Dbl == NULL) {
rval.code = RC_FAIL; rval.code = RC_FAIL;
rval.consumed = 0; rval.consumed = 0;
...@@ -156,7 +157,8 @@ NativeReal_decode_xer(asn_codec_ctx_t *opt_codec_ctx, ...@@ -156,7 +157,8 @@ NativeReal_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
double *Dbl = (double *)*sptr; double *Dbl = (double *)*sptr;
if(!Dbl) { if(!Dbl) {
(void *)Dbl = *sptr = CALLOC(1, sizeof(double)); *sptr = CALLOC(1, sizeof(double));
Dbl = (double *)*sptr;
if(!Dbl) { if(!Dbl) {
rval.code = RC_FAIL; rval.code = RC_FAIL;
rval.consumed = 0; rval.consumed = 0;
......
...@@ -653,7 +653,7 @@ OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length, ...@@ -653,7 +653,7 @@ OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length,
} state = ST_SKIPSPACE; } state = ST_SKIPSPACE;
if(!oid_text || oid_txt_length < -1 || (arcs_slots && !arcs)) { if(!oid_text || oid_txt_length < -1 || (arcs_slots && !arcs)) {
if(oid_text_end) (const char *)*oid_text_end = oid_text; if(oid_text_end) *(const char **)oid_text_end = oid_text;
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -705,7 +705,7 @@ OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length, ...@@ -705,7 +705,7 @@ OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length,
} /* for() */ } /* for() */
if(oid_text_end) (const char *)*oid_text_end = oid_text; if(oid_text_end) *(const char **)oid_text_end = oid_text;
/* Finalize last arc */ /* Finalize last arc */
switch(state) { switch(state) {
......
...@@ -640,7 +640,7 @@ asn_double2REAL(REAL_t *st, double dbl_value) { ...@@ -640,7 +640,7 @@ asn_double2REAL(REAL_t *st, double dbl_value) {
ptr += buflen; ptr += buflen;
buflen = ptr - buf; buflen = ptr - buf;
(void *)ptr = MALLOC(buflen + 1); ptr = (uint8_t *)MALLOC(buflen + 1);
if(!ptr) return -1; if(!ptr) return -1;
memcpy(ptr, buf, buflen); memcpy(ptr, buf, buflen);
......
...@@ -186,7 +186,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -186,7 +186,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
asn_TYPE_tag2member_t key; asn_TYPE_tag2member_t key;
key.el_tag = tlv_tag; key.el_tag = tlv_tag;
(void *)t2m = bsearch(&key, t2m = (asn_TYPE_tag2member_t *)bsearch(&key,
specs->tag2el, specs->tag2el_count, specs->tag2el, specs->tag2el_count,
sizeof(specs->tag2el[0]), _search4tag); sizeof(specs->tag2el[0]), _search4tag);
if(t2m) { if(t2m) {
......
...@@ -313,7 +313,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -313,7 +313,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
asn_TYPE_tag2member_t key; asn_TYPE_tag2member_t key;
key.el_tag = tlv_tag; key.el_tag = tlv_tag;
key.el_no = edx; key.el_no = edx;
(void *)t2m = bsearch(&key, t2m = (asn_TYPE_tag2member_t *)bsearch(&key,
specs->tag2el, specs->tag2el_count, specs->tag2el, specs->tag2el_count,
sizeof(specs->tag2el[0]), _t2e_cmp); sizeof(specs->tag2el[0]), _t2e_cmp);
if(t2m) { if(t2m) {
......
...@@ -25,7 +25,7 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, ...@@ -25,7 +25,7 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
/* /*
* Gather the length of the underlying members sequence. * Gather the length of the underlying members sequence.
*/ */
(void *)list = ptr; list = (A_SEQUENCE_OF(void) *)ptr;
for(edx = 0; edx < list->count; edx++) { for(edx = 0; edx < list->count; edx++) {
void *memb_ptr = list->array[edx]; void *memb_ptr = list->array[edx];
erval = elm->type->der_encoder(elm->type, memb_ptr, erval = elm->type->der_encoder(elm->type, memb_ptr,
...@@ -102,7 +102,7 @@ SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, ...@@ -102,7 +102,7 @@ SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
er.encoded = 0; er.encoded = 0;
(void *)list = sptr; list = (A_SEQUENCE_OF(void) *)sptr;
for(i = 0; i < list->count; i++) { for(i = 0; i < list->count; i++) {
asn_enc_rval_t tmper; asn_enc_rval_t tmper;
......
...@@ -225,7 +225,7 @@ SET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -225,7 +225,7 @@ SET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
} }
key.el_tag = tlv_tag; key.el_tag = tlv_tag;
(void *)t2m = bsearch(&key, t2m = (asn_TYPE_tag2member_t *)bsearch(&key,
specs->tag2el, specs->tag2el_count, specs->tag2el, specs->tag2el_count,
sizeof(specs->tag2el[0]), _t2e_cmp); sizeof(specs->tag2el[0]), _t2e_cmp);
if(t2m) { if(t2m) {
...@@ -436,7 +436,8 @@ SET_encode_der(asn_TYPE_descriptor_t *td, ...@@ -436,7 +436,8 @@ SET_encode_der(asn_TYPE_descriptor_t *td,
* Use existing, or build our own tags map. * Use existing, or build our own tags map.
*/ */
if(t2m_build_own) { if(t2m_build_own) {
(void *)t2m = alloca(td->elements_count * sizeof(t2m[0])); t2m = (asn_TYPE_tag2member_t *)alloca(
td->elements_count * sizeof(t2m[0]));
if(!t2m) _ASN_ENCODE_FAILED; /* There are such platforms */ if(!t2m) _ASN_ENCODE_FAILED; /* There are such platforms */
t2m_count = 0; t2m_count = 0;
} else { } else {
......
...@@ -214,7 +214,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -214,7 +214,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
case RC_OK: case RC_OK:
{ {
A_SET_OF(void) *list; A_SET_OF(void) *list;
(void *)list = st; list = (A_SET_OF(void) *)st;
if(ASN_SET_ADD(list, ctx->ptr) != 0) if(ASN_SET_ADD(list, ctx->ptr) != 0)
RETURN(RC_FAIL); RETURN(RC_FAIL);
else else
...@@ -329,7 +329,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, ...@@ -329,7 +329,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
/* /*
* Gather the length of the underlying members sequence. * Gather the length of the underlying members sequence.
*/ */
(void *)list = ptr; list = (A_SET_OF(void) *)ptr;
for(edx = 0; edx < list->count; edx++) { for(edx = 0; edx < list->count; edx++) {
void *memb_ptr = list->array[edx]; void *memb_ptr = list->array[edx];
erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, 0, 0); erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, 0, 0);
...@@ -507,7 +507,7 @@ SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, ...@@ -507,7 +507,7 @@ SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
if(!sptr) _ASN_ENCODE_FAILED; if(!sptr) _ASN_ENCODE_FAILED;
(void *)list = sptr; list = (A_SET_OF(void) *)sptr;
if(xcan) { if(xcan) {
encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0])); encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0]));
...@@ -601,7 +601,7 @@ SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, ...@@ -601,7 +601,7 @@ SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|| cb(" ::= {", 6, app_key) < 0) || cb(" ::= {", 6, app_key) < 0)
return -1; return -1;
(const void *)list = sptr; list = (const A_SET_OF(void) *)sptr;
for(i = 0; i < list->count; i++) { for(i = 0; i < list->count; i++) {
const void *memb_ptr = list->array[i]; const void *memb_ptr = list->array[i];
if(!memb_ptr) continue; if(!memb_ptr) continue;
...@@ -630,7 +630,7 @@ SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { ...@@ -630,7 +630,7 @@ SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
* Could not use set_of_empty() because of (*free) * Could not use set_of_empty() because of (*free)
* incompatibility. * incompatibility.
*/ */
(void *)list = ptr; list = (A_SET_OF(void) *)ptr;
for(i = 0; i < list->count; i++) { for(i = 0; i < list->count; i++) {
void *memb_ptr = list->array[i]; void *memb_ptr = list->array[i];
if(memb_ptr) if(memb_ptr)
...@@ -661,7 +661,7 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, ...@@ -661,7 +661,7 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
return -1; return -1;
} }
(const void *)list = sptr; list = (const A_SET_OF(void) *)sptr;
constr = element->memb_constraints; constr = element->memb_constraints;
if(!constr) constr = element->type->check_constraints; if(!constr) constr = element->type->check_constraints;
......
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