extensibility encoding

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1383 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2007-07-23 07:47:04 +00:00
parent 7f05da5a35
commit 9bfb2d1dab
1 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Copyright (c) 2004, 2007 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
/*
@ -177,7 +177,7 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td,
inext = 1;
}
if(ct->flags & APC_EXTENSIBLE) {
if(per_put_few_bits(po, inext, 0))
if(per_put_few_bits(po, inext, 1))
_ASN_ENCODE_FAILED;
ct = 0;
} else if(inext) {
@ -196,7 +196,10 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td,
/*
* X.691, #10.6: normally small non-negative whole number;
*/
if(uper_put_nsnnwn(po, value - (specs->extension - 1)))
ASN_DEBUG("value = %d, ext = %d, inext = %d, res = %d",
value, specs->extension, inext,
value - (inext ? (specs->extension - 1) : 0));
if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
_ASN_ENCODE_FAILED;
_ASN_ENCODED_OK(er);