SET OF/SEQUENCE OF interaction with named and unnamed CHOICE
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@993 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c
index 9884bdf..4df9918 100644
--- a/libasn1compiler/asn1c_C.c
+++ b/libasn1compiler/asn1c_C.c
@@ -734,11 +734,12 @@
OUT("offsetof(struct ");
out_name_chain(arg, ONC_avoid_keywords);
OUT(", _asn_ctx),\n");
-
- if(expr_as_xmlvaluelist(arg, v))
- OUT("1,\t/* XER encoding is XMLValueList */\n");
- else
- OUT("0,\t/* XER encoding is XMLDelimitedItemList */\n");
+ {
+ int as_xvl = expr_as_xmlvaluelist(arg, v);
+ OUT("%d,\t/* XER encoding is %s */\n",
+ as_xvl,
+ as_xvl ? "XMLValueList" : "XMLDelimitedItemList");
+ }
);
OUT("};\n");
@@ -1866,12 +1867,16 @@
expr = asn1f_find_terminal_type_ex(arg->asn, expr);
if(!expr) return 0;
- /* X.680, 25.5, Table 5 */
+ /*
+ * X.680, 25.5, Table 5
+ */
switch(expr->expr_type) {
case ASN_BASIC_BOOLEAN:
case ASN_BASIC_ENUMERATED:
case ASN_BASIC_NULL:
return 1;
+ case ASN_CONSTR_CHOICE:
+ return 2;
default:
return 0;
}