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
16207b15
Commit
16207b15
authored
Aug 02, 2019
by
Raphael Riebl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
per_support: add drop-in replacements of per_long_range_{rebase,unrebase}
parent
2a9e2a3c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
skeletons/per_support.c
skeletons/per_support.c
+16
-0
skeletons/per_support.h
skeletons/per_support.h
+2
-0
No files found.
skeletons/per_support.c
View file @
16207b15
...
...
@@ -268,6 +268,14 @@ per_imax_range_rebase(intmax_t v, intmax_t lb, intmax_t ub, uintmax_t *output) {
}
}
int
per_long_range_rebase
(
long
v
,
intmax_t
lb
,
intmax_t
ub
,
unsigned
long
*
output
)
{
uintmax_t
tmp
=
*
output
;
int
rc
=
per_imax_range_rebase
((
intmax_t
)
v
,
lb
,
ub
,
&
tmp
);
*
output
=
tmp
;
return
rc
;
}
int
per_imax_range_unrebase
(
uintmax_t
inp
,
intmax_t
lb
,
intmax_t
ub
,
intmax_t
*
outp
)
{
uintmax_t
range
;
...
...
@@ -294,6 +302,14 @@ per_imax_range_unrebase(uintmax_t inp, intmax_t lb, intmax_t ub, intmax_t *outp)
return
0
;
}
int
per_long_range_unrebase
(
unsigned
long
inp
,
intmax_t
lb
,
intmax_t
ub
,
long
*
outp
)
{
intmax_t
tmp
=
*
outp
;
int
rc
=
per_imax_range_unrebase
((
uintmax_t
)
inp
,
lb
,
ub
,
&
tmp
);
*
outp
=
tmp
;
return
rc
;
}
int32_t
aper_get_align
(
asn_per_data_t
*
pd
)
{
...
...
skeletons/per_support.h
View file @
16207b15
...
...
@@ -81,8 +81,10 @@ typedef struct asn_bit_outp_s asn_per_outp_t;
* -1: Conversion failed due to range problems.
* 0: Conversion was successful.
*/
int
per_long_range_rebase
(
long
,
intmax_t
lb
,
intmax_t
ub
,
unsigned
long
*
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. */
int
per_long_range_unrebase
(
unsigned
long
inp
,
intmax_t
lb
,
intmax_t
ub
,
long
*
outp
);
int
per_imax_range_unrebase
(
uintmax_t
inp
,
intmax_t
lb
,
intmax_t
ub
,
intmax_t
*
outp
);
/* X.691-2008/11, #11.5 */
...
...
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