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

c->depth should be cast to an int before appearing in atomic_cas()

parent 143abee2
...@@ -1440,6 +1440,7 @@ void space_split_mapper(void *map_data, int num_cells, void *extra_data) { ...@@ -1440,6 +1440,7 @@ void space_split_mapper(void *map_data, int num_cells, void *extra_data) {
const int count = c->count; const int count = c->count;
const int gcount = c->gcount; const int gcount = c->gcount;
const int depth = c->depth;
int maxdepth = 0; int maxdepth = 0;
float h_max = 0.0f; float h_max = 0.0f;
int ti_end_min = max_nr_timesteps, ti_end_max = 0; int ti_end_min = max_nr_timesteps, ti_end_max = 0;
...@@ -1449,8 +1450,8 @@ void space_split_mapper(void *map_data, int num_cells, void *extra_data) { ...@@ -1449,8 +1450,8 @@ void space_split_mapper(void *map_data, int num_cells, void *extra_data) {
struct xpart *xparts = c->xparts; struct xpart *xparts = c->xparts;
/* Check the depth. */ /* Check the depth. */
while (c->depth > (maxdepth = s->maxdepth)) { while (depth > (maxdepth = s->maxdepth)) {
atomic_cas(&s->maxdepth, maxdepth, c->depth); atomic_cas(&s->maxdepth, maxdepth, depth);
} }
/* If the depth is too large, we have a problem and should stop. */ /* If the depth is too large, we have a problem and should stop. */
......
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