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
81cc4e47
Commit
81cc4e47
authored
Feb 07, 2024
by
v0-e
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
INTEGER to (u)int64_t
parent
ce10a57a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
skeletons/INTEGER.c
skeletons/INTEGER.c
+27
-0
skeletons/INTEGER.h
skeletons/INTEGER.h
+2
-0
No files found.
skeletons/INTEGER.c
View file @
81cc4e47
...
...
@@ -414,6 +414,33 @@ asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
return
asn_imax2INTEGER
(
st
,
value
);
}
int
asn_INTEGER2int64
(
const
INTEGER_t
*
st
,
int64_t
*
value
)
{
intmax_t
v
;
if
(
asn_INTEGER2imax
(
st
,
&
v
)
==
0
)
{
if
(
v
<
INT64_MIN
||
v
>
INT64_MAX
)
{
errno
=
ERANGE
;
return
-
1
;
}
*
value
=
v
;
return
0
;
}
else
{
return
-
1
;
}
}
int
asn_INTEGER2uint64
(
const
INTEGER_t
*
st
,
uint64_t
*
value
)
{
uintmax_t
v
;
if
(
asn_INTEGER2umax
(
st
,
&
v
)
==
0
)
{
if
(
v
>
UINT64_MAX
)
{
errno
=
ERANGE
;
return
-
1
;
}
*
value
=
v
;
return
0
;
}
else
{
return
-
1
;
}
}
int
asn_uint642INTEGER
(
INTEGER_t
*
st
,
uint64_t
value
)
{
...
...
skeletons/INTEGER.h
View file @
81cc4e47
...
...
@@ -108,6 +108,8 @@ int asn_INTEGER2long(const INTEGER_t *i, long *l);
int
asn_INTEGER2ulong
(
const
INTEGER_t
*
i
,
unsigned
long
*
l
);
int
asn_long2INTEGER
(
INTEGER_t
*
i
,
long
l
);
int
asn_ulong2INTEGER
(
INTEGER_t
*
i
,
unsigned
long
l
);
int
asn_INTEGER2int64
(
const
INTEGER_t
*
i
,
int64_t
*
l
);
int
asn_INTEGER2uint64
(
const
INTEGER_t
*
i
,
uint64_t
*
l
);
int
asn_int642INTEGER
(
INTEGER_t
*
i
,
int64_t
l
);
int
asn_uint642INTEGER
(
INTEGER_t
*
i
,
uint64_t
l
);
...
...
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