Commit eb50a813 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Small fixes following clang static analysis

parent bb31dffd
......@@ -1218,7 +1218,7 @@ __attribute__((always_inline)) INLINE static int cell_can_split_self_fof_task(
* @param ci The first #cell.
* @param cj The second #cell.
*/
__attribute__((always_inline)) INLINE static int
__attribute__((always_inline, nonnull)) INLINE static int
cell_need_rebuild_for_hydro_pair(const struct cell *ci, const struct cell *cj) {
/* Is the cut-off radius plus the max distance the parts in both cells have */
......@@ -1239,7 +1239,7 @@ cell_need_rebuild_for_hydro_pair(const struct cell *ci, const struct cell *cj) {
* @param ci The first #cell.
* @param cj The second #cell.
*/
__attribute__((always_inline)) INLINE static int
__attribute__((always_inline, nonnull)) INLINE static int
cell_need_rebuild_for_stars_pair(const struct cell *ci, const struct cell *cj) {
/* Is the cut-off radius plus the max distance the parts in both cells have */
......@@ -1260,7 +1260,7 @@ cell_need_rebuild_for_stars_pair(const struct cell *ci, const struct cell *cj) {
* @param ci The first #cell.
* @param cj The second #cell.
*/
__attribute__((always_inline)) INLINE static int
__attribute__((always_inline, nonnull)) INLINE static int
cell_need_rebuild_for_black_holes_pair(const struct cell *ci,
const struct cell *cj) {
......
......@@ -84,9 +84,10 @@ void pairs_n2(double *dim, struct part *restrict parts, int N, int periodic) {
int i, j, k, count = 0;
// int mj, mk;
// double maxratio = 1.0;
double r2, dx[3], rho = 0.0;
double r2, rho = 0.0;
double rho_max = 0.0, rho_min = 100;
float a = 1.f, H = 0.f;
float dx[3];
/* Loop over all particle pairs. */
for (j = 0; j < N; j++) {
......@@ -106,7 +107,7 @@ void pairs_n2(double *dim, struct part *restrict parts, int N, int periodic) {
}
r2 = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2];
if (r2 < parts[j].h * parts[j].h || r2 < parts[k].h * parts[k].h) {
runner_iact_density(r2, NULL, parts[j].h, parts[k].h, &parts[j],
runner_iact_density(r2, dx, parts[j].h, parts[k].h, &parts[j],
&parts[k], a, H);
/* if ( parts[j].h / parts[k].h > maxratio )
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment