Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
2851245e
Commit
2851245e
authored
Oct 26, 2016
by
Matthieu Schaller
Browse files
Correctly use abs(), fabs() and fabsf() where required. Silences clang warnings.
parent
4ee4b353
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
2851245e
...
...
@@ -793,7 +793,7 @@ int cell_are_neighbours(const struct cell *restrict ci,
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
const
double
center_i
=
ci
->
loc
[
k
];
const
double
center_j
=
cj
->
loc
[
k
];
if
(
fabs
f
(
center_i
-
center_j
)
>
min_dist
)
return
0
;
if
(
fabs
(
center_i
-
center_j
)
>
min_dist
)
return
0
;
}
return
1
;
...
...
@@ -823,7 +823,7 @@ void cell_check_multipole(struct cell *c, void *data) {
mb
.
mass
);
for
(
int
k
=
0
;
k
<
3
;
++
k
)
if
(
fabs
f
(
ma
.
CoM
[
k
]
-
mb
.
CoM
[
k
])
/
fabs
f
(
ma
.
CoM
[
k
]
+
mb
.
CoM
[
k
])
>
1e-5
)
if
(
fabs
(
ma
.
CoM
[
k
]
-
mb
.
CoM
[
k
])
/
fabs
(
ma
.
CoM
[
k
]
+
mb
.
CoM
[
k
])
>
1e-5
)
error
(
"Multipole CoM are different (%12.15e vs. %12.15e"
,
ma
.
CoM
[
k
],
mb
.
CoM
[
k
]);
...
...
src/debug.c
View file @
2851245e
...
...
@@ -171,7 +171,7 @@ int checkSpacehmax(struct space *s) {
}
/* If within some epsilon we are OK. */
if
(
abs
(
cell_h_max
-
part_h_max
)
<=
FLT_EPSILON
)
return
1
;
if
(
f
abs
f
(
cell_h_max
-
part_h_max
)
<=
FLT_EPSILON
)
return
1
;
/* There is a problem. Hunt it down. */
for
(
int
k
=
0
;
k
<
s
->
nr_cells
;
k
++
)
{
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment