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. --- CMakeLists.txt | 11 ++++- build_files/cmake/macros.cmake | 1 + .../audaspace/FX/AUD_IDynamicIIRFilterCalculator.h | 2 + intern/audaspace/intern/AUD_Sequencer.h | 2 +- intern/elbeem/intern/ntl_geometrymodel.cpp | 8 +--- intern/elbeem/intern/ntl_geometryobject.cpp | 7 +-- intern/elbeem/intern/ntl_geometryobject.h | 2 +- intern/elbeem/intern/ntl_ray.cpp | 1 - intern/elbeem/intern/ntl_ray.h | 3 -- intern/elbeem/intern/solver_main.cpp | 1 - intern/elbeem/intern/solver_util.cpp | 14 +++--- intern/ghost/intern/GHOST_SystemCocoa.mm | 2 +- intern/iksolver/intern/IK_Solver.cpp | 2 + intern/itasc/Armature.cpp | 2 + intern/itasc/Armature.hpp | 2 + intern/itasc/kdl/segment.cpp | 4 +- intern/smoke/intern/FLUID_3D.h | 4 +- intern/smoke/intern/FLUID_3D_STATIC.cpp | 52 ++++++++++++---------- intern/smoke/intern/WTURBULENCE.h | 2 +- source/blender/blenlib/intern/threads.c | 8 +++- source/blender/collada/ArmatureImporter.cpp | 4 +- source/blender/collada/ArmatureImporter.h | 3 +- source/blender/collada/ControllerExporter.cpp | 2 +- source/blender/collada/DocumentImporter.cpp | 2 +- source/blender/collada/TransformReader.cpp | 44 +++++++++--------- .../compositor/operations/COM_TranslateOperation.h | 2 - source/blender/editors/sculpt_paint/sculpt_undo.c | 2 + source/blender/imbuf/intern/filetype.c | 5 ++- source/blender/makesdna/DNA_image_types.h | 4 +- source/blender/makesrna/intern/CMakeLists.txt | 3 ++ source/blender/modifiers/intern/MOD_meshcache.c | 2 +- source/blender/render/CMakeLists.txt | 3 +- source/blender/render/intern/raytrace/reorganize.h | 3 -- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 2 +- .../gameengine/GameLogic/Joystick/SCA_Joystick.cpp | 10 ++--- .../GameLogic/Joystick/SCA_JoystickDefines.h | 4 +- source/gameengine/Ketsji/KX_IpoConvert.h | 2 +- 37 files changed, 121 insertions(+), 106 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b174fa2ac34..c3ede3cbe03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1968,20 +1968,27 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # strange, clang complains these are not supported, but then yses them. ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall) + ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement) + ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration) + ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type) ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_AUTOLOGICAL_COMPARE -Wno-tautological-compare) ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas) ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts) ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_STRICT_PROTOTYPES -Wstrict-prototypes) ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_PROTOTYPES -Wmissing-prototypes) - ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros) + ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_AUTOLOGICAL_COMPARE -Wno-tautological-compare) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_OVERLOADED_VIRTUAL -Wno-overloaded-virtual) # we get a lot of these, if its a problem a dev needs to look into it. + ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof) - ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros) + + # gives too many unfixable warnings + # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros) + # ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros) elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index bdd82a4f438..db27c4fe6d1 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -499,6 +499,7 @@ macro(remove_strict_flags) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") remove_cc_flag("-Wunused-parameter") remove_cc_flag("-Wunused-variable") + remove_cc_flag("-Werror=[^ ]+") remove_cc_flag("-Werror") endif() diff --git a/intern/audaspace/FX/AUD_IDynamicIIRFilterCalculator.h b/intern/audaspace/FX/AUD_IDynamicIIRFilterCalculator.h index 29b87e57ad0..2e0d8418571 100644 --- a/intern/audaspace/FX/AUD_IDynamicIIRFilterCalculator.h +++ b/intern/audaspace/FX/AUD_IDynamicIIRFilterCalculator.h @@ -40,6 +40,8 @@ class AUD_IDynamicIIRFilterCalculator { public: + virtual ~AUD_IDynamicIIRFilterCalculator() {} + /** * Recalculates the filter coefficients. * \param rate The sample rate of the audio data. diff --git a/intern/audaspace/intern/AUD_Sequencer.h b/intern/audaspace/intern/AUD_Sequencer.h index 9fdf537ff97..1066eeae8e3 100644 --- a/intern/audaspace/intern/AUD_Sequencer.h +++ b/intern/audaspace/intern/AUD_Sequencer.h @@ -100,7 +100,7 @@ public: * \param muted Whether the whole scene is muted. */ AUD_Sequencer(AUD_Specs specs, float fps, bool muted); - ~AUD_Sequencer(); + virtual ~AUD_Sequencer(); /** * Locks the sequence. diff --git a/intern/elbeem/intern/ntl_geometrymodel.cpp b/intern/elbeem/intern/ntl_geometrymodel.cpp index 13220736b8e..62e4441bad7 100644 --- a/intern/elbeem/intern/ntl_geometrymodel.cpp +++ b/intern/elbeem/intern/ntl_geometrymodel.cpp @@ -215,7 +215,6 @@ void ntlGeometryObjModel::calcTriangleDivs(vector &verts, vector &verts, vector fsTri*fsTri) { divs1 = (int)(norm(side1)/fsTri); } if(normNoSqrt(side2) > fsTri*fsTri) { divs2 = (int)(norm(side2)/fsTri); } - //if(normNoSqrt(side3) > fsTri*fsTri) { divs3 = (int)(norm(side3)/fsTri); } // special handling // warning, requires objmodel triangle treatment (no verts dups) @@ -237,17 +235,15 @@ void ntlGeometryObjModel::calcTriangleDivs(vector &verts, vector fsTri*fsTri) { tdivs1 = (int)(norm(side1)/fsTri); } if(normNoSqrt(side2) > fsTri*fsTri) { tdivs2 = (int)(norm(side2)/fsTri); } if(tdivs1>divs1) divs1=tdivs1; if(tdivs2>divs2) divs2=tdivs2; - if(tdivs3>divs3) divs3=tdivs3; } } // */ mTriangleDivs1[i] = divs1; mTriangleDivs2[i] = divs2; - mTriangleDivs3[i] = divs3; } } diff --git a/intern/elbeem/intern/ntl_geometryobject.cpp b/intern/elbeem/intern/ntl_geometryobject.cpp index 1e08cb96a95..9b17b1854f2 100644 --- a/intern/elbeem/intern/ntl_geometryobject.cpp +++ b/intern/elbeem/intern/ntl_geometryobject.cpp @@ -42,7 +42,7 @@ ntlGeometryObject::ntlGeometryObject() : mMovPoints(), mMovNormals(), mHaveCachedMov(false), mCachedMovPoints(), mCachedMovNormals(), - mTriangleDivs1(), mTriangleDivs2(), mTriangleDivs3(), + mTriangleDivs1(), mTriangleDivs2(), mMovPntsInited(-100.0), mMaxMovPnt(-1), mcGeoActive(1.), mCpsTimeStart(0.), mCpsTimeEnd(1.0), mCpsQuality(10.), @@ -434,7 +434,6 @@ void ntlGeometryObject::applyTransformation(double t, vector *verts, void ntlGeometryObject::calcTriangleDivs(vector &verts, vector &tris, gfxReal fsTri) { mTriangleDivs1.resize( tris.size() ); mTriangleDivs2.resize( tris.size() ); - mTriangleDivs3.resize( tris.size() ); //fsTri *= 2.; // DEBUG! , wrong init! @@ -444,14 +443,12 @@ void ntlGeometryObject::calcTriangleDivs(vector &verts, vector fsTri*fsTri) { divs1 = (int)(norm(side1)/fsTri); } if(normNoSqrt(side2) > fsTri*fsTri) { divs2 = (int)(norm(side2)/fsTri); } mTriangleDivs1[i] = divs1; mTriangleDivs2[i] = divs2; - mTriangleDivs3[i] = divs3; } } diff --git a/intern/elbeem/intern/ntl_geometryobject.h b/intern/elbeem/intern/ntl_geometryobject.h index fca539b8402..677f132f4c3 100644 --- a/intern/elbeem/intern/ntl_geometryobject.h +++ b/intern/elbeem/intern/ntl_geometryobject.h @@ -223,7 +223,7 @@ class ntlGeometryObject : public ntlGeometryClass vector mCachedMovPoints; vector mCachedMovNormals; /*! precomputed triangle divisions */ - vector mTriangleDivs1,mTriangleDivs2,mTriangleDivs3; + vector mTriangleDivs1,mTriangleDivs2; /*! inited? */ float mMovPntsInited; /*! point with max. distance from center */ diff --git a/intern/elbeem/intern/ntl_ray.cpp b/intern/elbeem/intern/ntl_ray.cpp index 7f5aedc53c6..1083fcdb68b 100644 --- a/intern/elbeem/intern/ntl_ray.cpp +++ b/intern/elbeem/intern/ntl_ray.cpp @@ -677,7 +677,6 @@ const ntlColor ntlRay::shade() //const ntlScene::ntlScene( ntlRenderGlobals *glob, bool del ) : mpGlob( glob ), mSceneDel(del), mpTree( NULL ), - mDisplayListId( -1 ), mSceneBuilt( false ), mFirstInitDone( false ) { } diff --git a/intern/elbeem/intern/ntl_ray.h b/intern/elbeem/intern/ntl_ray.h index 71fcd5f71c2..5f6d34e3020 100644 --- a/intern/elbeem/intern/ntl_ray.h +++ b/intern/elbeem/intern/ntl_ray.h @@ -404,9 +404,6 @@ private: /*! Tree to store quickly intersect triangles */ ntlTree *mpTree; - /*! id of dislpay list for raytracer stuff */ - int mDisplayListId; - /*! was the scene successfully built? only then getObject(i) requests are valid */ bool mSceneBuilt; diff --git a/intern/elbeem/intern/solver_main.cpp b/intern/elbeem/intern/solver_main.cpp index b9436e84922..99278657fd9 100644 --- a/intern/elbeem/intern/solver_main.cpp +++ b/intern/elbeem/intern/solver_main.cpp @@ -1170,7 +1170,6 @@ LbmFsgrSolver::standingFluidPreinit() LbmFloat lcsmqo; # if OPT3D==1 LbmFloat lcsmqadd, lcsmeq[LBM_DFNUM], lcsmomega; - CellFlagType nbored=0; # endif // OPT3D==true GRID_LOOP_START(); diff --git a/intern/elbeem/intern/solver_util.cpp b/intern/elbeem/intern/solver_util.cpp index 935a910e7d5..6eca427c787 100644 --- a/intern/elbeem/intern/solver_util.cpp +++ b/intern/elbeem/intern/solver_util.cpp @@ -731,15 +731,15 @@ void LbmFsgrSolver::advanceParticles() { if(mPartUsePhysModel) { LbmFloat radius = p->getSize() * minDropSize; - LbmVec velPart = vec2L(p->getVel()) *cellsize/timestep; // L2RW, lattice velocity - LbmVec velWater = LbmVec(vx,vy,vz) *cellsize/timestep;// L2RW, fluid velocity - LbmVec velRel = velWater - velPart; + //LbmVec velPart = vec2L(p->getVel()) *cellsize/timestep; // L2RW, lattice velocity + //LbmVec velWater = LbmVec(vx,vy,vz) *cellsize/timestep;// L2RW, fluid velocity + //LbmVec velRel = velWater - velPart; //LbmFloat velRelNorm = norm(velRel); - LbmFloat pvolume = rhoAir * 4.0/3.0 * M_PI* radius*radius*radius; // volume: 4/3 pi r^3 + //LbmFloat pvolume = rhoAir * 4.0/3.0 * M_PI* radius*radius*radius; // volume: 4/3 pi r^3 - LbmVec fb = -rwgrav* pvolume *rhoWater; - LbmVec fd = velRel*6.0*M_PI*radius* (1e-3); //viscWater; - LbmVec change = (fb+fd) *10.0*timestep *(timestep/cellsize); + //LbmVec fb = -rwgrav* pvolume *rhoWater; + //LbmVec fd = velRel*6.0*M_PI*radius* (1e-3); //viscWater; + //LbmVec change = (fb+fd) *10.0*timestep *(timestep/cellsize); /*if(debugOutCounter<0) { errMsg("PIT","BTEST1 vol="<0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf); } else { - pushEvent( new GHOST_EventKey([event timestamp] * 1000, GHOST_kEventKeyUp, window, keyCode, 0, '\0') ); + pushEvent( new GHOST_EventKey([event timestamp] * 1000, GHOST_kEventKeyUp, window, keyCode, 0, NULL) ); //printf("Key up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf); } break; diff --git a/intern/iksolver/intern/IK_Solver.cpp b/intern/iksolver/intern/IK_Solver.cpp index c1a4ffcb1e8..65ea4d64ab1 100644 --- a/intern/iksolver/intern/IK_Solver.cpp +++ b/intern/iksolver/intern/IK_Solver.cpp @@ -348,6 +348,7 @@ float IK_SolverGetPoleAngle(IK_Solver *solver) return qsolver->solver.GetPoleAngle(); } +#if 0 static void IK_SolverAddCenterOfMass(IK_Solver *solver, IK_Segment *root, float goal[3], float weight) { if (solver == NULL || root == NULL) @@ -363,6 +364,7 @@ static void IK_SolverAddCenterOfMass(IK_Solver *solver, IK_Segment *root, float com->SetWeight(weight); qsolver->tasks.push_back(com); } +#endif int IK_Solve(IK_Solver *solver, float tolerance, int max_iterations) { diff --git a/intern/itasc/Armature.cpp b/intern/itasc/Armature.cpp index 78780ed8ba3..19f37a79484 100644 --- a/intern/itasc/Armature.cpp +++ b/intern/itasc/Armature.cpp @@ -32,7 +32,9 @@ Armature::Armature(): m_qCCh(-1), m_qCTs(0), m_yCCh(-1), +#if 0 m_yCTs(0), +#endif m_qKdl(), m_oldqKdl(), m_newqKdl(), diff --git a/intern/itasc/Armature.hpp b/intern/itasc/Armature.hpp index 63d1899f4e9..3167247ab03 100644 --- a/intern/itasc/Armature.hpp +++ b/intern/itasc/Armature.hpp @@ -111,7 +111,9 @@ private: int m_qCCh; CacheTS m_qCTs; int m_yCCh; +#if 0 CacheTS m_yCTs; +#endif JntArray m_qKdl; JntArray m_oldqKdl; JntArray m_newqKdl; diff --git a/intern/itasc/kdl/segment.cpp b/intern/itasc/kdl/segment.cpp index f963559c4c8..fbb775f6682 100644 --- a/intern/itasc/kdl/segment.cpp +++ b/intern/itasc/kdl/segment.cpp @@ -25,13 +25,13 @@ namespace KDL { Segment::Segment(const Joint& _joint, const Frame& _f_tip, const Inertia& _M): - joint(_joint),M(_M), + M(_M),joint(_joint), f_tip(_f_tip) { } Segment::Segment(const Segment& in): - joint(in.joint),M(in.M), + M(in.M),joint(in.joint), f_tip(in.f_tip) { } 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 diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 686484ef1db..a74f82ae965 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -429,12 +429,16 @@ void BLI_spin_unlock(SpinLock *spin) #endif } +#ifndef __APPLE__ void BLI_spin_end(SpinLock *spin) { -#ifndef __APPLE__ pthread_spin_destroy(spin); -#endif } +#else +void BLI_spin_end(SpinLock *UNUSED(spin)) +{ +} +#endif /* Read/Write Mutex Lock */ diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp index c270a1e6b20..221a5008f10 100644 --- a/source/blender/collada/ArmatureImporter.cpp +++ b/source/blender/collada/ArmatureImporter.cpp @@ -49,8 +49,8 @@ static const char *bc_get_joint_name(T *node) return id.size() ? id.c_str() : node->getOriginalId().c_str(); } -ArmatureImporter::ArmatureImporter(UnitConverter *conv, MeshImporterBase *mesh, AnimationImporterBase *anim, Scene *sce) : - TransformReader(conv), scene(sce), empty(NULL), mesh_importer(mesh), anim_importer(anim) { +ArmatureImporter::ArmatureImporter(UnitConverter *conv, MeshImporterBase *mesh, Scene *sce) : + TransformReader(conv), scene(sce), empty(NULL), mesh_importer(mesh) { } ArmatureImporter::~ArmatureImporter() diff --git a/source/blender/collada/ArmatureImporter.h b/source/blender/collada/ArmatureImporter.h index b07edfbf34d..2a8f1a65e21 100644 --- a/source/blender/collada/ArmatureImporter.h +++ b/source/blender/collada/ArmatureImporter.h @@ -96,7 +96,6 @@ private: std::map unskinned_armature_map; MeshImporterBase *mesh_importer; - AnimationImporterBase *anim_importer; // This is used to store data passed in write_controller_data. // Arrays from COLLADAFW::SkinControllerData lose ownership, so do this class members @@ -138,7 +137,7 @@ private: TagsMap uid_tags_map; public: - ArmatureImporter(UnitConverter *conv, MeshImporterBase *mesh, AnimationImporterBase *anim, Scene *sce); + ArmatureImporter(UnitConverter *conv, MeshImporterBase *mesh, Scene *sce); ~ArmatureImporter(); void add_joint(COLLADAFW::Node *node, bool root, Object *parent, Scene *sce); diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp index a31a1e728f6..39ed0334ae0 100644 --- a/source/blender/collada/ControllerExporter.cpp +++ b/source/blender/collada/ControllerExporter.cpp @@ -284,7 +284,7 @@ void ControllerExporter::export_skin_controller(Object *ob, Object *ob_arm) } if (oob_counter > 0) { - fprintf(stderr, "Ignored %d Vertex weigths which use index to non existing VGroup.\n", oob_counter, joint_index_by_def_index.size()); + fprintf(stderr, "Ignored %d Vertex weigths which use index to non existing VGroup %ld.\n", oob_counter, joint_index_by_def_index.size()); } } diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 2b906fa9ac2..b52a33b21e3 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -104,7 +104,7 @@ DocumentImporter::DocumentImporter(bContext *C, const ImportSettings *import_set import_settings(import_settings), mImportStage(General), mContext(C), - armature_importer(&unit_converter, &mesh_importer, &anim_importer, CTX_data_scene(C)), + armature_importer(&unit_converter, &mesh_importer, CTX_data_scene(C)), mesh_importer(&unit_converter, &armature_importer, CTX_data_scene(C)), anim_importer(&unit_converter, &armature_importer, CTX_data_scene(C)) { diff --git a/source/blender/collada/TransformReader.cpp b/source/blender/collada/TransformReader.cpp index 67166d819a6..e0ba77e2554 100644 --- a/source/blender/collada/TransformReader.cpp +++ b/source/blender/collada/TransformReader.cpp @@ -46,30 +46,28 @@ void TransformReader::get_node_mat(float mat[4][4], COLLADAFW::Node *node, std:: COLLADAFW::Transformation *tm = node->getTransformations()[i]; COLLADAFW::Transformation::TransformationType type = tm->getTransformationType(); - if (type == COLLADAFW::Transformation::MATRIX) { - // XXX why does this return and discard all following transformations? - dae_matrix_to_mat4(tm, mat); - return; - } - else { - switch (type) { - case COLLADAFW::Transformation::TRANSLATE: - dae_translate_to_mat4(tm, cur); - break; - case COLLADAFW::Transformation::ROTATE: - dae_rotate_to_mat4(tm, cur); - break; - case COLLADAFW::Transformation::SCALE: - dae_scale_to_mat4(tm, cur); - break; - case COLLADAFW::Transformation::LOOKAT: - case COLLADAFW::Transformation::SKEW: - fprintf(stderr, "LOOKAT and SKEW transformations are not supported yet.\n"); - break; - } - copy_m4_m4(copy, mat); - mult_m4_m4m4(mat, copy, cur); + switch (type) { + case COLLADAFW::Transformation::MATRIX: + // XXX why does this return and discard all following transformations? + dae_matrix_to_mat4(tm, mat); + return; + case COLLADAFW::Transformation::TRANSLATE: + dae_translate_to_mat4(tm, cur); + break; + case COLLADAFW::Transformation::ROTATE: + dae_rotate_to_mat4(tm, cur); + break; + case COLLADAFW::Transformation::SCALE: + dae_scale_to_mat4(tm, cur); + break; + case COLLADAFW::Transformation::LOOKAT: + case COLLADAFW::Transformation::SKEW: + fprintf(stderr, "LOOKAT and SKEW transformations are not supported yet.\n"); + break; } + + copy_m4_m4(copy, mat); + mult_m4_m4m4(mat, copy, cur); if (animation_map) { // AnimationList that drives this Transformation diff --git a/source/blender/compositor/operations/COM_TranslateOperation.h b/source/blender/compositor/operations/COM_TranslateOperation.h index d53c3e464fc..a638ae7ce69 100644 --- a/source/blender/compositor/operations/COM_TranslateOperation.h +++ b/source/blender/compositor/operations/COM_TranslateOperation.h @@ -33,8 +33,6 @@ private: float m_deltaX; float m_deltaY; bool m_isDeltaSet; - float m_relativeOffsetX; - float m_relativeOffsetY; float m_factorX; float m_factorY; public: diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index c828e8c8651..406756f4197 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -567,6 +567,8 @@ static SculptUndoNode *sculpt_undo_alloc_node(Object *ob, PBVHNode *node, unode->totvert = totvert; } + else + maxgrid = 0; /* we will use this while sculpting, is mapalloc slow to access then? */ diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c index 5c2dc0c7df9..37070c7e2bf 100644 --- a/source/blender/imbuf/intern/filetype.c +++ b/source/blender/imbuf/intern/filetype.c @@ -26,6 +26,9 @@ #include + +#include "BLI_utildefines.h" + #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" #include "IMB_filetype.h" @@ -56,7 +59,7 @@ static int imb_ftype_iris(ImFileType *type, ImBuf *ibuf) return (ibuf->ftype == IMAGIC); } #ifdef WITH_QUICKTIME -static int imb_ftype_quicktime(ImFileType *type, ImBuf *ibuf) +static int imb_ftype_quicktime(ImFileType *UNUSED(type), ImBuf *UNUSED(ibuf)) { return 0; /* XXX */ } diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index 682f54481fc..54ec07c1855 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -101,10 +101,12 @@ typedef struct Image { float lastupdate; int lastused; short animspeed; + short pad2; /* for generated images */ - short gen_x, gen_y; + int gen_x, gen_y; char gen_type, gen_flag; + char gen_pad[2]; /* display aspect - for UV editing images resized for faster openGL display */ float aspx, aspy; diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 7b6fb30d692..7621ebb70b3 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -277,6 +277,9 @@ add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC}) target_link_libraries(makesrna bf_dna) target_link_libraries(makesrna bf_dna_blenlib) +# too many warnings with clang +remove_cc_flag("-Wmissing-prototypes") + # Output rna_*_gen.c # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes add_custom_command( diff --git a/source/blender/modifiers/intern/MOD_meshcache.c b/source/blender/modifiers/intern/MOD_meshcache.c index 5e702a4eabc..be7bfae22fb 100644 --- a/source/blender/modifiers/intern/MOD_meshcache.c +++ b/source/blender/modifiers/intern/MOD_meshcache.c @@ -251,7 +251,7 @@ static void meshcache_do( /* -------------------------------------------------------------------- */ /* Apply the transformation matrix (if needed) */ if (UNLIKELY(err_str)) { - modifier_setError(&mcmd->modifier, err_str); + modifier_setError(&mcmd->modifier, "%s", err_str); } else if (ok) { bool use_matrix = false; diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index eb81e7f2049..59debbdc41b 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -159,7 +159,8 @@ if(WITH_GAMEENGINE) endif() if(APPLE) - if(CMAKE_OSX_ARCHITECTURES MATCHES "i386" OR CMAKE_OSX_ARCHITECTURES MATCHES "x86_64") + # SSE math is enabled by default on x86_64 + if(CMAKE_OSX_ARCHITECTURES MATCHES "i386") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mfpmath=sse") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mfpmath=sse") endif() diff --git a/source/blender/render/intern/raytrace/reorganize.h b/source/blender/render/intern/raytrace/reorganize.h index 9d9711eee56..5624df25267 100644 --- a/source/blender/render/intern/raytrace/reorganize.h +++ b/source/blender/render/intern/raytrace/reorganize.h @@ -80,7 +80,6 @@ void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair void reorganize(Node *root) { @@ -109,8 +108,6 @@ void reorganize(Node *root) tmp->sibling = best.second->child; best.second->child = tmp; - - tot_moves++; } diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index e78b996391e..450ae1a16b5 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -183,7 +183,7 @@ static int BL_KetsjiNextFrame(KX_KetsjiEngine *ketsjiengine, bContext *C, wmWind } struct BL_KetsjiNextFrameState { - struct KX_KetsjiEngine* ketsjiengine; + class KX_KetsjiEngine* ketsjiengine; struct bContext *C; struct wmWindow* win; struct Scene* scene; diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index dce62ad189a..8e729ffd7ae 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -81,7 +81,7 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex ) return NULL; #else /* WITH_SDL */ if (joyindex < 0 || joyindex >= JOYINDEX_MAX) { - ECHO("Error-invalid joystick index: " << joyindex); + JOYSTICK_ECHO("Error-invalid joystick index: " << joyindex); return NULL; } @@ -96,7 +96,7 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex ) # else if (SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO) == -1 ) { # endif - ECHO("Error-Initializing-SDL: " << SDL_GetError()); + JOYSTICK_ECHO("Error-Initializing-SDL: " << SDL_GetError()); return NULL; } @@ -242,7 +242,7 @@ bool SCA_Joystick::CreateJoystickDevice(void) if (m_isinit == false) { if (m_joyindex>=m_joynum) { /* don't print a message, because this is done anyway */ - //ECHO("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)"); + //JOYSTICK_ECHO("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)"); /* Need this so python args can return empty lists */ m_axismax = m_buttonmax = m_hatmax = 0; @@ -253,7 +253,7 @@ bool SCA_Joystick::CreateJoystickDevice(void) SDL_JoystickEventState(SDL_ENABLE); m_isinit = true; - ECHO("Joystick " << m_joyindex << " initialized"); + JOYSTICK_ECHO("Joystick " << m_joyindex << " initialized"); /* must run after being initialized */ m_axismax = SDL_JoystickNumAxes(m_private->m_joystick); @@ -279,7 +279,7 @@ void SCA_Joystick::DestroyJoystickDevice(void) #ifdef WITH_SDL if (m_isinit) { if (SDL_JoystickOpened(m_joyindex)) { - ECHO("Closing-joystick " << m_joyindex); + JOYSTICK_ECHO("Closing-joystick " << m_joyindex); SDL_JoystickClose(m_private->m_joystick); } m_isinit = false; diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h index 148bdd0962e..37c867ef7d6 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h @@ -37,10 +37,10 @@ #endif #ifndef _DEBUG -# define ECHO(x) +# define JOYSTICK_ECHO(x) #else # include -# define ECHO(x) std::cout << x << std::endl; +# define JOYSTICK_ECHO(x) std::cout << x << std::endl; #endif #define JOYINDEX_MAX 8 diff --git a/source/gameengine/Ketsji/KX_IpoConvert.h b/source/gameengine/Ketsji/KX_IpoConvert.h index 1f4e1bea96d..a653e4e110b 100644 --- a/source/gameengine/Ketsji/KX_IpoConvert.h +++ b/source/gameengine/Ketsji/KX_IpoConvert.h @@ -59,7 +59,7 @@ SG_Controller *BL_CreateCameraIPO(bAction *action, SG_Controller *BL_CreateMaterialIpo( bAction *action, - class Material* blendermaterial, + struct Material* blendermaterial, dword matname_hash, KX_GameObject* gameobj, KX_BlenderSceneConverter *converter); -- cgit v1.2.3