Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenFOAM-plus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Development
OpenFOAM-plus
Commits
cc6341a9
Commit
cc6341a9
authored
10 years ago
by
Henry
Browse files
Options
Downloads
Patches
Plain Diff
int??IO: handle overflow errors
parent
9617b8f5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/primitives/ints/int32/int32IO.C
+4
-2
4 additions, 2 deletions
src/OpenFOAM/primitives/ints/int32/int32IO.C
src/OpenFOAM/primitives/ints/int64/int64IO.C
+4
-2
4 additions, 2 deletions
src/OpenFOAM/primitives/ints/int64/int64IO.C
with
8 additions
and
4 deletions
src/OpenFOAM/primitives/ints/int32/int32IO.C
+
4
−
2
View file @
cc6341a9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
========= |
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014
-2015
OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
...
@@ -29,6 +29,7 @@ License
...
@@ -29,6 +29,7 @@ License
#include
"IOstreams.H"
#include
"IOstreams.H"
#include
<sstream>
#include
<sstream>
#include
<cerrno>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
@@ -85,9 +86,10 @@ int32_t Foam::readInt32(Istream& is)
...
@@ -85,9 +86,10 @@ int32_t Foam::readInt32(Istream& is)
bool
Foam
::
read
(
const
char
*
buf
,
int32_t
&
s
)
bool
Foam
::
read
(
const
char
*
buf
,
int32_t
&
s
)
{
{
char
*
endptr
=
NULL
;
char
*
endptr
=
NULL
;
errno
=
0
;
long
l
=
strtol
(
buf
,
&
endptr
,
10
);
long
l
=
strtol
(
buf
,
&
endptr
,
10
);
s
=
int32_t
(
l
);
s
=
int32_t
(
l
);
return
(
*
endptr
==
0
);
return
(
*
endptr
==
0
)
&&
(
errno
==
0
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/primitives/ints/int64/int64IO.C
+
4
−
2
View file @
cc6341a9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
========= |
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014
-2015
OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
...
@@ -29,6 +29,7 @@ License
...
@@ -29,6 +29,7 @@ License
#include
"IOstreams.H"
#include
"IOstreams.H"
#include
<sstream>
#include
<sstream>
#include
<cerrno>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
@@ -85,9 +86,10 @@ int64_t Foam::readInt64(Istream& is)
...
@@ -85,9 +86,10 @@ int64_t Foam::readInt64(Istream& is)
bool
Foam
::
read
(
const
char
*
buf
,
int64_t
&
s
)
bool
Foam
::
read
(
const
char
*
buf
,
int64_t
&
s
)
{
{
char
*
endptr
=
NULL
;
char
*
endptr
=
NULL
;
errno
=
0
;
long
l
=
strtol
(
buf
,
&
endptr
,
10
);
long
l
=
strtol
(
buf
,
&
endptr
,
10
);
s
=
int64_t
(
l
);
s
=
int64_t
(
l
);
return
(
*
endptr
==
0
);
return
(
*
endptr
==
0
)
&&
(
errno
==
0
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment