bugfix [#24518] Blender wont compile with -Wall -Werror and COLLADA support

fix included in report from Martijn Berger (mberger)
made some small changes.

- use ints rather then unsigned long for printing, values are not likely to be very large.
- CMake remove strict flags from collada build dir since I had warnings in the collada headers.
- added xml2 to collada libraries else I couldnt get collada building.
This commit is contained in:
Campbell Barton
2010-11-03 22:44:39 +00:00
parent ce3b49742d
commit dba1904f65
8 changed files with 16 additions and 14 deletions

View File

@@ -287,7 +287,7 @@ IF(UNIX AND NOT APPLE)
IF (WITH_OPENCOLLADA)
SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer)
SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer xml2)
SET(OPENCOLLADA_INC ${OPENCOLLADA})
SET(PCRE /usr CACHE FILEPATH "PCRE Directory")
SET(PCRE_LIBPATH ${PCRE}/lib)

View File

@@ -8196,7 +8196,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
if(sce->r.mode & R_PANORAMA) {
/* all these checks to ensure saved files with cvs version keep working... */
/* all these checks to ensure saved files with svn version keep working... */
if(sce->r.xsch < sce->r.ysch) {
Object *obc= newlibadr(fd, lib, sce->camera);
if(obc && obc->type==OB_CAMERA) {

View File

@@ -131,7 +131,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
}
break;
default:
fprintf(stderr, "Output dimension of %d is not yet supported (animation id = %s)\n", dim, curve->getOriginalId().c_str());
fprintf(stderr, "Output dimension of %d is not yet supported (animation id = %s)\n", (int)dim, curve->getOriginalId().c_str());
}
for (std::vector<FCurve*>::iterator it = fcurves.begin(); it != fcurves.end(); it++)
@@ -221,7 +221,7 @@ AnimationImporter::~AnimationImporter()
free_fcurve(*it);
if (unused_curves.size())
fprintf(stderr, "removed %u unused curves\n", unused_curves.size());
fprintf(stderr, "removed %d unused curves\n", (int)unused_curves.size());
}
bool AnimationImporter::write_animation(const COLLADAFW::Animation* anim)
@@ -564,7 +564,7 @@ Object *AnimationImporter::translate_animation(COLLADAFW::Node *node,
}
}
else {
fprintf(stderr, "expected %d curves, got %u\n", xyz ? 3 : 1, curves.size());
fprintf(stderr, "expected %d curves, got %d\n", xyz ? 3 : 1, (int)curves.size());
}
}
}
@@ -902,7 +902,7 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float
if (type == COLLADAFW::Transformation::ROTATE) {
if (curves.size() != 1) {
fprintf(stderr, "expected 1 curve, got %u\n", curves.size());
fprintf(stderr, "expected 1 curve, got %d\n", (int)curves.size());
return false;
}
@@ -924,9 +924,9 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float
if ((!is_xyz && curves.size() != 1) || (is_xyz && curves.size() != 3)) {
if (is_xyz)
fprintf(stderr, "%s: expected 3 curves, got %u\n", path, curves.size());
fprintf(stderr, "%s: expected 3 curves, got %d\n", path, (int)curves.size());
else
fprintf(stderr, "%s: expected 1 curve, got %u\n", path, curves.size());
fprintf(stderr, "%s: expected 1 curve, got %d\n", path, (int)curves.size());
return false;
}
@@ -953,7 +953,7 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float
else if (type == COLLADAFW::Transformation::MATRIX) {
// for now, of matrix animation, support only the case when all values are packed into one animation
if (curves.size() != 16) {
fprintf(stderr, "%s: expected 16 curves, got %u\n", path, curves.size());
fprintf(stderr, "%s: expected 16 curves, got %d\n", path, (int)curves.size());
return false;
}

View File

@@ -24,6 +24,8 @@
#
# ***** END GPL LICENSE BLOCK *****
REMOVE_STRICT_FLAGS()
SET(INC
.
../blenlib

View File

@@ -904,7 +904,7 @@ protected:
void DocumentExporter::exportCurrentScene(Scene *sce, const char* filename)
{
PointerRNA sceneptr, unit_settings;
PropertyRNA *system, *scale;
PropertyRNA *system; /* unused , *scale; */
clear_global_id_map();

View File

@@ -219,7 +219,7 @@ public:
if (libnode_ob.size()) {
Scene *sce = CTX_data_scene(mContext);
fprintf(stderr, "got %u library nodes to free\n", libnode_ob.size());
fprintf(stderr, "got %d library nodes to free\n", (int)libnode_ob.size());
// free all library_nodes
std::vector<Object*>::iterator it;
for (it = libnode_ob.begin(); it != libnode_ob.end(); it++) {

View File

@@ -72,6 +72,8 @@ class MeshImporter : public MeshImporterBase
{
private:
UnitConverter *unitconverter;
Scene *scene;
ArmatureImporter *armature_importer;
@@ -120,8 +122,6 @@ private:
bool flat_face(unsigned int *nind, COLLADAFW::MeshVertexData& nor, int count);
UnitConverter *unitconverter;
public:
MeshImporter(UnitConverter *unitconv, ArmatureImporter *arm, Scene *sce);

View File

@@ -1920,7 +1920,7 @@ static void WM_OT_save_mainfile(wmOperatorType *ot)
#include "../../collada/collada.h"
static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
if(!RNA_property_is_set(op->ptr, "filepath")) {
char filepath[FILE_MAX];