aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1compiler
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2005-11-08 03:06:16 +0000
committerLev Walkin <vlm@lionet.info>2005-11-08 03:06:16 +0000
commitd1bfea65a046b1b8e3ba8fe5eb7260416a1e086a (patch)
tree34eb1b922345a3f43418887adcfb1c1d9efca351 /libasn1compiler
parent5ab96cda95eaaa50473346d3aaa0c2b869e9e93a (diff)
SET OF/SEQUENCE OF interaction with named and unnamed CHOICE
Diffstat (limited to 'libasn1compiler')
-rw-r--r--libasn1compiler/asn1c_C.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c
index 9884bdfa..4df99188 100644
--- a/libasn1compiler/asn1c_C.c
+++ b/libasn1compiler/asn1c_C.c
@@ -734,11 +734,12 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
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_as_xmlvaluelist(arg_t *arg, asn1p_expr_t *expr) {
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;
}