aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1compiler/asn1c_C.c
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2005-08-14 02:18:27 +0000
committerLev Walkin <vlm@lionet.info>2005-08-14 02:18:27 +0000
commit082cadcaaa610df424a1327656abb3055c9f6873 (patch)
tree7a875ab66bf5a6ceb92831e06fccd81abe3b656f /libasn1compiler/asn1c_C.c
parentb02a8835951516edda86f73b1bcffc4904e0f639 (diff)
PER visible constraints are used to select the native representation for INTEGER types
Diffstat (limited to 'libasn1compiler/asn1c_C.c')
-rw-r--r--libasn1compiler/asn1c_C.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c
index f91da76f..d39018ee 100644
--- a/libasn1compiler/asn1c_C.c
+++ b/libasn1compiler/asn1c_C.c
@@ -218,29 +218,26 @@ asn1c_lang_C_type_BIT_STRING(arg_t *arg) {
asn1p_expr_t *expr = arg->expr;
asn1p_expr_t *v;
int el_count = expr_elements_count(arg, expr);
- int eidx = 0;
if(el_count) {
+ int eidx = 0;
REDIR(OT_DEPS);
OUT("typedef enum ");
out_name_chain(arg, 1);
OUT(" {\n");
TQ_FOR(v, &(expr->members), next) {
- switch(v->expr_type) {
- case A1TC_UNIVERVAL:
- OUT("\t");
- out_name_chain(arg, 0);
- OUT("_%s", MKID(v->Identifier));
- OUT("\t= %" PRIdASN "%s\n",
- v->value->value.v_integer,
- (eidx+1 < el_count) ? "," : "");
- eidx++;
- break;
- default:
+ eidx++;
+ if(v->expr_type != A1TC_UNIVERVAL) {
OUT("/* Unexpected BIT STRING element: %s */\n",
v->Identifier);
- break;
+ continue;
}
+ OUT("\t");
+ out_name_chain(arg, 0);
+ OUT("_%s", MKID(v->Identifier));
+ OUT("\t= %" PRIdASN "%s\n",
+ v->value->value.v_integer,
+ (eidx < el_count) ? "," : "");
}
OUT("} ");
out_name_chain(arg, 0);