Commit b8933edb authored by Lev Walkin's avatar Lev Walkin

C90 fix

parent 69353a32
...@@ -18,6 +18,10 @@ NativeInteger_decode_oer(asn_codec_ctx_t *opt_codec_ctx, ...@@ -18,6 +18,10 @@ NativeInteger_decode_oer(asn_codec_ctx_t *opt_codec_ctx,
asn_dec_rval_t rval = {RC_OK, 0}; asn_dec_rval_t rval = {RC_OK, 0};
long *native = (long *)*nint_ptr; long *native = (long *)*nint_ptr;
asn_oer_constraint_t *ct; asn_oer_constraint_t *ct;
INTEGER_t tmpint;
INTEGER_t *tmpintptr = &tmpint;
memset(&tmpint, 0, sizeof(tmpint));
(void)opt_codec_ctx; (void)opt_codec_ctx;
...@@ -29,10 +33,6 @@ NativeInteger_decode_oer(asn_codec_ctx_t *opt_codec_ctx, ...@@ -29,10 +33,6 @@ NativeInteger_decode_oer(asn_codec_ctx_t *opt_codec_ctx,
if(!constraints) constraints = td->oer_constraints; if(!constraints) constraints = td->oer_constraints;
ct = constraints ? &constraints->value : 0; ct = constraints ? &constraints->value : 0;
INTEGER_t tmpint;
INTEGER_t *tmpintptr = &tmpint;
memset(&tmpint, 0, sizeof(tmpint));
/* /*
* OPTIMIZATION: Encode directly rather than passing through INTEGER. * OPTIMIZATION: Encode directly rather than passing through INTEGER.
* Saves a memory allocation. * Saves a memory allocation.
...@@ -77,17 +77,16 @@ NativeInteger_encode_oer(asn_TYPE_descriptor_t *td, ...@@ -77,17 +77,16 @@ NativeInteger_encode_oer(asn_TYPE_descriptor_t *td,
asn_oer_constraints_t *constraints, void *sptr, asn_oer_constraints_t *constraints, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) { asn_app_consume_bytes_f *cb, void *app_key) {
asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics; asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
INTEGER_t tmpint;
long native; long native;
if(!sptr) ASN__ENCODE_FAILED; if(!sptr) ASN__ENCODE_FAILED;
native = *(const long *)sptr; native = *(const long *)sptr;
memset(&tmpint, 0, sizeof(tmpint));
ASN_DEBUG("Encoding %s %ld as NativeInteger", td ? td->name : "", native); ASN_DEBUG("Encoding %s %ld as NativeInteger", td ? td->name : "", native);
INTEGER_t tmpint;
memset(&tmpint, 0, sizeof(tmpint));
if((specs && specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native) if((specs && specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native)
: asn_long2INTEGER(&tmpint, native)) { : asn_long2INTEGER(&tmpint, native)) {
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
......
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