Fix various warnings with clang build, and adjust cmake clang warnings flags

to include a few more that gcc is using too.
This commit is contained in:
Brecht Van Lommel 2013-02-26 21:58:06 +00:00
parent 1927f44686
commit 4f3ca854e1
37 changed files with 121 additions and 106 deletions

View File

@ -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")

View File

@ -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()

View File

@ -40,6 +40,8 @@
class AUD_IDynamicIIRFilterCalculator
{
public:
virtual ~AUD_IDynamicIIRFilterCalculator() {}
/**
* Recalculates the filter coefficients.
* \param rate The sample rate of the audio data.

View File

@ -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.

View File

@ -215,7 +215,6 @@ void ntlGeometryObjModel::calcTriangleDivs(vector<ntlVec3Gfx> &verts, vector<ntl
errMsg("ntlGeometryObjModel","calcTriangleDivs special!");
mTriangleDivs1.resize( tris.size() );
mTriangleDivs2.resize( tris.size() );
mTriangleDivs3.resize( tris.size() );
for(size_t i=0; i<tris.size(); i++) {
ntlVec3Gfx p0 = verts[ tris[i].getPoints()[0] ];
ntlVec3Gfx p1 = verts[ tris[i].getPoints()[1] ];
@ -223,10 +222,9 @@ void ntlGeometryObjModel::calcTriangleDivs(vector<ntlVec3Gfx> &verts, vector<ntl
ntlVec3Gfx side1 = p1 - p0;
ntlVec3Gfx side2 = p2 - p0;
ntlVec3Gfx side3 = p1 - p2;
int divs1=0, divs2=0, divs3=0;
int divs1=0, divs2=0;
if(normNoSqrt(side1) > 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<ntlVec3Gfx> &verts, vector<ntl
p1 = sverts[s].mVerts[ tris[i].getPoints()[1] ];
p2 = sverts[s].mVerts[ tris[i].getPoints()[2] ];
side1 = p1 - p0; side2 = p2 - p0; side3 = p1 - p2;
int tdivs1=0, tdivs2=0, tdivs3=0;
int tdivs1=0, tdivs2=0;
if(normNoSqrt(side1) > 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;
}
}

View File

@ -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<ntlVec3Gfx> *verts,
void ntlGeometryObject::calcTriangleDivs(vector<ntlVec3Gfx> &verts, vector<ntlTriangle> &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<ntlVec3Gfx> &verts, vector<ntlTr
const ntlVec3Gfx p2 = verts[ tris[i].getPoints()[2] ];
const ntlVec3Gfx side1 = p1 - p0;
const ntlVec3Gfx side2 = p2 - p0;
const ntlVec3Gfx side3 = p1 - p2;
int divs1=0, divs2=0, divs3=0;
int divs1=0, divs2=0;
if(normNoSqrt(side1) > 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;
}
}

View File

@ -223,7 +223,7 @@ class ntlGeometryObject : public ntlGeometryClass
vector<ntlVec3Gfx> mCachedMovPoints;
vector<ntlVec3Gfx> mCachedMovNormals;
/*! precomputed triangle divisions */
vector<int> mTriangleDivs1,mTriangleDivs2,mTriangleDivs3;
vector<int> mTriangleDivs1,mTriangleDivs2;
/*! inited? */
float mMovPntsInited;
/*! point with max. distance from center */

View File

@ -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 )
{
}

View File

@ -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;

View File

@ -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();

View File

@ -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="<<pvolume<<" radius="<<radius<<" vn="<<velRelNorm<<" velPart="<<velPart<<" velRel"<<velRel);
errMsg("PIT","BTEST2 cellsize="<<cellsize<<" timestep="<<timestep<<" viscW="<<viscWater<<" ss/mb="<<(timestep/(pvolume*rhoAir)));

View File

@ -1773,7 +1773,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
//printf("Key down 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);
}
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;

View File

@ -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)
{

View File

@ -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(),

View File

@ -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;

View File

@ -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)
{
}

View File

@ -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);

View File

@ -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];
}
}
}

View File

@ -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

View File

@ -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 */

View File

@ -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()

View File

@ -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);

View File

@ -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());
}
}

View File

@ -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))
{

View File

@ -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

View File

@ -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:

View File

@ -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? */

View File

@ -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 */
}

View File

@ -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;

View File

@ -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(

View File

@ -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;

View File

@ -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()

View File

@ -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++;
}

View File

@ -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;

View File

@ -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;

View File

@ -37,10 +37,10 @@
#endif
#ifndef _DEBUG
# define ECHO(x)
# define JOYSTICK_ECHO(x)
#else
# include <iostream>
# define ECHO(x) std::cout << x << std::endl;
# define JOYSTICK_ECHO(x) std::cout << x << std::endl;
#endif
#define JOYINDEX_MAX 8

View File

@ -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);