Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wenqing
ogs
Commits
17233e94
Commit
17233e94
authored
5 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[BL] Fix clang-tidy google-readability-braces-around-statements.
parent
6fd7282b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
BaseLib/DateTools.cpp
+8
-0
8 additions, 0 deletions
BaseLib/DateTools.cpp
BaseLib/FileTools.h
+2
-0
2 additions, 0 deletions
BaseLib/FileTools.h
BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp
+2
-0
2 additions, 0 deletions
BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp
with
12 additions
and
0 deletions
BaseLib/DateTools.cpp
+
8
−
0
View file @
17233e94
...
@@ -75,11 +75,15 @@ std::string date2string(double ddate)
...
@@ -75,11 +75,15 @@ std::string date2string(double ddate)
rest
=
rest
%
(
y
*
10000
);
rest
=
rest
%
(
y
*
10000
);
auto
m
=
static_cast
<
int
>
(
std
::
floor
(
rest
/
100.0
));
auto
m
=
static_cast
<
int
>
(
std
::
floor
(
rest
/
100.0
));
if
(
m
<
1
||
m
>
12
)
if
(
m
<
1
||
m
>
12
)
{
WARN
(
"date2String(): month not in [1:12]."
);
WARN
(
"date2String(): month not in [1:12]."
);
}
rest
=
rest
%
(
m
*
100
);
rest
=
rest
%
(
m
*
100
);
int
d
=
rest
;
int
d
=
rest
;
if
(
d
<
1
||
d
>
31
)
if
(
d
<
1
||
d
>
31
)
{
WARN
(
"date2String(): day not in [1:31]."
);
WARN
(
"date2String(): day not in [1:31]."
);
}
std
::
string
day
=
std
::
to_string
(
d
);
std
::
string
day
=
std
::
to_string
(
d
);
if
(
d
<
10
)
if
(
d
<
10
)
...
@@ -116,10 +120,14 @@ int xmlDate2int(const std::string &s)
...
@@ -116,10 +120,14 @@ int xmlDate2int(const std::string &s)
{
{
int
d
=
atoi
(
s
.
substr
(
8
,
2
).
c_str
());
int
d
=
atoi
(
s
.
substr
(
8
,
2
).
c_str
());
if
(
d
<
1
||
d
>
31
)
if
(
d
<
1
||
d
>
31
)
{
WARN
(
"xmlDate2double(): day not in [1:31]."
);
WARN
(
"xmlDate2double(): day not in [1:31]."
);
}
int
m
=
atoi
(
s
.
substr
(
5
,
2
).
c_str
());
int
m
=
atoi
(
s
.
substr
(
5
,
2
).
c_str
());
if
(
m
<
1
||
m
>
12
)
if
(
m
<
1
||
m
>
12
)
{
WARN
(
"xmlDate2double(): month not in [1:12]."
);
WARN
(
"xmlDate2double(): month not in [1:12]."
);
}
int
y
=
atoi
(
s
.
substr
(
0
,
4
).
c_str
());
int
y
=
atoi
(
s
.
substr
(
0
,
4
).
c_str
());
return
date2int
(
y
,
m
,
d
);
return
date2int
(
y
,
m
,
d
);
}
}
...
...
This diff is collapsed.
Click to expand it.
BaseLib/FileTools.h
+
2
−
0
View file @
17233e94
...
@@ -101,7 +101,9 @@ std::vector<T> readBinaryArray(std::string const& filename, std::size_t const n)
...
@@ -101,7 +101,9 @@ std::vector<T> readBinaryArray(std::string const& filename, std::size_t const n)
result
.
size
());
result
.
size
());
if
(
!
in
.
eof
())
if
(
!
in
.
eof
())
{
ERR
(
"EOF reached.
\n
"
);
ERR
(
"EOF reached.
\n
"
);
}
return
std
::
vector
<
T
>
();
return
std
::
vector
<
T
>
();
}
}
...
...
This diff is collapsed.
Click to expand it.
BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp
+
2
−
0
View file @
17233e94
...
@@ -125,7 +125,9 @@ bool XMLQtInterface::checkHash() const
...
@@ -125,7 +125,9 @@ bool XMLQtInterface::checkHash() const
INFO
(
"File is valid, hashfile written."
);
INFO
(
"File is valid, hashfile written."
);
}
}
else
else
{
WARN
(
"File is valid but could not write hashfile!"
);
WARN
(
"File is valid but could not write hashfile!"
);
}
return
true
;
return
true
;
}
}
}
// namespace IO
}
// namespace IO
...
...
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