From 4f3ca854e1e25d855c7c2b8f6458edd6aae385c5 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 26 Feb 2013 21:58:06 +0000 Subject: Fix various warnings with clang build, and adjust cmake clang warnings flags to include a few more that gcc is using too. --- intern/smoke/intern/FLUID_3D.h | 4 +-- intern/smoke/intern/FLUID_3D_STATIC.cpp | 52 ++++++++++++++++++--------------- intern/smoke/intern/WTURBULENCE.h | 2 +- 3 files changed, 31 insertions(+), 27 deletions(-) (limited to 'intern/smoke') diff --git a/intern/smoke/intern/FLUID_3D.h b/intern/smoke/intern/FLUID_3D.h index 8cadf3bc989..d98a39930de 100644 --- a/intern/smoke/intern/FLUID_3D.h +++ b/intern/smoke/intern/FLUID_3D.h @@ -41,9 +41,9 @@ using namespace std; using namespace BasicVector; -class WTURBULENCE; +struct WTURBULENCE; -class FLUID_3D +struct FLUID_3D { public: FLUID_3D(int *res, float dx, float dtdef, int init_heat, int init_fire, int init_colors); diff --git a/intern/smoke/intern/FLUID_3D_STATIC.cpp b/intern/smoke/intern/FLUID_3D_STATIC.cpp index ac485ad983a..e0a31a9d0c1 100644 --- a/intern/smoke/intern/FLUID_3D_STATIC.cpp +++ b/intern/smoke/intern/FLUID_3D_STATIC.cpp @@ -200,13 +200,15 @@ void FLUID_3D::setZeroZ(float* field, Vec3Int res, int zBegin, int zEnd) const int totalCells = res[0] * res[1] * res[2]; int index = 0; - if ((zBegin == 0)) - for (int y = 0; y < res[1]; y++) - for (int x = 0; x < res[0]; x++, index++) - { - // front slab - field[index] = 0.0f; - } + if (zBegin == 0) + { + for (int y = 0; y < res[1]; y++) + for (int x = 0; x < res[0]; x++, index++) + { + // front slab + field[index] = 0.0f; + } + } if (zEnd == res[2]) { @@ -265,27 +267,29 @@ void FLUID_3D::copyBorderZ(float* field, Vec3Int res, int zBegin, int zEnd) const int totalCells = res[0] * res[1] * res[2]; int index=0; - if ((zBegin == 0)) - for (int y = 0; y < res[1]; y++) - for (int x = 0; x < res[0]; x++, index++) - { - field[index] = field[index + slabSize]; - } + if (zBegin == 0) + { + for (int y = 0; y < res[1]; y++) + for (int x = 0; x < res[0]; x++, index++) + { + field[index] = field[index + slabSize]; + } + } - if ((zEnd == res[2])) + if (zEnd == res[2]) { - index=0; - int indexx=0; - const int cellsslab = totalCells - slabSize; + index=0; + int indexx=0; + const int cellsslab = totalCells - slabSize; - for (int y = 0; y < res[1]; y++) - for (int x = 0; x < res[0]; x++, index++) - { - // back slab - indexx = index + cellsslab; - field[indexx] = field[indexx - slabSize]; - } + for (int y = 0; y < res[1]; y++) + for (int x = 0; x < res[0]; x++, index++) + { + // back slab + indexx = index + cellsslab; + field[indexx] = field[indexx - slabSize]; + } } } diff --git a/intern/smoke/intern/WTURBULENCE.h b/intern/smoke/intern/WTURBULENCE.h index 1655bd95d32..4e76466bde5 100644 --- a/intern/smoke/intern/WTURBULENCE.h +++ b/intern/smoke/intern/WTURBULENCE.h @@ -32,7 +32,7 @@ class SIMPLE_PARSER; /////////////////////////////////////////////////////////////////////////////// /// Main WTURBULENCE class, stores large density array etc. /////////////////////////////////////////////////////////////////////////////// -class WTURBULENCE +struct WTURBULENCE { public: // both config files can be NULL, altCfg might override values from noiseCfg -- cgit v1.2.3