From 7db80ba2c6d2bc4e70e864845d32c1a7454fed18 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Thu, 3 Sep 2015 13:55:52 +0200 Subject: [PATCH] Fix complaint about initial declaration in foor loop. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc-4.7.2 (Debian 4.7.2-5) complained about: "‘for’ loop initial declarations are only allowed in C99 mode note: use option -std=c99 or -std=gnu99 to compile your code" when seeing a loop like for(int i=0; i abs_epsilon) { double sum = fabs(p1[index]) + fabs(p2[index]); diff --git a/opm/core/wells/well_controls.c b/opm/core/wells/well_controls.c index 80cd883a..e3ded03c 100644 --- a/opm/core/wells/well_controls.c +++ b/opm/core/wells/well_controls.c @@ -364,7 +364,8 @@ well_controls_get_current_distr(const struct WellControls * ctrl) { void well_controls_iset_distr(const struct WellControls * ctrl, int control_index, const double * distr) { int offset = control_index * ctrl->number_of_phases; - for (int p=0; p < ctrl->number_of_phases; p++) + int p; + for (p=0; p < ctrl->number_of_phases; p++) ctrl->distr[offset + p] = distr[p]; } diff --git a/opm/core/wells/wells.c b/opm/core/wells/wells.c index e79173a7..53e8590c 100644 --- a/opm/core/wells/wells.c +++ b/opm/core/wells/wells.c @@ -544,7 +544,8 @@ wells_equal(const struct Wells *W1, const struct Wells *W2 , bool verbose) return are_equal; } - for (int i=0; inumber_of_wells; i++) { + int i; + for (i=0; inumber_of_wells; i++) { if (are_equal) { /* The name attribute can be NULL. The comparison is as