diff --git a/src/cell.c b/src/cell.c index cd83ddab570a3c848e0502629534743e8f383a4f..3fcb8c45633926d71998f1ebbbab6f4162667b2e 100644 --- a/src/cell.c +++ b/src/cell.c @@ -638,11 +638,11 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset) { */ void cell_init_parts(struct cell *c, void *data) { - struct part *p = c->parts; - struct xpart *xp = c->xparts; - const int count = c->count; + struct part *restrict p = c->parts; + struct xpart *restrict xp = c->xparts; + const size_t count = c->count; - for (int i = 0; i < count; ++i) { + for (size_t i = 0; i < count; ++i) { p[i].ti_begin = 0; p[i].ti_end = 0; xp[i].v_full[0] = p[i].v[0]; @@ -665,13 +665,14 @@ void cell_init_parts(struct cell *c, void *data) { */ void cell_init_gparts(struct cell *c, void *data) { - struct gpart *gp = c->gparts; - const int gcount = c->gcount; + struct gpart *restrict gp = c->gparts; + const size_t gcount = c->gcount; - for (int i = 0; i < gcount; ++i) { + for (size_t i = 0; i < gcount; ++i) { gp[i].ti_begin = 0; gp[i].ti_end = 0; gravity_first_init_gpart(&gp[i]); + gravity_init_gpart(&gp[i]); } c->ti_end_min = 0; c->ti_end_max = 0; diff --git a/src/gravity/Default/gravity.h b/src/gravity/Default/gravity.h index 0f62511eced181fbf3b5b781a50314dd08f7c0ef..7ef6db76e47f5a1cb2efee9d90fabb9f2ca7dd7f 100644 --- a/src/gravity/Default/gravity.h +++ b/src/gravity/Default/gravity.h @@ -82,7 +82,7 @@ __attribute__((always_inline)) INLINE static void gravity_first_init_gpart( * * @param gp The particle to act upon */ -__attribute__((always_inline)) INLINE static void gravity_init_part( +__attribute__((always_inline)) INLINE static void gravity_init_gpart( struct gpart* gp) { /* Zero the acceleration */ diff --git a/src/runner.c b/src/runner.c index ae8a33f8b6f62ad0e89e78bc04f60c965c88cd93..4d0b595b8241a8a6887f7da9e657f892c309103f 100644 --- a/src/runner.c +++ b/src/runner.c @@ -408,7 +408,7 @@ void runner_do_init(struct runner *r, struct cell *c, int timer) { if (gp->ti_end <= ti_current) { /* Get ready for a density calculation */ - gravity_init_part(gp); + gravity_init_gpart(gp); } } }