Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
152a91e4
Commit
152a91e4
authored
Feb 14, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified Member name to guarantee it won't clash with user-defined "identifier"
parent
e5270564
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
24 deletions
+31
-24
libasn1compiler/asn1c_C.c
libasn1compiler/asn1c_C.c
+12
-5
tests/31-set-of-OK.asn1.-P
tests/31-set-of-OK.asn1.-P
+18
-18
tests/66-ref-simple-OK.asn1.-P
tests/66-ref-simple-OK.asn1.-P
+1
-1
No files found.
libasn1compiler/asn1c_C.c
View file @
152a91e4
...
@@ -482,7 +482,7 @@ asn1c_lang_C_type_SEx_OF(arg_t *arg) {
...
@@ -482,7 +482,7 @@ asn1c_lang_C_type_SEx_OF(arg_t *arg) {
if
(
tmp_memb
.
Identifier
==
0
)
{
if
(
tmp_memb
.
Identifier
==
0
)
{
tmp_memb
.
Identifier
=
strdup
(
tmp_memb
.
Identifier
=
strdup
(
asn1c_make_identifier
(
0
,
asn1c_make_identifier
(
0
,
expr
->
Identifier
,
"
m
ember"
,
0
));
expr
->
Identifier
,
"
M
ember"
,
0
));
assert
(
tmp_memb
.
Identifier
);
assert
(
tmp_memb
.
Identifier
);
}
}
tmp
.
default_cb
(
&
tmp
);
tmp
.
default_cb
(
&
tmp
);
...
@@ -538,7 +538,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
...
@@ -538,7 +538,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
INDENT
(
+
1
);
INDENT
(
+
1
);
v
=
TQ_FIRST
(
&
(
expr
->
members
));
v
=
TQ_FIRST
(
&
(
expr
->
members
));
if
(
!
v
->
Identifier
)
{
if
(
!
v
->
Identifier
)
{
v
->
Identifier
=
strdup
(
"
m
ember"
);
v
->
Identifier
=
strdup
(
"
M
ember"
);
assert
(
v
->
Identifier
);
assert
(
v
->
Identifier
);
}
}
v
->
_anonymous_type
=
1
;
v
->
_anonymous_type
=
1
;
...
@@ -1447,7 +1447,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
...
@@ -1447,7 +1447,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
}
else
{
}
else
{
char
*
id
=
MKID_nr
(
expr
->
Identifier
);
char
*
id
=
MKID_nr
(
expr
->
Identifier
);
if
(
expr
->
_anonymous_type
if
(
expr
->
_anonymous_type
&&
!
strcmp
(
expr
->
Identifier
,
"
m
ember"
))
&&
!
strcmp
(
expr
->
Identifier
,
"
M
ember"
))
id
=
asn1c_type_name
(
arg
,
expr
,
TNF_SAFE
);
id
=
asn1c_type_name
(
arg
,
expr
,
TNF_SAFE
);
OUT
(
"memb_%s_%d_constraint,
\n
"
,
id
,
OUT
(
"memb_%s_%d_constraint,
\n
"
,
id
,
++
global_memb_unique
);
++
global_memb_unique
);
...
@@ -1456,7 +1456,14 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
...
@@ -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
"
);
OUT
(
"0,
\t
/* Defer constraints checking to the member type */
\n
"
);
}
}
if
(
C99_MODE
)
OUT
(
".name = "
);
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
"
);
OUT
(
"},
\n
"
);
INDENT
(
-
1
);
INDENT
(
-
1
);
...
@@ -1466,7 +1473,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
...
@@ -1466,7 +1473,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
save_target
=
arg
->
target
->
target
;
save_target
=
arg
->
target
->
target
;
REDIR
(
OT_CODE
);
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
);
p
=
asn1c_type_name
(
arg
,
expr
,
TNF_SAFE
);
else
else
p
=
MKID_nr
(
expr
->
Identifier
);
p
=
MKID_nr
(
expr
->
Identifier
);
...
...
tests/31-set-of-OK.asn1.-P
View file @
152a91e4
...
@@ -177,7 +177,7 @@ typedef struct Stuff {
...
@@ -177,7 +177,7 @@ typedef struct Stuff {
asn_struct_ctx_t _asn_ctx;
asn_struct_ctx_t _asn_ctx;
} *trees;
} *trees;
struct anything {
struct anything {
A_SET_OF(struct anything_
m
ember {
A_SET_OF(struct anything_
M
ember {
BIT_STRING_t cup_of_coffee;
BIT_STRING_t cup_of_coffee;
/*
/*
* This type is extensible,
* This type is extensible,
...
@@ -257,8 +257,8 @@ asn_TYPE_descriptor_t asn_DEF_trees = {
...
@@ -257,8 +257,8 @@ asn_TYPE_descriptor_t asn_DEF_trees = {
&asn_DEF_trees_specs /* Additional specs */
&asn_DEF_trees_specs /* Additional specs */
};
};
static asn_TYPE_member_t asn_MBR_anything_
m
ember[] = {
static asn_TYPE_member_t asn_MBR_anything_
M
ember[] = {
{ ATF_NOFLAGS, 0, offsetof(struct anything_
m
ember, cup_of_coffee),
{ ATF_NOFLAGS, 0, offsetof(struct anything_
M
ember, cup_of_coffee),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
.tag_mode = 0,
.tag_mode = 0,
.type = (void *)&asn_DEF_BIT_STRING,
.type = (void *)&asn_DEF_BIT_STRING,
...
@@ -266,22 +266,22 @@ static asn_TYPE_member_t asn_MBR_anything_member[] = {
...
@@ -266,22 +266,22 @@ static asn_TYPE_member_t asn_MBR_anything_member[] = {
.name = "cup-of-coffee"
.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))
(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 */
{ (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 = {
static asn_SEQUENCE_specifics_t asn_DEF_anything_
M
ember_specs = {
sizeof(struct anything_
m
ember),
sizeof(struct anything_
M
ember),
offsetof(struct anything_
m
ember, _asn_ctx),
offsetof(struct anything_
M
ember, _asn_ctx),
asn_DEF_anything_
m
ember_tag2el,
asn_DEF_anything_
M
ember_tag2el,
1, /* Count of tags in the map */
1, /* Count of tags in the map */
0, /* Start extensions */
0, /* Start extensions */
2 /* Stop extensions */
2 /* Stop extensions */
};
};
static /* Use -fall-defs-global to expose */
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,
SEQUENCE_free,
...
@@ -292,15 +292,15 @@ asn_TYPE_descriptor_t asn_DEF_anything_member = {
...
@@ -292,15 +292,15 @@ asn_TYPE_descriptor_t asn_DEF_anything_member = {
SEQUENCE_decode_xer,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_encode_xer,
0, /* Use generic outmost tag fetcher */
0, /* Use generic outmost tag fetcher */
asn_DEF_anything_
m
ember_tags,
asn_DEF_anything_
M
ember_tags,
sizeof(asn_DEF_anything_
m
ember_tags)
sizeof(asn_DEF_anything_
M
ember_tags)
/sizeof(asn_DEF_anything_
m
ember_tags[0]), /* 1 */
/sizeof(asn_DEF_anything_
M
ember_tags[0]), /* 1 */
asn_DEF_anything_
m
ember_tags, /* Same as above */
asn_DEF_anything_
M
ember_tags, /* Same as above */
sizeof(asn_DEF_anything_
m
ember_tags)
sizeof(asn_DEF_anything_
M
ember_tags)
/sizeof(asn_DEF_anything_
m
ember_tags[0]), /* 1 */
/sizeof(asn_DEF_anything_
M
ember_tags[0]), /* 1 */
asn_MBR_anything_
m
ember,
asn_MBR_anything_
M
ember,
1, /* Elements count */
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[] = {
static asn_TYPE_member_t asn_MBR_anything[] = {
...
...
tests/66-ref-simple-OK.asn1.-P
View file @
152a91e4
...
@@ -27,7 +27,7 @@ static asn_TYPE_member_t asn_MBR_T[] = {
...
@@ -27,7 +27,7 @@ static asn_TYPE_member_t asn_MBR_T[] = {
.tag_mode = 0,
.tag_mode = 0,
.type = (void *)&asn_DEF_SimpleType,
.type = (void *)&asn_DEF_SimpleType,
.memb_constraints = 0, /* Defer constraints checking to the member type */
.memb_constraints = 0, /* Defer constraints checking to the member type */
.name = ""
.name = "
named
"
},
},
};
};
static ber_tlv_tag_t asn_DEF_T_tags[] = {
static ber_tlv_tag_t asn_DEF_T_tags[] = {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment