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
f8a1af4a
Commit
f8a1af4a
authored
Jul 15, 2022
by
Pau Espin Pedrol
Committed by
Mouse
Jul 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aper: cosmetic: fix whitespace
Drop spacing and use tabs everywhere.
parent
30219de2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
66 deletions
+66
-66
skeletons/aper_support.c
skeletons/aper_support.c
+66
-66
No files found.
skeletons/aper_support.c
View file @
f8a1af4a
...
...
@@ -95,22 +95,22 @@ aper_get_nsnnwn(asn_per_data_t *pd, int range) {
//return -1;
int
length
;
/* handle indefinite range */
length
=
per_get_few_bits
(
pd
,
1
);
if
(
length
==
0
)
return
per_get_few_bits
(
pd
,
6
);
if
(
aper_get_align
(
pd
)
<
0
)
return
-
1
;
length
=
per_get_few_bits
(
pd
,
8
);
/* the length is not likely to be that big */
if
(
length
>
4
)
return
-
1
;
value
=
0
;
if
(
per_get_many_bits
(
pd
,
(
uint8_t
*
)
&
value
,
0
,
length
*
8
)
<
0
)
return
-
1
;
return
value
;
/* handle indefinite range */
length
=
per_get_few_bits
(
pd
,
1
);
if
(
length
==
0
)
return
per_get_few_bits
(
pd
,
6
);
if
(
aper_get_align
(
pd
)
<
0
)
return
-
1
;
length
=
per_get_few_bits
(
pd
,
8
);
/* the length is not likely to be that big */
if
(
length
>
4
)
return
-
1
;
value
=
0
;
if
(
per_get_many_bits
(
pd
,
(
uint8_t
*
)
&
value
,
0
,
length
*
8
)
<
0
)
return
-
1
;
return
value
;
}
if
(
aper_get_align
(
pd
)
<
0
)
return
-
1
;
...
...
@@ -120,26 +120,26 @@ aper_get_nsnnwn(asn_per_data_t *pd, int range) {
#else
/* old APER codec */
ssize_t
aper_get_nsnnwn
(
asn_per_data_t
*
pd
,
int
dummy_range
)
{
ssize_t
value
;
ASN_DEBUG
(
"Get the normally small non-negative whole number APER"
);
value
=
per_get_few_bits
(
pd
,
7
);
if
(
value
&
64
)
{
/* implicit (value < 0) */
value
&=
63
;
value
<<=
2
;
value
|=
per_get_few_bits
(
pd
,
2
);
if
(
value
&
128
)
/* implicit (value < 0) */
return
-
1
;
if
(
value
==
0
)
return
0
;
if
(
value
>=
3
)
return
-
1
;
value
=
per_get_few_bits
(
pd
,
8
*
value
);
return
value
;
}
return
value
;
ssize_t
value
;
ASN_DEBUG
(
"Get the normally small non-negative whole number APER"
);
value
=
per_get_few_bits
(
pd
,
7
);
if
(
value
&
64
)
{
/* implicit (value < 0) */
value
&=
63
;
value
<<=
2
;
value
|=
per_get_few_bits
(
pd
,
2
);
if
(
value
&
128
)
/* implicit (value < 0) */
return
-
1
;
if
(
value
==
0
)
return
0
;
if
(
value
>=
3
)
return
-
1
;
value
=
per_get_few_bits
(
pd
,
8
*
value
);
return
value
;
}
return
value
;
}
#endif
/* don't use old APER */
...
...
@@ -155,10 +155,10 @@ int aper_put_align(asn_per_outp_t *po) {
ssize_t
aper_put_length
(
asn_per_outp_t
*
po
,
int
range
,
size_t
length
,
int
*
need_eom
)
{
int
dummy
=
0
;
if
(
!
need_eom
)
need_eom
=
&
dummy
;
int
dummy
=
0
;
if
(
!
need_eom
)
need_eom
=
&
dummy
;
*
need_eom
=
0
;
*
need_eom
=
0
;
ASN_DEBUG
(
"APER put length %zu with range %d"
,
length
,
range
);
...
...
@@ -169,7 +169,7 @@ aper_put_length(asn_per_outp_t *po, int range, size_t length, int *need_eom) {
if
(
aper_put_align
(
po
)
<
0
)
return
-
1
;
if
(
length
<=
127
)
/* #10.9.3.6 */
{
if
(
length
<=
127
)
{
/* #10.9.3.6 */
return
per_put_few_bits
(
po
,
length
,
8
)
?
-
1
:
(
ssize_t
)
length
;
}
...
...
@@ -177,12 +177,12 @@ aper_put_length(asn_per_outp_t *po, int range, size_t length, int *need_eom) {
return
per_put_few_bits
(
po
,
length
|
0x8000
,
16
)
?
-
1
:
(
ssize_t
)
length
;
*
need_eom
=
0
==
(
length
&
16383
);
*
need_eom
=
0
==
(
length
&
16383
);
length
>>=
14
;
if
(
length
>
4
)
{
*
need_eom
=
0
;
length
=
4
;
}
*
need_eom
=
0
;
length
=
4
;
}
return
per_put_few_bits
(
po
,
0xC0
|
length
,
8
)
?
-
1
:
(
ssize_t
)(
length
<<
14
);
...
...
@@ -211,7 +211,7 @@ int
aper_put_nsnnwn
(
asn_per_outp_t
*
po
,
int
range
,
int
number
)
{
int
bytes
;
ASN_DEBUG
(
"aper put nsnnwn %d with range %d"
,
number
,
range
);
ASN_DEBUG
(
"aper put nsnnwn %d with range %d"
,
number
,
range
);
/* 10.5.7.1 X.691 */
if
(
range
<
0
)
{
int
i
;
...
...
@@ -254,30 +254,30 @@ aper_put_nsnnwn(asn_per_outp_t *po, int range, int number) {
/* if(per_put_few_bits(po, bytes, 8))
return -1;
*/
return
per_put_few_bits
(
po
,
number
,
8
*
bytes
);
return
per_put_few_bits
(
po
,
number
,
8
*
bytes
);
}
#else
/* preserve old code base in case */
int
aper_put_nsnnwn
(
asn_per_outp_t
*
po
,
int
dummy_range
,
int
n
)
{
int
bytes
;
ASN_DEBUG
(
"aper_put_nsnnwn"
);
if
(
n
<=
63
)
{
if
(
n
<
0
)
return
-
1
;
return
per_put_few_bits
(
po
,
n
,
7
);
}
if
(
n
<
256
)
bytes
=
1
;
else
if
(
n
<
65536
)
bytes
=
2
;
else
if
(
n
<
256
*
65536
)
bytes
=
3
;
else
return
-
1
;
/* This is not a "normally small" value */
if
(
per_put_few_bits
(
po
,
bytes
,
8
))
return
-
1
;
return
per_put_few_bits
(
po
,
n
,
8
*
bytes
);
int
bytes
;
ASN_DEBUG
(
"aper_put_nsnnwn"
);
if
(
n
<=
63
)
{
if
(
n
<
0
)
return
-
1
;
return
per_put_few_bits
(
po
,
n
,
7
);
}
if
(
n
<
256
)
bytes
=
1
;
else
if
(
n
<
65536
)
bytes
=
2
;
else
if
(
n
<
256
*
65536
)
bytes
=
3
;
else
return
-
1
;
/* This is not a "normally small" value */
if
(
per_put_few_bits
(
po
,
bytes
,
8
))
return
-
1
;
return
per_put_few_bits
(
po
,
n
,
8
*
bytes
);
}
#endif
/* which aper_put_nsnnwn() */
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