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
24810025
Commit
24810025
authored
Aug 25, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove warnings
parent
6903380f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
skeletons/OCTET_STRING.c
skeletons/OCTET_STRING.c
+2
-2
skeletons/OCTET_STRING_oer.c
skeletons/OCTET_STRING_oer.c
+2
-2
skeletons/constr_SEQUENCE.c
skeletons/constr_SEQUENCE.c
+18
-14
No files found.
skeletons/OCTET_STRING.c
View file @
24810025
...
@@ -1616,7 +1616,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
...
@@ -1616,7 +1616,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
if
(
csiz
->
effective_bits
>=
0
)
{
if
(
csiz
->
effective_bits
>=
0
)
{
ASN_DEBUG
(
"Encoding %
d
bytes (%ld), length in %d bits"
,
ASN_DEBUG
(
"Encoding %
zu
bytes (%ld), length in %d bits"
,
st
->
size
,
sizeinunits
-
csiz
->
lower_bound
,
st
->
size
,
sizeinunits
-
csiz
->
lower_bound
,
csiz
->
effective_bits
);
csiz
->
effective_bits
);
ret
=
per_put_few_bits
(
po
,
sizeinunits
-
csiz
->
lower_bound
,
ret
=
per_put_few_bits
(
po
,
sizeinunits
-
csiz
->
lower_bound
,
...
@@ -1634,7 +1634,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
...
@@ -1634,7 +1634,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
ASN__ENCODED_OK
(
er
);
ASN__ENCODED_OK
(
er
);
}
}
ASN_DEBUG
(
"Encoding %
d
bytes"
,
st
->
size
);
ASN_DEBUG
(
"Encoding %
zu
bytes"
,
st
->
size
);
if
(
sizeinunits
==
0
)
{
if
(
sizeinunits
==
0
)
{
if
(
uper_put_length
(
po
,
0
))
if
(
uper_put_length
(
po
,
0
))
...
...
skeletons/OCTET_STRING_oer.c
View file @
24810025
...
@@ -116,7 +116,7 @@ OCTET_STRING_encode_oer(asn_TYPE_descriptor_t *td,
...
@@ -116,7 +116,7 @@ OCTET_STRING_encode_oer(asn_TYPE_descriptor_t *td,
if
(
!
st
)
ASN__ENCODE_FAILED
;
if
(
!
st
)
ASN__ENCODE_FAILED
;
ASN_DEBUG
(
"Encoding %s %
d
as OCTET STRING"
,
td
?
td
->
name
:
""
,
st
->
size
);
ASN_DEBUG
(
"Encoding %s %
zu
as OCTET STRING"
,
td
?
td
->
name
:
""
,
st
->
size
);
if
(
ct_size
>=
0
)
{
if
(
ct_size
>=
0
)
{
/*
/*
...
@@ -144,7 +144,7 @@ OCTET_STRING_encode_oer(asn_TYPE_descriptor_t *td,
...
@@ -144,7 +144,7 @@ OCTET_STRING_encode_oer(asn_TYPE_descriptor_t *td,
if
(
st
->
size
!=
unit_bytes
*
(
size_t
)
ct_size
)
{
if
(
st
->
size
!=
unit_bytes
*
(
size_t
)
ct_size
)
{
ASN_DEBUG
(
ASN_DEBUG
(
"Trying to encode %s (%zu bytes) which doesn't fit SIZE "
"Trying to encode %s (%zu bytes) which doesn't fit SIZE "
"constraint (%
d
)"
,
"constraint (%
zu
)"
,
td
->
name
,
st
->
size
,
ct_size
);
td
->
name
,
st
->
size
,
ct_size
);
ASN__ENCODE_FAILED
;
ASN__ENCODE_FAILED
;
}
}
...
...
skeletons/constr_SEQUENCE.c
View file @
24810025
...
@@ -202,7 +202,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -202,7 +202,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/*
/*
* MICROPHASE 1: Synchronize decoding.
* MICROPHASE 1: Synchronize decoding.
*/
*/
ASN_DEBUG
(
"In %s SEQUENCE left %d, edx=%u flags=%d"
ASN_DEBUG
(
"In %s SEQUENCE left %d, edx=%
z
u flags=%d"
" opt=%d ec=%d"
,
" opt=%d ec=%d"
,
td
->
name
,
(
int
)
ctx
->
left
,
edx
,
td
->
name
,
(
int
)
ctx
->
left
,
edx
,
elements
[
edx
].
flags
,
elements
[
edx
].
optional
,
elements
[
edx
].
flags
,
elements
[
edx
].
optional
,
...
@@ -231,7 +231,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -231,7 +231,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
* Fetch the T from TLV.
* Fetch the T from TLV.
*/
*/
tag_len
=
ber_fetch_tag
(
ptr
,
LEFT
,
&
tlv_tag
);
tag_len
=
ber_fetch_tag
(
ptr
,
LEFT
,
&
tlv_tag
);
ASN_DEBUG
(
"Current tag in %s SEQUENCE for element %
d
"
ASN_DEBUG
(
"Current tag in %s SEQUENCE for element %
zu
"
"(%s) is %s encoded in %d bytes, of frame %ld"
,
"(%s) is %s encoded in %d bytes, of frame %ld"
,
td
->
name
,
edx
,
elements
[
edx
].
name
,
td
->
name
,
edx
,
elements
[
edx
].
name
,
ber_tlv_tag_string
(
tlv_tag
),
(
int
)
tag_len
,
(
long
)
LEFT
);
ber_tlv_tag_string
(
tlv_tag
),
(
int
)
tag_len
,
(
long
)
LEFT
);
...
@@ -350,7 +350,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -350,7 +350,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
*/
*/
if
(
!
IN_EXTENSION_GROUP
(
specs
,
if
(
!
IN_EXTENSION_GROUP
(
specs
,
edx
+
elements
[
edx
].
optional
))
{
edx
+
elements
[
edx
].
optional
))
{
ASN_DEBUG
(
"Unexpected tag %s (at %
d
)"
,
ASN_DEBUG
(
"Unexpected tag %s (at %
zu
)"
,
ber_tlv_tag_string
(
tlv_tag
),
edx
);
ber_tlv_tag_string
(
tlv_tag
),
edx
);
ASN_DEBUG
(
"Expected tag %s (%s)%s"
,
ASN_DEBUG
(
"Expected tag %s (%s)%s"
,
ber_tlv_tag_string
(
elements
[
edx
].
tag
),
ber_tlv_tag_string
(
elements
[
edx
].
tag
),
...
@@ -363,7 +363,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -363,7 +363,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
ssize_t
skip
;
ssize_t
skip
;
edx
+=
elements
[
edx
].
optional
;
edx
+=
elements
[
edx
].
optional
;
ASN_DEBUG
(
"Skipping unexpected %s (at %
d
)"
,
ASN_DEBUG
(
"Skipping unexpected %s (at %
zu
)"
,
ber_tlv_tag_string
(
tlv_tag
),
edx
);
ber_tlv_tag_string
(
tlv_tag
),
edx
);
skip
=
ber_skip_length
(
opt_codec_ctx
,
skip
=
ber_skip_length
(
opt_codec_ctx
,
BER_TLV_CONSTRUCTED
(
ptr
),
BER_TLV_CONSTRUCTED
(
ptr
),
...
@@ -414,7 +414,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -414,7 +414,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
elements
[
edx
].
type
,
elements
[
edx
].
type
,
memb_ptr2
,
ptr
,
LEFT
,
memb_ptr2
,
ptr
,
LEFT
,
elements
[
edx
].
tag_mode
);
elements
[
edx
].
tag_mode
);
ASN_DEBUG
(
"In %s SEQUENCE decoded %
d
%s of %d "
ASN_DEBUG
(
"In %s SEQUENCE decoded %
zu
%s of %d "
"in %d bytes rval.code %d, size=%d"
,
"in %d bytes rval.code %d, size=%d"
,
td
->
name
,
edx
,
elements
[
edx
].
type
->
name
,
td
->
name
,
edx
,
elements
[
edx
].
type
->
name
,
(
int
)
LEFT
,
(
int
)
rval
.
consumed
,
rval
.
code
,
(
int
)
size
);
(
int
)
LEFT
,
(
int
)
rval
.
consumed
,
rval
.
code
,
(
int
)
size
);
...
@@ -544,7 +544,7 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
...
@@ -544,7 +544,7 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
if
(
erval
.
encoded
==
-
1
)
if
(
erval
.
encoded
==
-
1
)
return
erval
;
return
erval
;
computed_size
+=
erval
.
encoded
;
computed_size
+=
erval
.
encoded
;
ASN_DEBUG
(
"Member %
d
%s estimated %ld bytes"
,
ASN_DEBUG
(
"Member %
zu
%s estimated %ld bytes"
,
edx
,
elm
->
name
,
(
long
)
erval
.
encoded
);
edx
,
elm
->
name
,
(
long
)
erval
.
encoded
);
}
}
...
@@ -579,7 +579,7 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
...
@@ -579,7 +579,7 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
if
(
tmperval
.
encoded
==
-
1
)
if
(
tmperval
.
encoded
==
-
1
)
return
tmperval
;
return
tmperval
;
computed_size
-=
tmperval
.
encoded
;
computed_size
-=
tmperval
.
encoded
;
ASN_DEBUG
(
"Member %
d
%s of SEQUENCE %s encoded in %ld bytes"
,
ASN_DEBUG
(
"Member %
zu
%s of SEQUENCE %s encoded in %ld bytes"
,
edx
,
elm
->
name
,
td
->
name
,
(
long
)
tmperval
.
encoded
);
edx
,
elm
->
name
,
td
->
name
,
(
long
)
tmperval
.
encoded
);
}
}
...
@@ -766,7 +766,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -766,7 +766,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
case
XCT_UNKNOWN_OP
:
case
XCT_UNKNOWN_OP
:
case
XCT_UNKNOWN_BO
:
case
XCT_UNKNOWN_BO
:
ASN_DEBUG
(
"XER/SEQUENCE: tcv=%d, ph=%d, edx=%
d
"
,
ASN_DEBUG
(
"XER/SEQUENCE: tcv=%d, ph=%d, edx=%
zu
"
,
tcv
,
ctx
->
phase
,
edx
);
tcv
,
ctx
->
phase
,
edx
);
if
(
ctx
->
phase
!=
1
)
{
if
(
ctx
->
phase
!=
1
)
{
break
;
/* Really unexpected */
break
;
/* Really unexpected */
...
@@ -805,7 +805,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -805,7 +805,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
if
(
n
!=
edx_end
)
if
(
n
!=
edx_end
)
continue
;
continue
;
}
else
{
}
else
{
ASN_DEBUG
(
"Out of defined members: %
d/%d
"
,
ASN_DEBUG
(
"Out of defined members: %
zu/%u
"
,
edx
,
td
->
elements_count
);
edx
,
td
->
elements_count
);
}
}
...
@@ -813,7 +813,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -813,7 +813,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
if
(
IN_EXTENSION_GROUP
(
specs
,
if
(
IN_EXTENSION_GROUP
(
specs
,
edx
+
(
edx
<
td
->
elements_count
edx
+
(
edx
<
td
->
elements_count
?
elements
[
edx
].
optional
:
0
)))
{
?
elements
[
edx
].
optional
:
0
)))
{
ASN_DEBUG
(
"Got anticipated extension at %
d
"
,
ASN_DEBUG
(
"Got anticipated extension at %
zu
"
,
edx
);
edx
);
/*
/*
* Check for (XCT_BOTH or XCT_UNKNOWN_BO)
* Check for (XCT_BOTH or XCT_UNKNOWN_BO)
...
@@ -1036,6 +1036,8 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
...
@@ -1036,6 +1036,8 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
return
0
;
return
0
;
}
}
#ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t
asn_dec_rval_t
SEQUENCE_decode_uper
(
asn_codec_ctx_t
*
opt_codec_ctx
,
asn_TYPE_descriptor_t
*
td
,
SEQUENCE_decode_uper
(
asn_codec_ctx_t
*
opt_codec_ctx
,
asn_TYPE_descriptor_t
*
td
,
const
asn_per_constraints_t
*
constraints
,
void
**
sptr
,
const
asn_per_constraints_t
*
constraints
,
void
**
sptr
,
...
@@ -1183,7 +1185,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -1183,7 +1185,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
int
present
;
int
present
;
if
(
!
IN_EXTENSION_GROUP
(
specs
,
edx
))
{
if
(
!
IN_EXTENSION_GROUP
(
specs
,
edx
))
{
ASN_DEBUG
(
"%
d is not
extension"
,
edx
);
ASN_DEBUG
(
"%
zu is not an
extension"
,
edx
);
continue
;
continue
;
}
}
...
@@ -1277,7 +1279,7 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
...
@@ -1277,7 +1279,7 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
int
present
;
int
present
;
if
(
!
IN_EXTENSION_GROUP
(
specs
,
edx
))
{
if
(
!
IN_EXTENSION_GROUP
(
specs
,
edx
))
{
ASN_DEBUG
(
"%s (@%
d
) is not extension"
,
elm
->
type
->
name
,
edx
);
ASN_DEBUG
(
"%s (@%
zu
) is not extension"
,
elm
->
type
->
name
,
edx
);
continue
;
continue
;
}
}
...
@@ -1291,7 +1293,7 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
...
@@ -1291,7 +1293,7 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
present
=
1
;
present
=
1
;
}
}
ASN_DEBUG
(
"checking %s (@%
d
) present => %d"
,
ASN_DEBUG
(
"checking %s (@%
zu
) present => %d"
,
elm
->
type
->
name
,
edx
,
present
);
elm
->
type
->
name
,
edx
,
present
);
exts_count
++
;
exts_count
++
;
exts_present
+=
present
;
exts_present
+=
present
;
...
@@ -1397,7 +1399,7 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
...
@@ -1397,7 +1399,7 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
if
(
elm
->
flags
&
ATF_POINTER
)
{
if
(
elm
->
flags
&
ATF_POINTER
)
{
memb_ptr2
=
(
void
**
)((
char
*
)
sptr
+
elm
->
memb_offset
);
memb_ptr2
=
(
void
**
)((
char
*
)
sptr
+
elm
->
memb_offset
);
if
(
!*
memb_ptr2
)
{
if
(
!*
memb_ptr2
)
{
ASN_DEBUG
(
"Element %s %
d
not present"
,
ASN_DEBUG
(
"Element %s %
zu
not present"
,
elm
->
name
,
edx
);
elm
->
name
,
edx
);
if
(
elm
->
optional
)
if
(
elm
->
optional
)
continue
;
continue
;
...
@@ -1442,6 +1444,8 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
...
@@ -1442,6 +1444,8 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
ASN__ENCODED_OK
(
er
);
ASN__ENCODED_OK
(
er
);
}
}
#endif
/* ASN_DISABLE_PER_SUPPORT */
int
int
SEQUENCE_compare
(
const
asn_TYPE_descriptor_t
*
td
,
const
void
*
aptr
,
SEQUENCE_compare
(
const
asn_TYPE_descriptor_t
*
td
,
const
void
*
aptr
,
const
void
*
bptr
)
{
const
void
*
bptr
)
{
...
...
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