aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1compiler
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2006-10-09 12:52:15 +0000
committerLev Walkin <vlm@lionet.info>2006-10-09 12:52:15 +0000
commit07aaa34e7ddec86a6aa573adc40eb6788cc01f07 (patch)
tree043b2cc514c6178dcd04ec4da585417c11b3ee26 /libasn1compiler
parente73dc67115cd8360b426e251b79c19552469aec2 (diff)
choice constraint generation duplication dropped
Diffstat (limited to 'libasn1compiler')
-rw-r--r--libasn1compiler/asn1c_C.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c
index 48ad42c3..9d3cff57 100644
--- a/libasn1compiler/asn1c_C.c
+++ b/libasn1compiler/asn1c_C.c
@@ -1893,10 +1893,12 @@ emit_member_PER_constraints(arg_t *arg, asn1p_expr_t *expr, const char *pfx) {
asn1cnst_range_t *range;
asn1p_expr_type_e etype;
+ etype = expr_get_type(arg, expr);
+
if((arg->flags & A1C_GEN_PER)
&& (expr->constraints
- || expr->expr_type == ASN_BASIC_ENUMERATED
- || expr->expr_type == ASN_CONSTR_CHOICE)
+ || etype == ASN_BASIC_ENUMERATED
+ || etype == ASN_CONSTR_CHOICE)
) {
/* Fall through */
} else {
@@ -1909,8 +1911,6 @@ emit_member_PER_constraints(arg_t *arg, asn1p_expr_t *expr, const char *pfx) {
"asn_PER_%s_%s_constr_%d = {\n",
pfx, MKID(expr), expr->_type_unique_index);
- etype = expr_get_type(arg, expr);
-
INDENT(+1);
/*
@@ -2193,9 +2193,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
}
if(C99_MODE) OUT(".per_constraints = ");
if(arg->flags & A1C_GEN_PER) {
- if(expr->constraints
- || expr->expr_type == ASN_BASIC_ENUMERATED
- || expr->expr_type == ASN_CONSTR_CHOICE) {
+ if(expr->constraints) {
OUT("&asn_PER_memb_%s_constr_%d,\n",
MKID(expr),
expr->_type_unique_index);