Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
45
Issues
45
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
8b53de8e
Commit
8b53de8e
authored
Jan 10, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
INT_MAX now included from limits.h file
parent
0ab63175
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
arith.c
proto-standard/arith.c
+4
-6
No files found.
proto-standard/arith.c
View file @
8b53de8e
...
...
@@ -2,12 +2,10 @@
* FIXME header
*/
#include <limits.h>
#include <pptp/pptp.h>
#include <pptp/diag.h>
/* FIXME: This is a temp workaround. How to define it? */
#define PP_INT_MAX 2147483647
void
int64_to_TimeInternal
(
Integer64
bigint
,
TimeInternal
*
internal
)
{
uint64_t
bigint_val
;
...
...
@@ -35,8 +33,8 @@ void from_TimeInternal(TimeInternal *internal, Timestamp *external)
* so there is no problem here.
*/
if
((
internal
->
seconds
&
~
PP_
INT_MAX
)
||
(
internal
->
nanoseconds
&
~
PP_
INT_MAX
))
{
if
((
internal
->
seconds
&
~
INT_MAX
)
||
(
internal
->
nanoseconds
&
~
INT_MAX
))
{
/* FIXME diag
* DBG("Negative value cannot be converted into timestamp \n");
*/
...
...
@@ -51,7 +49,7 @@ void from_TimeInternal(TimeInternal *internal, Timestamp *external)
void
to_TimeInternal
(
TimeInternal
*
internal
,
Timestamp
*
external
)
{
/* Program will not run after 2038... */
if
(
external
->
secondsField
.
lsb
<
PP_
INT_MAX
)
{
if
(
external
->
secondsField
.
lsb
<
INT_MAX
)
{
internal
->
seconds
=
external
->
secondsField
.
lsb
;
internal
->
nanoseconds
=
external
->
nanosecondsField
;
}
else
{
...
...
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