From 9bfb2d1dabbaf70bac77183d0bc4b49b039e51b1 Mon Sep 17 00:00:00 2001 From: vlm Date: Mon, 23 Jul 2007 07:47:04 +0000 Subject: extensibility encoding git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1383 59561ff5-6e30-0410-9f3c-9617f08c8826 --- skeletons/NativeEnumerated.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/skeletons/NativeEnumerated.c b/skeletons/NativeEnumerated.c index e3af1ca4..12b079e1 100644 --- a/skeletons/NativeEnumerated.c +++ b/skeletons/NativeEnumerated.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004 Lev Walkin . All rights reserved. + * Copyright (c) 2004, 2007 Lev Walkin . 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); -- cgit v1.2.3