avoid new gcc warnings for assigning the lvalue

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@582 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2004-12-14 13:31:01 +00:00
parent bde35d45b9
commit 82e317b649
2 changed files with 5 additions and 3 deletions

View File

@ -1113,9 +1113,10 @@ OCTET_STRING__decode_xer(asn_codec_ctx_t *opt_codec_ctx,
*/
if(!*sptr) {
OCTET_STRING_t *st;
(void *)st = *sptr = CALLOC(1, specs->struct_size);
st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size);
if(st) st->buf = (uint8_t *)CALLOC(1, 1);
if(!*sptr || !st->buf) {
*sptr = (void *)st;
if(!st || !st->buf) {
asn_dec_rval_t rval;
if(*sptr) FREEMEM(*sptr);
rval.code = RC_FAIL;

View File

@ -22,12 +22,13 @@ ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
* If the structure is not there, allocate it.
*/
if(st == NULL) {
(void *)st = *sptr = CALLOC(1, sizeof(*st));
st = (ASN__PRIMITIVE_TYPE_t *)CALLOC(1, sizeof(*st));
if(st == NULL) {
rval.code = RC_FAIL;
rval.consumed = 0;
return rval;
}
*sptr = (void *)st;
}
ASN_DEBUG("Decoding %s as plain primitive (tm=%d)",