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
0b56b22c
Commit
0b56b22c
authored
Oct 18, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix default value cmp/set order
parent
04ca1b52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
libasn1compiler/asn1c_C.c
libasn1compiler/asn1c_C.c
+6
-6
skeletons/constr_TYPE.h
skeletons/constr_TYPE.h
+1
-1
No files found.
libasn1compiler/asn1c_C.c
View file @
0b56b22c
...
...
@@ -2309,7 +2309,7 @@ safe_string(const uint8_t *buf, int size) {
static
void
emit_default_string_value
(
arg_t
*
arg
,
asn1p_value_t
*
v
)
{
OUT
(
"static uint8_t defv[] = "
);
OUT
(
"static
const
uint8_t defv[] = "
);
assert
(
v
->
type
==
ATV_STRING
);
if
(
safe_string
(
v
->
value
.
string
.
buf
,
v
->
value
.
string
.
size
))
{
...
...
@@ -2346,13 +2346,13 @@ try_inline_default(arg_t *arg, asn1p_expr_t *expr, int out) {
expr
->
marker
.
flags
&=
~
EM_INDIRECT
;
if
(
!
out
)
{
if
(
C99_MODE
)
OUT
(
".default_value_cmp = "
);
OUT
(
"asn_DFL_%d_cmp_%s,"
,
OUT
(
"
&
asn_DFL_%d_cmp_%s,"
,
expr
->
_type_unique_index
,
asn1p_itoa
(
expr
->
marker
.
default_value
->
value
.
v_integer
));
OUT
(
"
\t
/* Compare DEFAULT %s */
\n
"
,
asn1p_itoa
(
expr
->
marker
.
default_value
->
value
.
v_integer
));
if
(
C99_MODE
)
OUT
(
".default_value_set = "
);
OUT
(
"asn_DFL_%d_set_%s,"
,
OUT
(
"
&
asn_DFL_%d_set_%s,"
,
expr
->
_type_unique_index
,
asn1p_itoa
(
expr
->
marker
.
default_value
->
value
.
v_integer
));
OUT
(
"
\t
/* Set DEFAULT %s */
\n
"
,
...
...
@@ -2424,11 +2424,11 @@ try_inline_default(arg_t *arg, asn1p_expr_t *expr, int out) {
break
;
if
(
!
out
)
{
if
(
C99_MODE
)
OUT
(
".default_value_cmp = "
);
OUT
(
"asn_DFL_%d_cmp,
\t
/* Compare DEFAULT
\"
%s
\"
*/
\n
"
,
OUT
(
"
&
asn_DFL_%d_cmp,
\t
/* Compare DEFAULT
\"
%s
\"
*/
\n
"
,
expr
->
_type_unique_index
,
expr
->
marker
.
default_value
->
value
.
string
.
buf
);
if
(
C99_MODE
)
OUT
(
".default_value_set = "
);
OUT
(
"asn_DFL_%d_set,
\t
/* Set DEFAULT
\"
%s
\"
*/
\n
"
,
OUT
(
"
&
asn_DFL_%d_set,
\t
/* Set DEFAULT
\"
%s
\"
*/
\n
"
,
expr
->
_type_unique_index
,
expr
->
marker
.
default_value
->
value
.
string
.
buf
);
return
1
;
...
...
@@ -2462,7 +2462,7 @@ try_inline_default(arg_t *arg, asn1p_expr_t *expr, int out) {
OUT
(
"if(!nstr) return -1;
\n
"
);
OUT
(
"memcpy(nstr, defv, sizeof(defv));
\n
"
);
OUT
(
"
\n
"
);
OUT
(
"if(
(st = *sptr)
) {
\n
"
);
OUT
(
"if(
st
) {
\n
"
);
OUT
(
"
\t
FREEMEM(st->buf);
\n
"
);
OUT
(
"} else {
\n
"
);
OUT
(
"
\t
st = (*sptr = CALLOC(1, sizeof(*st)));
\n
"
);
...
...
skeletons/constr_TYPE.h
View file @
0b56b22c
...
...
@@ -226,8 +226,8 @@ typedef struct asn_TYPE_member_s {
asn_TYPE_descriptor_t
*
type
;
/* Member type descriptor */
asn_type_selector_f
*
type_selector
;
/* IoS runtime type selector */
asn_encoding_constraints_t
encoding_constraints
;
int
(
*
default_value_set
)(
void
**
sptr
);
/* Set DEFAULT <value> */
int
(
*
default_value_cmp
)(
const
void
*
sptr
);
/* Compare DEFAULT <value> */
int
(
*
default_value_set
)(
void
**
sptr
);
/* Set DEFAULT <value> */
const
char
*
name
;
/* ASN.1 identifier of the element */
}
asn_TYPE_member_t
;
...
...
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