Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Lustrec - public version
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LustreC
Lustrec - public version
Commits
9a7268ba
Commit
9a7268ba
authored
7 years ago
by
Pierre Loic Garoche
Browse files
Options
Downloads
Patches
Plain Diff
io_frontend header with new functions
parent
7ab1c5bd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/io_frontend.h
+4
-1
4 additions, 1 deletion
include/io_frontend.h
include/io_frontend.hpp
+18
-3
18 additions, 3 deletions
include/io_frontend.hpp
with
22 additions
and
4 deletions
include/io_frontend.h
+
4
−
1
View file @
9a7268ba
...
...
@@ -23,6 +23,9 @@ extern void _put_bool(FILE* file, char* n, _Bool _V);
extern
void
_put_int
(
FILE
*
file
,
char
*
n
,
int
_V
);
/*@ assigns \nothing; */
extern
void
_put_double
(
FILE
*
file
,
char
*
n
,
double
_V
);
extern
void
_put_float
(
FILE
*
file
,
char
*
n
,
float
_V
,
int
PREC
);
/*@ assigns \nothing; */
extern
void
_put_double
(
FILE
*
file
,
char
*
n
,
double
_V
,
int
PREC
);
#endif
This diff is collapsed.
Click to expand it.
include/io_frontend.hpp
+
18
−
3
View file @
9a7268ba
...
...
@@ -80,15 +80,30 @@ void _put_int(FILE* file, char* n, int _V){
printf
(
"
\n
"
);
fprintf
(
file
,
"%d
\n
"
,
_V
);
}
void
_put_double
(
FILE
*
file
,
char
*
n
,
double
_V
){
void
_put_float
(
FILE
*
file
,
char
*
n
,
float
_V
,
int
PREC
){
if
(
ISATTY
)
{
printf
(
"%s = "
,
n
);
}
else
{
printf
(
"'%s': "
,
n
);
};
printf
(
"'%.*f' "
,
PREC
,
_V
);
printf
(
"
\n
"
);
fprintf
(
file
,
"%.*f
\n
"
,
PREC
,
_V
);
fflush
(
file
);
}
void
_put_double
(
FILE
*
file
,
char
*
n
,
double
_V
,
int
PREC
){
if
(
ISATTY
)
{
printf
(
"%s = "
,
n
);
}
else
{
printf
(
"'%s': "
,
n
);
};
printf
(
"'%f' "
,
_V
);
printf
(
"'%
.*
f' "
,
PREC
,
_V
);
printf
(
"
\n
"
);
fprintf
(
file
,
"%f
\n
"
,
_V
);
fprintf
(
file
,
"%.*f
\n
"
,
PREC
,
_V
);
fflush
(
file
);
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
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