Commit 9ef8c274 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add some initialisations required by GCC 4.9

Doesn't like short circuits hiding initialisations, not sure that ticks is handled correctly, is it supposed to be an opaque type
parent 2726dd52
......@@ -185,8 +185,8 @@ void engine_redistribute(struct engine *e) {
/* Get the new number of parts for this node, be generous in allocating. */
int nr_parts = 0;
for (int k = 0; k < nr_nodes; k++) nr_parts += counts[k * nr_nodes + nodeID];
struct part *parts_new;
struct xpart *xparts_new, *xparts = s->xparts;
struct part *parts_new = NULL;
struct xpart *xparts_new = NULL, *xparts = s->xparts;
if (posix_memalign((void **)&parts_new, part_align,
sizeof(struct part) * nr_parts * 1.2) != 0 ||
posix_memalign((void **)&xparts_new, part_align,
......@@ -951,8 +951,8 @@ int engine_exchange_strays(struct engine *e, int offset, int *ind, int N) {
message("sent out %i particles, got %i back.", N, count_in);
if (offset + count_in > s->size_parts) {
s->size_parts = (offset + count_in) * 1.05;
struct part *parts_new;
struct xpart *xparts_new;
struct part *parts_new = NULL;
struct xpart *xparts_new = NULL;
if (posix_memalign((void **)&parts_new, part_align,
sizeof(struct part) * s->size_parts) != 0 ||
posix_memalign((void **)&xparts_new, part_align,
......@@ -2098,8 +2098,8 @@ void engine_split(struct engine *e, int *grid) {
message("Re-allocating parts array from %i to %i.", s->size_parts,
(int)(s->nr_parts * 1.2));
s->size_parts = s->nr_parts * 1.2;
struct part *parts_new;
struct xpart *xparts_new;
struct part *parts_new = NULL;
struct xpart *xparts_new = NULL;
if (posix_memalign((void **)&parts_new, part_align,
sizeof(struct part) * s->size_parts) != 0 ||
posix_memalign((void **)&xparts_new, part_align,
......
......@@ -167,6 +167,7 @@ int main(int argc, char *argv[]) {
engine.dt_step = 0.1;
runner.e = &engine;
time = 0;
for (size_t i = 0; i < runs; ++i) {
/* Zero the fields */
......
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