no lvalue casting


git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@601 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/skeletons/NativeInteger.c b/skeletons/NativeInteger.c
index dd5c3e1..c6785c5 100644
--- a/skeletons/NativeInteger.c
+++ b/skeletons/NativeInteger.c
@@ -176,7 +176,8 @@
 	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;
diff --git a/skeletons/NativeReal.c b/skeletons/NativeReal.c
index ae33d64..594bdb5 100644
--- a/skeletons/NativeReal.c
+++ b/skeletons/NativeReal.c
@@ -54,7 +54,8 @@
 	 * 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 @@
 	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;
diff --git a/skeletons/OBJECT_IDENTIFIER.c b/skeletons/OBJECT_IDENTIFIER.c
index 535e4e2..3f2454c 100644
--- a/skeletons/OBJECT_IDENTIFIER.c
+++ b/skeletons/OBJECT_IDENTIFIER.c
@@ -653,7 +653,7 @@
 	} 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 @@
 	} /* 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) {
diff --git a/skeletons/REAL.c b/skeletons/REAL.c
index 9380c9d..bf03db3 100644
--- a/skeletons/REAL.c
+++ b/skeletons/REAL.c
@@ -640,7 +640,7 @@
 	ptr += buflen;
 	buflen = ptr - buf;
 
-	(void *)ptr = MALLOC(buflen + 1);
+	ptr = (uint8_t *)MALLOC(buflen + 1);
 	if(!ptr) return -1;
 
 	memcpy(ptr, buf, buflen);
diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c
index fac93a5..40e99e5 100644
--- a/skeletons/constr_CHOICE.c
+++ b/skeletons/constr_CHOICE.c
@@ -186,7 +186,7 @@
 			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) {
diff --git a/skeletons/constr_SEQUENCE.c b/skeletons/constr_SEQUENCE.c
index 1624abb..bac4244 100644
--- a/skeletons/constr_SEQUENCE.c
+++ b/skeletons/constr_SEQUENCE.c
@@ -313,7 +313,7 @@
 			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) {
diff --git a/skeletons/constr_SEQUENCE_OF.c b/skeletons/constr_SEQUENCE_OF.c
index f126d78..773fdd0 100644
--- a/skeletons/constr_SEQUENCE_OF.c
+++ b/skeletons/constr_SEQUENCE_OF.c
@@ -25,7 +25,7 @@
 	/*
 	 * 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 @@
 
 	er.encoded = 0;
 
-	(void *)list = sptr;
+	list = (A_SEQUENCE_OF(void) *)sptr;
 	for(i = 0; i < list->count; i++) {
 		asn_enc_rval_t tmper;
 
diff --git a/skeletons/constr_SET.c b/skeletons/constr_SET.c
index fa86f41..15a118f 100644
--- a/skeletons/constr_SET.c
+++ b/skeletons/constr_SET.c
@@ -225,7 +225,7 @@
 		}
 
 		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 @@
 	 * 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 {
diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c
index 164668c..febabe1 100644
--- a/skeletons/constr_SET_OF.c
+++ b/skeletons/constr_SET_OF.c
@@ -214,7 +214,7 @@
 		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 @@
 	/*
 	 * 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 @@
 
 	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 @@
 	|| 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 @@
 		 * 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 @@
 		return -1;
 	}
 
-	(const void *)list = sptr;
+	list = (const A_SET_OF(void) *)sptr;
 
 	constr = element->memb_constraints;
 	if(!constr) constr = element->type->check_constraints;