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
Snippets
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
qwebaby3
asn1c
Commits
152a91e4
Commit
152a91e4
authored
20 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
modified Member name to guarantee it won't clash with user-defined "identifier"
parent
e5270564
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libasn1compiler/asn1c_C.c
+12
-5
12 additions, 5 deletions
libasn1compiler/asn1c_C.c
tests/31-set-of-OK.asn1.-P
+18
-18
18 additions, 18 deletions
tests/31-set-of-OK.asn1.-P
tests/66-ref-simple-OK.asn1.-P
+1
-1
1 addition, 1 deletion
tests/66-ref-simple-OK.asn1.-P
with
31 additions
and
24 deletions
libasn1compiler/asn1c_C.c
+
12
−
5
View file @
152a91e4
...
...
@@ -482,7 +482,7 @@ asn1c_lang_C_type_SEx_OF(arg_t *arg) {
if
(
tmp_memb
.
Identifier
==
0
)
{
tmp_memb
.
Identifier
=
strdup
(
asn1c_make_identifier
(
0
,
expr
->
Identifier
,
"
m
ember"
,
0
));
expr
->
Identifier
,
"
M
ember"
,
0
));
assert
(
tmp_memb
.
Identifier
);
}
tmp
.
default_cb
(
&
tmp
);
...
...
@@ -538,7 +538,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
INDENT
(
+
1
);
v
=
TQ_FIRST
(
&
(
expr
->
members
));
if
(
!
v
->
Identifier
)
{
v
->
Identifier
=
strdup
(
"
m
ember"
);
v
->
Identifier
=
strdup
(
"
M
ember"
);
assert
(
v
->
Identifier
);
}
v
->
_anonymous_type
=
1
;
...
...
@@ -1447,7 +1447,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
}
else
{
char
*
id
=
MKID_nr
(
expr
->
Identifier
);
if
(
expr
->
_anonymous_type
&&
!
strcmp
(
expr
->
Identifier
,
"
m
ember"
))
&&
!
strcmp
(
expr
->
Identifier
,
"
M
ember"
))
id
=
asn1c_type_name
(
arg
,
expr
,
TNF_SAFE
);
OUT
(
"memb_%s_%d_constraint,
\n
"
,
id
,
++
global_memb_unique
);
...
...
@@ -1456,7 +1456,14 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
OUT
(
"0,
\t
/* Defer constraints checking to the member type */
\n
"
);
}
if
(
C99_MODE
)
OUT
(
".name = "
);
OUT
(
"
\"
%s
\"\n
"
,
expr
->
_anonymous_type
?
""
:
expr
->
Identifier
);
if
(
1
)
{
if
(
expr
->
_anonymous_type
&&
!
strcmp
(
expr
->
Identifier
,
"Member"
))
OUT
(
"
\"\"\n
"
);
else
OUT
(
"
\"
%s
\"\n
"
,
expr
->
Identifier
);
}
else
{
OUT
(
"
\"
%s
\"\n
"
,
expr
->
_anonymous_type
?
""
:
expr
->
Identifier
);
}
OUT
(
"},
\n
"
);
INDENT
(
-
1
);
...
...
@@ -1466,7 +1473,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
save_target
=
arg
->
target
->
target
;
REDIR
(
OT_CODE
);
if
(
expr
->
_anonymous_type
&&
!
strcmp
(
expr
->
Identifier
,
"
m
ember"
))
if
(
expr
->
_anonymous_type
&&
!
strcmp
(
expr
->
Identifier
,
"
M
ember"
))
p
=
asn1c_type_name
(
arg
,
expr
,
TNF_SAFE
);
else
p
=
MKID_nr
(
expr
->
Identifier
);
...
...
This diff is collapsed.
Click to expand it.
tests/31-set-of-OK.asn1.-P
+
18
−
18
View file @
152a91e4
...
...
@@ -177,7 +177,7 @@ typedef struct Stuff {
asn_struct_ctx_t _asn_ctx;
} *trees;
struct anything {
A_SET_OF(struct anything_
m
ember {
A_SET_OF(struct anything_
M
ember {
BIT_STRING_t cup_of_coffee;
/*
* This type is extensible,
...
...
@@ -257,8 +257,8 @@ asn_TYPE_descriptor_t asn_DEF_trees = {
&asn_DEF_trees_specs /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_anything_
m
ember[] = {
{ ATF_NOFLAGS, 0, offsetof(struct anything_
m
ember, cup_of_coffee),
static asn_TYPE_member_t asn_MBR_anything_
M
ember[] = {
{ ATF_NOFLAGS, 0, offsetof(struct anything_
M
ember, cup_of_coffee),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
.tag_mode = 0,
.type = (void *)&asn_DEF_BIT_STRING,
...
...
@@ -266,22 +266,22 @@ static asn_TYPE_member_t asn_MBR_anything_member[] = {
.name = "cup-of-coffee"
},
};
static ber_tlv_tag_t asn_DEF_anything_
m
ember_tags[] = {
static ber_tlv_tag_t asn_DEF_anything_
M
ember_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_DEF_anything_
m
ember_tag2el[] = {
static asn_TYPE_tag2member_t asn_DEF_anything_
M
ember_tag2el[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 }, /* cup-of-coffee at 32 */
};
static asn_SEQUENCE_specifics_t asn_DEF_anything_
m
ember_specs = {
sizeof(struct anything_
m
ember),
offsetof(struct anything_
m
ember, _asn_ctx),
asn_DEF_anything_
m
ember_tag2el,
static asn_SEQUENCE_specifics_t asn_DEF_anything_
M
ember_specs = {
sizeof(struct anything_
M
ember),
offsetof(struct anything_
M
ember, _asn_ctx),
asn_DEF_anything_
M
ember_tag2el,
1, /* Count of tags in the map */
0, /* Start extensions */
2 /* Stop extensions */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_anything_
m
ember = {
asn_TYPE_descriptor_t asn_DEF_anything_
M
ember = {
"",
"",
SEQUENCE_free,
...
...
@@ -292,15 +292,15 @@ asn_TYPE_descriptor_t asn_DEF_anything_member = {
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
0, /* Use generic outmost tag fetcher */
asn_DEF_anything_
m
ember_tags,
sizeof(asn_DEF_anything_
m
ember_tags)
/sizeof(asn_DEF_anything_
m
ember_tags[0]), /* 1 */
asn_DEF_anything_
m
ember_tags, /* Same as above */
sizeof(asn_DEF_anything_
m
ember_tags)
/sizeof(asn_DEF_anything_
m
ember_tags[0]), /* 1 */
asn_MBR_anything_
m
ember,
asn_DEF_anything_
M
ember_tags,
sizeof(asn_DEF_anything_
M
ember_tags)
/sizeof(asn_DEF_anything_
M
ember_tags[0]), /* 1 */
asn_DEF_anything_
M
ember_tags, /* Same as above */
sizeof(asn_DEF_anything_
M
ember_tags)
/sizeof(asn_DEF_anything_
M
ember_tags[0]), /* 1 */
asn_MBR_anything_
M
ember,
1, /* Elements count */
&asn_DEF_anything_
m
ember_specs /* Additional specs */
&asn_DEF_anything_
M
ember_specs /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_anything[] = {
...
...
This diff is collapsed.
Click to expand it.
tests/66-ref-simple-OK.asn1.-P
+
1
−
1
View file @
152a91e4
...
...
@@ -27,7 +27,7 @@ static asn_TYPE_member_t asn_MBR_T[] = {
.tag_mode = 0,
.type = (void *)&asn_DEF_SimpleType,
.memb_constraints = 0, /* Defer constraints checking to the member type */
.name = ""
.name = "
named
"
},
};
static ber_tlv_tag_t asn_DEF_T_tags[] = {
...
...
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