aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1compiler/asn1c_C.c
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-09-10 09:37:12 +0000
committerLev Walkin <vlm@lionet.info>2004-09-10 09:37:12 +0000
commitb918973b7100311763a7e2d554fd5bbfdb0121b0 (patch)
treef86d1387e53a5c55055baa1f5e2ce3f4f62353ce /libasn1compiler/asn1c_C.c
parentcc93b0f1c5fc5530ab9bdd4e747cd4da939b8a6a (diff)
more explicit ANY support
Diffstat (limited to 'libasn1compiler/asn1c_C.c')
-rw-r--r--libasn1compiler/asn1c_C.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c
index 8755c2a2..00b278b9 100644
--- a/libasn1compiler/asn1c_C.c
+++ b/libasn1compiler/asn1c_C.c
@@ -1200,10 +1200,21 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
static int global_memb_unique;
int save_target;
arg_t tmp_arg;
- struct asn1p_type_tag_s outmost_tag;
+ struct asn1p_type_tag_s outmost_tag_s;
+ struct asn1p_type_tag_s *outmost_tag;
char *p;
+ if(asn1f_fetch_outmost_tag(arg->asn,
+ expr->module, expr, &outmost_tag_s, 1)) {
+ outmost_tag = 0;
+ } else {
+ outmost_tag = &outmost_tag_s;
+ }
+
OUT("{ ");
+
+ if(outmost_tag && outmost_tag->tag_value == -1)
+ OUT("ATF_OPEN_TYPE | ");
OUT("%s, ", expr->marker?"ATF_POINTER":"ATF_NOFLAGS");
if((expr->marker & EM_OPTIONAL) == EM_OPTIONAL) {
asn1p_expr_t *tv;
@@ -1229,12 +1240,15 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
}
INDENT(+1);
if(C99_MODE) OUT(".tag = ");
- if(asn1f_fetch_outmost_tag(arg->asn,
- expr->module, expr, &outmost_tag, 0)) {
- OUT("-1 /* Ambiguous tag (CHOICE|ANY?) */");
+ if(outmost_tag) {
+ if(outmost_tag->tag_value == -1)
+ OUT("-1 /* Ambiguous tag (ANY?) */");
+ else
+ _print_tag(arg, outmost_tag);
} else {
- _print_tag(arg, &outmost_tag);
+ OUT("-1 /* Ambiguous tag (CHOICE?) */");
}
+
OUT(",\n");
if(C99_MODE) OUT(".tag_mode = ");
if(expr->tag.tag_class) {