mirror of https://gerrit.osmocom.org/asn1c
no lvalue casting
This commit is contained in:
parent
6164294aeb
commit
c17d90fb50
|
@ -176,7 +176,8 @@ NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
|
|||
int *Int = (int *)*sptr;
|
||||
|
||||
if(!Int) {
|
||||
(void *)Int = *sptr = CALLOC(1, sizeof(int));
|
||||
*sptr = CALLOC(1, sizeof(int));
|
||||
Int = (int *)*sptr;
|
||||
if(!Int) {
|
||||
rval.code = RC_FAIL;
|
||||
rval.consumed = 0;
|
||||
|
|
|
@ -54,7 +54,8 @@ NativeReal_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
|||
* If the structure is not there, allocate it.
|
||||
*/
|
||||
if(Dbl == NULL) {
|
||||
(void *)Dbl = *dbl_ptr = CALLOC(1, sizeof(*Dbl));
|
||||
*dbl_ptr = CALLOC(1, sizeof(*Dbl));
|
||||
Dbl = (double *)*dbl_ptr;
|
||||
if(Dbl == NULL) {
|
||||
rval.code = RC_FAIL;
|
||||
rval.consumed = 0;
|
||||
|
@ -156,7 +157,8 @@ NativeReal_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
|
|||
double *Dbl = (double *)*sptr;
|
||||
|
||||
if(!Dbl) {
|
||||
(void *)Dbl = *sptr = CALLOC(1, sizeof(double));
|
||||
*sptr = CALLOC(1, sizeof(double));
|
||||
Dbl = (double *)*sptr;
|
||||
if(!Dbl) {
|
||||
rval.code = RC_FAIL;
|
||||
rval.consumed = 0;
|
||||
|
|
|
@ -653,7 +653,7 @@ OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length,
|
|||
} state = ST_SKIPSPACE;
|
||||
|
||||
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;
|
||||
return -1;
|
||||
}
|
||||
|
@ -705,7 +705,7 @@ OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length,
|
|||
} /* 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 */
|
||||
switch(state) {
|
||||
|
|
|
@ -640,7 +640,7 @@ asn_double2REAL(REAL_t *st, double dbl_value) {
|
|||
ptr += buflen;
|
||||
buflen = ptr - buf;
|
||||
|
||||
(void *)ptr = MALLOC(buflen + 1);
|
||||
ptr = (uint8_t *)MALLOC(buflen + 1);
|
||||
if(!ptr) return -1;
|
||||
|
||||
memcpy(ptr, buf, buflen);
|
||||
|
|
|
@ -186,7 +186,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
|||
asn_TYPE_tag2member_t key;
|
||||
|
||||
key.el_tag = tlv_tag;
|
||||
(void *)t2m = bsearch(&key,
|
||||
t2m = (asn_TYPE_tag2member_t *)bsearch(&key,
|
||||
specs->tag2el, specs->tag2el_count,
|
||||
sizeof(specs->tag2el[0]), _search4tag);
|
||||
if(t2m) {
|
||||
|
|
|
@ -313,7 +313,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
|||
asn_TYPE_tag2member_t key;
|
||||
key.el_tag = tlv_tag;
|
||||
key.el_no = edx;
|
||||
(void *)t2m = bsearch(&key,
|
||||
t2m = (asn_TYPE_tag2member_t *)bsearch(&key,
|
||||
specs->tag2el, specs->tag2el_count,
|
||||
sizeof(specs->tag2el[0]), _t2e_cmp);
|
||||
if(t2m) {
|
||||
|
|
|
@ -25,7 +25,7 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
|
|||
/*
|
||||
* Gather the length of the underlying members sequence.
|
||||
*/
|
||||
(void *)list = ptr;
|
||||
list = (A_SEQUENCE_OF(void) *)ptr;
|
||||
for(edx = 0; edx < list->count; edx++) {
|
||||
void *memb_ptr = list->array[edx];
|
||||
erval = elm->type->der_encoder(elm->type, memb_ptr,
|
||||
|
@ -102,7 +102,7 @@ SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
|
|||
|
||||
er.encoded = 0;
|
||||
|
||||
(void *)list = sptr;
|
||||
list = (A_SEQUENCE_OF(void) *)sptr;
|
||||
for(i = 0; i < list->count; i++) {
|
||||
asn_enc_rval_t tmper;
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ SET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
|||
}
|
||||
|
||||
key.el_tag = tlv_tag;
|
||||
(void *)t2m = bsearch(&key,
|
||||
t2m = (asn_TYPE_tag2member_t *)bsearch(&key,
|
||||
specs->tag2el, specs->tag2el_count,
|
||||
sizeof(specs->tag2el[0]), _t2e_cmp);
|
||||
if(t2m) {
|
||||
|
@ -436,7 +436,8 @@ SET_encode_der(asn_TYPE_descriptor_t *td,
|
|||
* Use existing, or build our own tags map.
|
||||
*/
|
||||
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 */
|
||||
t2m_count = 0;
|
||||
} else {
|
||||
|
|
|
@ -214,7 +214,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
|||
case RC_OK:
|
||||
{
|
||||
A_SET_OF(void) *list;
|
||||
(void *)list = st;
|
||||
list = (A_SET_OF(void) *)st;
|
||||
if(ASN_SET_ADD(list, ctx->ptr) != 0)
|
||||
RETURN(RC_FAIL);
|
||||
else
|
||||
|
@ -329,7 +329,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
|
|||
/*
|
||||
* Gather the length of the underlying members sequence.
|
||||
*/
|
||||
(void *)list = ptr;
|
||||
list = (A_SET_OF(void) *)ptr;
|
||||
for(edx = 0; edx < list->count; edx++) {
|
||||
void *memb_ptr = list->array[edx];
|
||||
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,
|
|||
|
||||
if(!sptr) _ASN_ENCODE_FAILED;
|
||||
|
||||
(void *)list = sptr;
|
||||
list = (A_SET_OF(void) *)sptr;
|
||||
|
||||
if(xcan) {
|
||||
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,
|
|||
|| cb(" ::= {", 6, app_key) < 0)
|
||||
return -1;
|
||||
|
||||
(const void *)list = sptr;
|
||||
list = (const A_SET_OF(void) *)sptr;
|
||||
for(i = 0; i < list->count; i++) {
|
||||
const void *memb_ptr = list->array[i];
|
||||
if(!memb_ptr) continue;
|
||||
|
@ -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)
|
||||
* incompatibility.
|
||||
*/
|
||||
(void *)list = ptr;
|
||||
list = (A_SET_OF(void) *)ptr;
|
||||
for(i = 0; i < list->count; i++) {
|
||||
void *memb_ptr = list->array[i];
|
||||
if(memb_ptr)
|
||||
|
@ -661,7 +661,7 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
|||
return -1;
|
||||
}
|
||||
|
||||
(const void *)list = sptr;
|
||||
list = (const A_SET_OF(void) *)sptr;
|
||||
|
||||
constr = element->memb_constraints;
|
||||
if(!constr) constr = element->type->check_constraints;
|
||||
|
|
Loading…
Reference in New Issue