Commit 67061bd5 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Tests now pass with the new level of warnings for GCC compilation.

parent 16eca057
......@@ -179,7 +179,8 @@ void readArray(hid_t grp, const struct io_props props, size_t N,
void prepareArray(struct engine* e, hid_t grp, char* fileName, FILE* xmfFile,
char* partTypeGroupName, const struct io_props props,
unsigned long long N_total, const struct UnitSystem* internal_units,
unsigned long long N_total,
const struct UnitSystem* internal_units,
const struct UnitSystem* snapshot_units) {
/* Create data space */
......
......@@ -127,7 +127,7 @@ void get_solution(const struct cell *main_cell, struct solution_part *solution,
float density, enum velocity_field vel,
enum pressure_field press, float size) {
for (size_t i = 0; i < main_cell->count; ++i) {
for (int i = 0; i < main_cell->count; ++i) {
solution[i].id = main_cell->parts[i].id;
......@@ -187,7 +187,7 @@ void get_solution(const struct cell *main_cell, struct solution_part *solution,
void reset_particles(struct cell *c, enum velocity_field vel,
enum pressure_field press, float size, float density) {
for (size_t i = 0; i < c->count; ++i) {
for (int i = 0; i < c->count; ++i) {
struct part *p = &c->parts[i];
......@@ -304,7 +304,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
fprintf(file, "# Main cell --------------------------------------------\n");
/* Write main cell */
for (size_t pid = 0; pid < main_cell->count; pid++) {
for (int pid = 0; pid < main_cell->count; pid++) {
fprintf(file,
"%6llu %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f "
"%8.5f "
......@@ -343,7 +343,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
fprintf(file, "# Solution ---------------------------------------------\n");
for (size_t pid = 0; pid < main_cell->count; pid++) {
for (int pid = 0; pid < main_cell->count; pid++) {
fprintf(file,
"%6llu %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f "
"%8.5f %8.5f "
......
......@@ -146,7 +146,7 @@ void clean_up(struct cell *ci) {
* @brief Initializes all particles field to be ready for a density calculation
*/
void zero_particle_fields(struct cell *c) {
for (size_t pid = 0; pid < c->count; pid++) {
for (int pid = 0; pid < c->count; pid++) {
hydro_init_part(&c->parts[pid]);
}
}
......@@ -155,7 +155,7 @@ void zero_particle_fields(struct cell *c) {
* @brief Ends the loop by adding the appropriate coefficients
*/
void end_calculation(struct cell *c) {
for (size_t pid = 0; pid < c->count; pid++) {
for (int pid = 0; pid < c->count; pid++) {
hydro_end_density(&c->parts[pid], 1);
}
}
......@@ -177,7 +177,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
fprintf(file, "# Main cell --------------------------------------------\n");
/* Write main cell */
for (size_t pid = 0; pid < main_cell->count; pid++) {
for (int pid = 0; pid < main_cell->count; pid++) {
fprintf(file,
"%6llu %10f %10f %10f %10f %10f %10f %13e %13e %13e %13e %13e "
"%13e %13e %13e\n",
......@@ -219,7 +219,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
"# Offset: [%2d %2d %2d] -----------------------------------\n",
i - 1, j - 1, k - 1);
for (size_t pjd = 0; pjd < cj->count; pjd++) {
for (int pjd = 0; pjd < cj->count; pjd++) {
fprintf(
file,
"%6llu %10f %10f %10f %10f %10f %10f %13e %13e %13e %13e %13e "
......
......@@ -105,7 +105,7 @@ void clean_up(struct cell *ci) {
* @brief Initializes all particles field to be ready for a density calculation
*/
void zero_particle_fields(struct cell *c) {
for (size_t pid = 0; pid < c->count; pid++) {
for (int pid = 0; pid < c->count; pid++) {
hydro_init_part(&c->parts[pid]);
}
}
......@@ -125,7 +125,7 @@ void dump_particle_fields(char *fileName, struct cell *ci, struct cell *cj) {
fprintf(file, "# ci --------------------------------------------\n");
for (size_t pid = 0; pid < ci->count; pid++) {
for (int pid = 0; pid < ci->count; pid++) {
fprintf(file,
"%6llu %10f %10f %10f %10f %10f %10f %13e %13e %13e %13e %13e "
"%13e %13e %13e\n",
......@@ -149,7 +149,7 @@ void dump_particle_fields(char *fileName, struct cell *ci, struct cell *cj) {
fprintf(file, "# cj --------------------------------------------\n");
for (size_t pjd = 0; pjd < cj->count; pjd++) {
for (int pjd = 0; pjd < cj->count; pjd++) {
fprintf(file,
"%6llu %10f %10f %10f %10f %10f %10f %13e %13e %13e %13e %13e "
"%13e %13e %13e\n",
......
......@@ -28,7 +28,7 @@ int main() {
size_t Ngas = 0, Ngpart = 0;
int periodic = -1;
int flag_entropy_ICs = -1;
int i, j, k, n;
int i, j, k;
double dim[3];
struct part *parts = NULL;
struct gpart *gparts = NULL;
......@@ -55,7 +55,7 @@ int main() {
assert(periodic == 1);
/* Check particles */
for (n = 0; n < Ngas; ++n) {
for (size_t n = 0; n < Ngas; ++n) {
/* Check that indices are in a reasonable range */
unsigned long long index = parts[n].id;
......
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