code cleanup: remove redundant casts
authorCampbell Barton <ideasman42@gmail.com>
Sun, 14 Oct 2012 08:49:01 +0000 (08:49 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 14 Oct 2012 08:49:01 +0000 (08:49 +0000)
20 files changed:
extern/libmv/third_party/ceres/CMakeLists.txt
intern/dualcon/CMakeLists.txt
intern/itasc/CMakeLists.txt
intern/smoke/CMakeLists.txt
source/blender/blenkernel/CMakeLists.txt
source/blender/ikplugin/CMakeLists.txt
source/gameengine/BlenderRoutines/CMakeLists.txt
source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
source/gameengine/Converter/BL_ArmatureChannel.cpp
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_MeshDeformer.h
source/gameengine/Converter/BL_ModifierDeformer.cpp
source/gameengine/Converter/BL_SkinDeformer.cpp
source/gameengine/Converter/CMakeLists.txt
source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.h
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Physics/Bullet/CMakeLists.txt
source/gameengine/Rasterizer/RAS_MeshObject.cpp

index 0ce8e273f4a063369d714c4d519abd212a94cd6c..e2f06d746460ac607847b2368c3894008d3a1aa8 100644 (file)
 
 set(INC
        .
-       ../../../Eigen3
        include
        internal
        ../gflags
 )
 
 set(INC_SYS
+       ../../../Eigen3
 )
 
 set(SRC
index caa1ea09b04b36a2f35e74ffeb47d76c3362273c..da5e10fe6a7e4a1afadc769e15669dbcc98ca8c8 100644 (file)
@@ -19,6 +19,9 @@
 set(INC
        .
        intern
+)
+
+set(INC_SYS
        ../../extern/Eigen3
 )
 
@@ -42,5 +45,5 @@ set(SRC
        dualcon.h
 )
 
-blender_add_lib(bf_intern_dualcon "${SRC}" "${INC}" "")
+blender_add_lib(bf_intern_dualcon "${SRC}" "${INC}" "${INC_SYS}")
 
index f4bc0326ea1c79b931b7b969eae0b819da7c367b..ab2ed6d10eba2176ec99ec1caa97d64f62163be6 100644 (file)
 # ***** END GPL LICENSE BLOCK *****
 
 set(INC
-       ../../extern/Eigen3
+
 )
 
 set(INC_SYS
-       
+       ../../extern/Eigen3
 )
 
 set(SRC
index 11f173a6835806e4625196f2bb2267c5a7b5084b..3b8a4c06e69bb256a651a31a645d240135f55ee2 100644 (file)
 set(INC
        intern
        ../memutil
-       ../../extern/bullet2/src
 )
 
 set(INC_SYS
+       ../../extern/bullet2/src
        ${PNG_INCLUDE_DIR}
        ${ZLIB_INCLUDE_DIRS}
 )
index 2a1ff49881f759a8d5dfcd480b39b19311c75a2d..f24b58658f6eaba2a2b4922445e1f880a506e91b 100644 (file)
@@ -249,7 +249,7 @@ if(WITH_AUDASPACE)
 endif()
 
 if(WITH_BULLET)
-       list(APPEND INC
+       list(APPEND INC_SYS
                ../../../extern/bullet2/src
        )
        add_definitions(-DUSE_BULLET)
index 903267c561805e6eac2abc1c196907e3d97f3a53..0a0e0e664b4b4cbc67c5d51d0334917537ef279e 100644 (file)
@@ -56,9 +56,11 @@ endif()
 if(WITH_IK_ITASC)
        add_definitions(-DWITH_IK_ITASC)
        list(APPEND INC
-               ../../../extern/Eigen3
                ../../../intern/itasc
        )
+       list(APPEND INC_SYS
+               ../../../extern/Eigen3
+       )
        list(APPEND SRC
                intern/itasc_plugin.cpp
                intern/itasc_plugin.h
index fa0994d788a10d1239e92f4a919a5d9ddc0e301e..a053e069153212db8f728266fd0d6cd4aece848d 100644 (file)
@@ -23,7 +23,6 @@ set(INC
        ../../blender/makesdna
        ../../blender/makesrna
        ../../blender/windowmanager
-       ../../../extern/bullet2/src
        ../../../intern/container
        ../../../intern/guardedalloc
        ../../../intern/moto/include
@@ -31,6 +30,7 @@ set(INC
 )
 
 set(INC_SYS
+       ../../../extern/bullet2/src
        ${PTHREADS_INCLUDE_DIRS}
        ${GLEW_INCLUDE_PATH}
 )
index 0b41cceb646092586cbb3bf7afd6b0d8bc9bbcdb..1afa5d3d07b6c68dc9479167f40dc0baa147d9f5 100644 (file)
@@ -119,14 +119,14 @@ int KX_BlenderCanvas::GetHeight(
 
 int KX_BlenderCanvas::GetMouseX(int x)
 {
-       float left = GetWindowArea().GetLeft();
-       return float(x - (left - m_area_left));
+       int left = GetWindowArea().GetLeft();
+       return x - (left - m_area_left);
 }
 
 int KX_BlenderCanvas::GetMouseY(int y)
 {
-       float top = GetWindowArea().GetTop();
-       return float(y - (m_area_top - top));
+       int top = GetWindowArea().GetTop();
+       return y - (m_area_top - top);
 }
 
 float KX_BlenderCanvas::GetMouseNormalizedX(int x)
index bbec7e0fadaa3e6a2b344dbab9a49ec53eebae8a..244394a115d4082ea1b4379a2555669acc52c947 100644 (file)
@@ -192,8 +192,8 @@ private:
        struct wmWindow* m_win;
        RAS_Rect        m_frame_rect;
        RAS_Rect        m_area_rect;
-       short           m_area_left;
-       short           m_area_top;
+       int                     m_area_left;
+       int                     m_area_top;
 
 
 #ifdef WITH_CXX_GUARDEDALLOC
index e588d1d310c6b40466a3b124ea9e6946f01d9191..8f5547c337c9c3852e4688daeca73156281c3338 100644 (file)
@@ -455,12 +455,12 @@ PyObject *BL_ArmatureBone::py_bone_get_children(void *self, const struct KX_PYAT
        Bone* bone = reinterpret_cast<Bone*>(self);
        Bone* child;
        int count = 0;
-       for (child=(Bone*)bone->childbase.first; child; child=(Bone*)child->next)
+       for (child = (Bone *)bone->childbase.first; child; child = child->next)
                count++;
 
        PyObject *childrenlist = PyList_New(count);
 
-       for (count = 0, child=(Bone*)bone->childbase.first; child; child=(Bone*)child->next, ++count)
+       for (count = 0, child = (Bone *)bone->childbase.first; child; child = child->next, ++count)
                PyList_SET_ITEM(childrenlist,count,NewProxyPlus_Ext(NULL,&Type,child,false));
 
        return childrenlist;
index da73d7a762a6a62dec9e058a5173f2246b21734f..ed97b9ff73ffae8a8d94e83550532f361a9b64a9 100644 (file)
@@ -105,7 +105,7 @@ void game_copy_pose(bPose **dst, bPose *src, int copy_constraint)
        for (; pchan; pchan=pchan->next, outpchan=outpchan->next)
                BLI_ghash_insert(ghash, pchan, outpchan);
 
-       for (pchan=(bPoseChannel*)out->chanbase.first; pchan; pchan=(bPoseChannel*)pchan->next) {
+       for (pchan = (bPoseChannel*)out->chanbase.first; pchan; pchan = pchan->next) {
                pchan->parent= (bPoseChannel*)BLI_ghash_lookup(ghash, pchan->parent);
                pchan->child= (bPoseChannel*)BLI_ghash_lookup(ghash, pchan->child);
 
@@ -186,7 +186,10 @@ void game_blend_poses(bPose *dst, bPose *src, float srcweight/*, short mode*/)
                        if (schan->rotmode)
                                dchan->eul[i] = (dchan->eul[i]*dstweight) + (schan->eul[i]*srcweight);
                }
-               for (dcon= (bConstraint*)dchan->constraints.first, scon= (bConstraint*)schan->constraints.first; dcon && scon; dcon= (bConstraint*)dcon->next, scon= (bConstraint*)scon->next) {
+               for (dcon= (bConstraint *)dchan->constraints.first, scon= (bConstraint *)schan->constraints.first;
+                    dcon && scon;
+                    dcon = dcon->next, scon = scon->next)
+               {
                        /* no 'add' option for constraint blending */
                        dcon->enforce= dcon->enforce*(1.0f-srcweight) + scon->enforce*srcweight;
                }
@@ -282,8 +285,8 @@ void BL_ArmatureObject::LoadConstraints(KX_BlenderSceneConverter* converter)
        KX_GameObject* gamesubtarget;
 
        // and locate the constraint
-       for (pchan = (bPoseChannel*)m_pose->chanbase.first; pchan; pchan=(bPoseChannel*)pchan->next) {
-               for (pcon = (bConstraint*)pchan->constraints.first; pcon; pcon=(bConstraint*)pcon->next) {
+       for (pchan = (bPoseChannel *)m_pose->chanbase.first; pchan; pchan = pchan->next) {
+               for (pcon = (bConstraint *)pchan->constraints.first; pcon; pcon = pcon->next) {
                        if (pcon->flag & CONSTRAINT_DISABLE)
                                continue;
                        // which constraint should we support?
@@ -315,7 +318,7 @@ void BL_ArmatureObject::LoadConstraints(KX_BlenderSceneConverter* converter)
                                                }
                                                if (target->next != NULL) {
                                                        // secondary target
-                                                       target = (bConstraintTarget*)target->next;
+                                                       target = target->next;
                                                        if (target->tar && target->tar != m_objArma) {
                                                                // only track external object
                                                                blendtarget = target->tar;
index 5cea4100b3f5e288ecac8fd7c1550258a6cd822b..7bee55bd1194feadeef28e052c6e5e20b35fe9e9 100644 (file)
@@ -70,7 +70,7 @@ public:
        virtual RAS_Deformer*   GetReplica() {return NULL;}
        virtual void ProcessReplica();
        struct Mesh* GetMesh() { return m_bmesh; }
-       virtual class RAS_MeshObject* GetRasMesh() { return (RAS_MeshObject*)m_pMeshObject; }
+       virtual class RAS_MeshObject* GetRasMesh() { return m_pMeshObject; }
        virtual float (* GetTransVerts(int *tot))[3]    {       *tot= m_tvtot; return m_transverts; }
        //      virtual void InitDeform(double time) {}
 
index eafed8497ba497168227855f78a22daa9d308833..22f62975f2c22482558e52b1293567a9ca3a0ea2 100644 (file)
@@ -113,7 +113,7 @@ bool BL_ModifierDeformer::HasCompatibleDeformer(Object *ob)
        if ((ob->gameflag & OB_SOFT_BODY) != 0)
                return false;
        ModifierData* md;
-       for (md = (ModifierData*)ob->modifiers.first; md; md = (ModifierData*)md->next) {
+       for (md = (ModifierData *)ob->modifiers.first; md; md = md->next) {
                if (modifier_dependsOnTime(md))
                        continue;
                if (!(md->mode & eModifierMode_Realtime))
index c175c1e3b7b1c87676929a6600c05326a834ff19..2dc6e302f4f34bad30051cfc8ce0d19c25c79ebf 100644 (file)
@@ -72,7 +72,7 @@ static short get_deformflags(struct Object *bmeshobj)
        short flags = ARM_DEF_VGROUP;
 
        ModifierData *md;
-       for (md = (ModifierData*)bmeshobj->modifiers.first; md; md = (ModifierData*)md->next)
+       for (md = (ModifierData *)bmeshobj->modifiers.first; md; md = md->next)
        {
                if (md->type == eModifierType_Armature)
                {
@@ -249,7 +249,7 @@ void BL_SkinDeformer::BGEDeformVerts()
                int i;
                for (i=0, dg=(bDeformGroup*)m_objMesh->defbase.first;
                        dg;
-                       ++i, dg=(bDeformGroup*)dg->next)
+                       ++i, dg = dg->next)
                {
                        m_dfnrToPC[i] = BKE_pose_channel_find_name(par_arma->pose, dg->name);
 
index 1826f1ad25b914bf824e2269278277d521c70d78..309017e84b1b44b5604d457ea3cab01d08f73132 100644 (file)
@@ -49,8 +49,6 @@ set(INC
        ../../blender/makesdna
        ../../blender/makesrna
        ../../blender/windowmanager
-       ../../../extern/bullet2/src
-       ../../../extern/Eigen3
        ../../../intern/container
        ../../../intern/guardedalloc
        ../../../intern/moto/include
@@ -59,6 +57,7 @@ set(INC
 )
 
 set(INC_SYS
+       ../../../extern/Eigen3
        ${PTHREADS_INCLUDE_DIRS}
 
 )
@@ -110,6 +109,9 @@ set(SRC
 )
 
 if(WITH_BULLET)
+       list(APPEND INC_SYS
+               ../../../extern/bullet2/src
+       )
        add_definitions(-DUSE_BULLET)
 endif()
 
index 72212581d4b0c6a2d264249b50531449480d66a9..1e1bc73830120248b2906792bc673f53ff34b615 100644 (file)
@@ -52,7 +52,7 @@ BL_InterpolatorList::BL_InterpolatorList(bAction *action)
        if (action==NULL)
                return;
        
-       for (FCurve *fcu= (FCurve *)action->curves.first; fcu; fcu= (FCurve *)fcu->next) {
+       for (FCurve *fcu = (FCurve *)action->curves.first; fcu; fcu = fcu->next) {
                if (fcu->rna_path) {
                        BL_ScalarInterpolator *new_ipo = new BL_ScalarInterpolator(fcu); 
                        //assert(new_ipo);
index 436bdb555c96521fc7112c3f8b951ccb0515694d..34a1117a0ebec85669ac1aab3288a3f806871879 100644 (file)
@@ -165,11 +165,11 @@ public:
                printf("\t m_materials: %d\n", (int)m_materials.size());
 
                printf("\nMappings...\n");
-               printf("\t m_map_blender_to_gameobject: %d\n", (int)m_map_blender_to_gameobject.size());
-               printf("\t m_map_mesh_to_gamemesh: %d\n", (int)m_map_mesh_to_gamemesh.size());
-               printf("\t m_map_blender_to_gameactuator: %d\n", (int)m_map_blender_to_gameactuator.size());
-               printf("\t m_map_blender_to_gamecontroller: %d\n", (int)m_map_blender_to_gamecontroller.size());
-               printf("\t m_map_blender_to_gameAdtList: %d\n", (int)m_map_blender_to_gameAdtList.size());
+               printf("\t m_map_blender_to_gameobject: %d\n", m_map_blender_to_gameobject.size());
+               printf("\t m_map_mesh_to_gamemesh: %d\n", m_map_mesh_to_gamemesh.size());
+               printf("\t m_map_blender_to_gameactuator: %d\n", m_map_blender_to_gameactuator.size());
+               printf("\t m_map_blender_to_gamecontroller: %d\n", m_map_blender_to_gamecontroller.size());
+               printf("\t m_map_blender_to_gameAdtList: %d\n", m_map_blender_to_gameAdtList.size());
 
 #ifdef WITH_CXX_GUARDEDALLOC
                MEM_printmemlist_pydict();
index 269311b7e00730eedbdcecbf4d782185d3916dde..b42c2c27075ef33994ceb8b31742c186fa73d2c3 100644 (file)
@@ -248,9 +248,11 @@ endif()
 
 if(WITH_BULLET)
        list(APPEND INC
-               ../../../extern/bullet2/src
                ../Physics/Bullet
        )
+       list(APPEND INC
+               ../../../extern/bullet2/src
+       )
        add_definitions(-DUSE_BULLET)
 endif()
 
index cdae3cc55268dab48dc6a7400b0a5a81cd1411f5..43b1bfe74686ef3500692b4fe224cf522f282baf 100644 (file)
@@ -37,7 +37,6 @@ set(INC
        ../../../blender/blenkernel
        ../../../blender/blenlib
        ../../../blender/makesdna
-       ../../../../extern/bullet2/src
        ../../../../intern/container
        ../../../../intern/guardedalloc
        ../../../../intern/moto/include
@@ -45,6 +44,7 @@ set(INC
 )
 
 set(INC_SYS
+       ../../../../extern/bullet2/src
        ${GLEW_INCLUDE_PATH}
        ${PYTHON_INCLUDE_DIRS}
 )
index c50aa28e9fc1758124f48d5cbd5fdb2ef4a4de44..21d2e6d5a7b3aa727f84366541aeaba02cee0586 100644 (file)
@@ -584,7 +584,7 @@ void RAS_MeshObject::CheckWeightCache(Object* obj)
        if (!m_mesh->key)
                return;
 
-       for (kbindex=0, kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next, kbindex++)
+       for (kbindex = 0, kb = (KeyBlock *)m_mesh->key->block.first; kb; kb = kb->next, kbindex++)
        {
                // first check the cases where the weight must be cleared
                if (kb->vgroup[0] == 0 ||