Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asn1c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oai
asn1c
Commits
f3b29b1f
Commit
f3b29b1f
authored
19 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
no empty maps
parent
b9d0ae34
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libasn1compiler/asn1c_C.c
+25
-19
25 additions, 19 deletions
libasn1compiler/asn1c_C.c
with
25 additions
and
19 deletions
libasn1compiler/asn1c_C.c
+
25
−
19
View file @
f3b29b1f
...
@@ -315,9 +315,15 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
...
@@ -315,9 +315,15 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
OUT
(
"sizeof(struct "
);
out_name_chain
(
arg
,
1
);
OUT
(
"),
\n
"
);
OUT
(
"sizeof(struct "
);
out_name_chain
(
arg
,
1
);
OUT
(
"),
\n
"
);
OUT
(
"offsetof(struct "
);
out_name_chain
(
arg
,
1
);
OUT
(
", _asn_ctx),
\n
"
);
OUT
(
"offsetof(struct "
);
out_name_chain
(
arg
,
1
);
OUT
(
", _asn_ctx),
\n
"
);
OUT
(
"asn_MAP_%s_%d_tag2el,
\n
"
,
if
(
tag2el_count
)
{
MKID
(
expr
->
Identifier
),
expr
->
_type_unique_index
);
OUT
(
"asn_MAP_%s_%d_tag2el,
\n
"
,
OUT
(
"%d,
\t
/* Count of tags in the map */
\n
"
,
tag2el_count
);
MKID
(
expr
->
Identifier
),
expr
->
_type_unique_index
);
OUT
(
"%d,
\t
/* Count of tags in the map */
\n
"
,
tag2el_count
);
}
else
{
OUT
(
"0,
\t
/* No top level tags */
\n
"
);
OUT
(
"0,
\t
/* No tags in the map */
\n
"
);
}
OUT
(
"%d,
\t
/* Start extensions */
\n
"
,
OUT
(
"%d,
\t
/* Start extensions */
\n
"
,
ext_start
);
ext_start
);
OUT
(
"%d
\t
/* Stop extensions */
\n
"
,
OUT
(
"%d
\t
/* Stop extensions */
\n
"
,
...
@@ -1425,29 +1431,29 @@ _add_tag2el_member(arg_t *arg, tag2el_t **tag2el, int *count, int el_no, fte_e f
...
@@ -1425,29 +1431,29 @@ _add_tag2el_member(arg_t *arg, tag2el_t **tag2el, int *count, int el_no, fte_e f
static
int
static
int
emit_tag2member_map
(
arg_t
*
arg
,
tag2el_t
*
tag2el
,
int
tag2el_count
,
const
char
*
opt_modifier
)
{
emit_tag2member_map
(
arg_t
*
arg
,
tag2el_t
*
tag2el
,
int
tag2el_count
,
const
char
*
opt_modifier
)
{
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
expr
=
arg
->
expr
;
int
i
;
if
(
!
tag2el_count
)
return
0
;
/* No top level tags */
OUT
(
"static asn_TYPE_tag2member_t asn_MAP_%s_%d_tag2el%s[] = {
\n
"
,
OUT
(
"static asn_TYPE_tag2member_t asn_MAP_%s_%d_tag2el%s[] = {
\n
"
,
MKID
(
expr
->
Identifier
),
expr
->
_type_unique_index
,
MKID
(
expr
->
Identifier
),
expr
->
_type_unique_index
,
opt_modifier
?
opt_modifier
:
""
);
opt_modifier
?
opt_modifier
:
""
);
if
(
tag2el_count
)
{
for
(
i
=
0
;
i
<
tag2el_count
;
i
++
)
{
int
i
;
OUT
(
" { "
);
for
(
i
=
0
;
i
<
tag2el_count
;
i
++
)
{
_print_tag
(
arg
,
&
tag2el
[
i
].
el_tag
);
OUT
(
" { "
);
OUT
(
", "
);
_print_tag
(
arg
,
&
tag2el
[
i
].
el_tag
);
OUT
(
"%d, "
,
tag2el
[
i
].
el_no
);
OUT
(
", "
);
OUT
(
"%d, "
,
tag2el
[
i
].
toff_first
);
OUT
(
"%d, "
,
tag2el
[
i
].
el_no
);
OUT
(
"%d "
,
tag2el
[
i
].
toff_last
);
OUT
(
"%d, "
,
tag2el
[
i
].
toff_first
);
OUT
(
"}%s /* %s at %d */
\n
"
,
OUT
(
"%d "
,
tag2el
[
i
].
toff_last
);
(
i
+
1
<
tag2el_count
)
?
","
:
""
,
OUT
(
"}%s /* %s at %d */
\n
"
,
tag2el
[
i
].
from_expr
->
Identifier
,
(
i
+
1
<
tag2el_count
)
?
","
:
""
,
tag2el
[
i
].
from_expr
->
_lineno
tag2el
[
i
].
from_expr
->
Identifier
,
);
tag2el
[
i
].
from_expr
->
_lineno
);
}
}
}
OUT
(
"};
\n
"
);
OUT
(
"};
\n
"
);
return
0
;
;
return
0
;
}
}
static
enum
tvm_compat
static
enum
tvm_compat
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment