diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-27 01:58:06 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-27 01:58:06 +0400 |
commit | 4f3ca854e1e25d855c7c2b8f6458edd6aae385c5 (patch) | |
tree | 60f07ffa26286fcde603977b6482a10f92a0ad11 /source/blender | |
parent | 1927f446868e71c56e8032b4693004225ee5177d (diff) |
Fix various warnings with clang build, and adjust cmake clang warnings flags
to include a few more that gcc is using too.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 8 | ||||
-rw-r--r-- | source/blender/collada/ArmatureImporter.cpp | 4 | ||||
-rw-r--r-- | source/blender/collada/ArmatureImporter.h | 3 | ||||
-rw-r--r-- | source/blender/collada/ControllerExporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/TransformReader.cpp | 44 | ||||
-rw-r--r-- | source/blender/compositor/operations/COM_TranslateOperation.h | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/filetype.c | 5 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_image_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 3 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshcache.c | 2 | ||||
-rw-r--r-- | source/blender/render/CMakeLists.txt | 3 | ||||
-rw-r--r-- | source/blender/render/intern/raytrace/reorganize.h | 3 |
14 files changed, 47 insertions, 40 deletions
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<COLLADAFW::UniqueId, Object*> 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 <stddef.h> + +#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<float, Nod } } -static int tot_moves = 0; template<class Node> void reorganize(Node *root) { @@ -109,8 +108,6 @@ void reorganize(Node *root) tmp->sibling = best.second->child; best.second->child = tmp; - - tot_moves++; } |