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
84f1fbb9
Commit
84f1fbb9
authored
Aug 02, 2019
by
Raphael Riebl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
per_support: rename per_long_range* to per_imax_range*
parent
98b176f1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
skeletons/INTEGER.c
skeletons/INTEGER.c
+2
-2
skeletons/per_support.c
skeletons/per_support.c
+5
-5
skeletons/per_support.h
skeletons/per_support.h
+2
-2
No files found.
skeletons/INTEGER.c
View file @
84f1fbb9
...
@@ -657,7 +657,7 @@ INTEGER_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
...
@@ -657,7 +657,7 @@ INTEGER_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
ASN__DECODE_STARVED
;
ASN__DECODE_STARVED
;
ASN_DEBUG
(
"Got value %lu + low %ld"
,
ASN_DEBUG
(
"Got value %lu + low %ld"
,
uvalue
,
ct
->
lower_bound
);
uvalue
,
ct
->
lower_bound
);
if
(
per_
long
_range_unrebase
(
uvalue
,
ct
->
lower_bound
,
if
(
per_
imax
_range_unrebase
(
uvalue
,
ct
->
lower_bound
,
ct
->
upper_bound
,
&
svalue
)
ct
->
upper_bound
,
&
svalue
)
||
asn_long2INTEGER
(
st
,
svalue
))
{
||
asn_long2INTEGER
(
st
,
svalue
))
{
ASN__DECODE_FAILED
;
ASN__DECODE_FAILED
;
...
@@ -788,7 +788,7 @@ INTEGER_encode_uper(const asn_TYPE_descriptor_t *td,
...
@@ -788,7 +788,7 @@ INTEGER_encode_uper(const asn_TYPE_descriptor_t *td,
}
}
v
=
(
unsigned
long
)
value
-
(
unsigned
long
)
ct
->
lower_bound
;
v
=
(
unsigned
long
)
value
-
(
unsigned
long
)
ct
->
lower_bound
;
}
else
{
}
else
{
if
(
per_
long
_range_rebase
(
value
,
ct
->
lower_bound
,
ct
->
upper_bound
,
&
v
))
{
if
(
per_
imax
_range_rebase
(
value
,
ct
->
lower_bound
,
ct
->
upper_bound
,
&
v
))
{
ASN__ENCODE_FAILED
;
ASN__ENCODE_FAILED
;
}
}
}
}
...
...
skeletons/per_support.c
View file @
84f1fbb9
...
@@ -216,7 +216,7 @@ uper_put_nslength(asn_per_outp_t *po, size_t length) {
...
@@ -216,7 +216,7 @@ uper_put_nslength(asn_per_outp_t *po, size_t length) {
}
}
static
int
static
int
per__
long
_range
(
intmax_t
lb
,
intmax_t
ub
,
uintmax_t
*
range_r
)
{
per__
imax
_range
(
intmax_t
lb
,
intmax_t
ub
,
uintmax_t
*
range_r
)
{
uintmax_t
bounds_range
;
uintmax_t
bounds_range
;
if
((
ub
<
0
)
==
(
lb
<
0
))
{
if
((
ub
<
0
)
==
(
lb
<
0
))
{
bounds_range
=
ub
-
lb
;
bounds_range
=
ub
-
lb
;
...
@@ -232,12 +232,12 @@ per__long_range(intmax_t lb, intmax_t ub, uintmax_t *range_r) {
...
@@ -232,12 +232,12 @@ per__long_range(intmax_t lb, intmax_t ub, uintmax_t *range_r) {
}
}
int
int
per_
long
_range_rebase
(
intmax_t
v
,
intmax_t
lb
,
intmax_t
ub
,
uintmax_t
*
output
)
{
per_
imax
_range_rebase
(
intmax_t
v
,
intmax_t
lb
,
intmax_t
ub
,
uintmax_t
*
output
)
{
uintmax_t
range
;
uintmax_t
range
;
assert
(
lb
<=
ub
);
assert
(
lb
<=
ub
);
if
(
v
<
lb
||
v
>
ub
||
per__
long
_range
(
lb
,
ub
,
&
range
)
<
0
)
{
if
(
v
<
lb
||
v
>
ub
||
per__
imax
_range
(
lb
,
ub
,
&
range
)
<
0
)
{
/* Range error. */
/* Range error. */
return
-
1
;
return
-
1
;
}
}
...
@@ -269,10 +269,10 @@ per_long_range_rebase(intmax_t v, intmax_t lb, intmax_t ub, uintmax_t *output) {
...
@@ -269,10 +269,10 @@ per_long_range_rebase(intmax_t v, intmax_t lb, intmax_t ub, uintmax_t *output) {
}
}
int
int
per_
long
_range_unrebase
(
uintmax_t
inp
,
intmax_t
lb
,
intmax_t
ub
,
intmax_t
*
outp
)
{
per_
imax
_range_unrebase
(
uintmax_t
inp
,
intmax_t
lb
,
intmax_t
ub
,
intmax_t
*
outp
)
{
uintmax_t
range
;
uintmax_t
range
;
if
(
per__
long
_range
(
lb
,
ub
,
&
range
)
!=
0
)
{
if
(
per__
imax
_range
(
lb
,
ub
,
&
range
)
!=
0
)
{
return
-
1
;
return
-
1
;
}
}
...
...
skeletons/per_support.h
View file @
84f1fbb9
...
@@ -81,9 +81,9 @@ typedef struct asn_bit_outp_s asn_per_outp_t;
...
@@ -81,9 +81,9 @@ typedef struct asn_bit_outp_s asn_per_outp_t;
* -1: Conversion failed due to range problems.
* -1: Conversion failed due to range problems.
* 0: Conversion was successful.
* 0: Conversion was successful.
*/
*/
int
per_
long
_range_rebase
(
intmax_t
v
,
intmax_t
lb
,
intmax_t
ub
,
uintmax_t
*
output
);
int
per_
imax
_range_rebase
(
intmax_t
v
,
intmax_t
lb
,
intmax_t
ub
,
uintmax_t
*
output
);
/* The inverse operation: restores the value by the offset and its bounds. */
/* The inverse operation: restores the value by the offset and its bounds. */
int
per_
long
_range_unrebase
(
uintmax_t
inp
,
intmax_t
lb
,
intmax_t
ub
,
intmax_t
*
outp
);
int
per_
imax
_range_unrebase
(
uintmax_t
inp
,
intmax_t
lb
,
intmax_t
ub
,
intmax_t
*
outp
);
/* X.691-2008/11, #11.5 */
/* X.691-2008/11, #11.5 */
int
uper_put_constrained_whole_number_u
(
asn_per_outp_t
*
po
,
unsigned
long
v
,
int
nbits
);
int
uper_put_constrained_whole_number_u
(
asn_per_outp_t
*
po
,
unsigned
long
v
,
int
nbits
);
...
...
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