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
fc785637
Commit
fc785637
authored
Aug 17, 2024
by
Mouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct the logic in switch() cases order for OCTET_STRING_aper
parent
b798215c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
skeletons/OCTET_STRING_aper.c
skeletons/OCTET_STRING_aper.c
+23
-23
No files found.
skeletons/OCTET_STRING_aper.c
View file @
fc785637
...
...
@@ -59,16 +59,6 @@ OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
}
switch
(
specs
->
subvariant
)
{
default:
/*
case ASN_OSUBV_ANY:
ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
RETURN(RC_FAIL);
*/
case
ASN_OSUBV_BIT
:
canonical_unit_bits
=
unit_bits
=
1
;
bpc
=
OS__BPC_BIT
;
break
;
case
ASN_OSUBV_ANY
:
case
ASN_OSUBV_STR
:
canonical_unit_bits
=
unit_bits
=
8
;
...
...
@@ -88,6 +78,16 @@ OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
unit_bits
=
cval
->
range_bits
;
bpc
=
OS__BPC_U32
;
break
;
/*
case ASN_OSUBV_ANY:
ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
RETURN(RC_FAIL);
*/
case
ASN_OSUBV_BIT
:
default:
canonical_unit_bits
=
unit_bits
=
1
;
bpc
=
OS__BPC_BIT
;
break
;
}
/*
...
...
@@ -266,19 +266,7 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
ct_extensible
=
csiz
->
flags
&
APC_EXTENSIBLE
;
switch
(
specs
->
subvariant
)
{
default:
/*
case ASN_OSUBV_ANY:
ASN__ENCODE_FAILED;
*/
case
ASN_OSUBV_BIT
:
canonical_unit_bits
=
unit_bits
=
1
;
bpc
=
OS__BPC_BIT
;
sizeinunits
=
st
->
size
*
8
-
(
st
->
bits_unused
&
0x07
);
ASN_DEBUG
(
"BIT STRING of %d bytes"
,
sizeinunits
);
break
;
case
ASN_OSUBV_ANY
:
case
ASN_OSUBV_ANY
:
case
ASN_OSUBV_STR
:
canonical_unit_bits
=
unit_bits
=
8
;
/*
...
...
@@ -302,6 +290,18 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
bpc
=
OS__BPC_U32
;
sizeinunits
=
st
->
size
/
4
;
break
;
/*
case ASN_OSUBV_ANY:
ASN__ENCODE_FAILED;
*/
case
ASN_OSUBV_BIT
:
default:
canonical_unit_bits
=
unit_bits
=
1
;
bpc
=
OS__BPC_BIT
;
sizeinunits
=
st
->
size
*
8
-
(
st
->
bits_unused
&
0x07
);
ASN_DEBUG
(
"BIT STRING of %d bytes"
,
sizeinunits
);
break
;
}
ASN_DEBUG
(
"Encoding %s into %d units of %d bits"
...
...
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