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 0ce8e27..e2f06d7 100644 (file)
 
 set(INC
        .
-       ../../../Eigen3
        include
        internal
        ../gflags
 )
 
 set(INC_SYS
+       ../../../Eigen3
 )
 
 set(SRC
index caa1ea0..da5e10f 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 f4bc032..ab2ed6d 100644 (file)
 # ***** END GPL LICENSE BLOCK *****
 
 set(INC
-       ../../extern/Eigen3
+
 )
 
 set(INC_SYS
-       
+       ../../extern/Eigen3
 )
 
 set(SRC
index 11f173a..3b8a4c0 100644 (file)
 set(INC
        intern
        ../memutil
-       ../../extern/bullet2/src
 )
 
 set(INC_SYS
+       ../../extern/bullet2/src
        ${PNG_INCLUDE_DIR}
        ${ZLIB_INCLUDE_DIRS}
 )
index 2a1ff49..f24b586 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 903267c..0a0e0e6 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 fa0994d..a053e06 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 0b41cce..1afa5d3 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 bbec7e0..244394a 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 e588d1d..8f5547c 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 da73d7a..ed97b9f 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 5cea410..7bee55b 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 eafed84..22f6297 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 c175c1e..2dc6e30 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 1826f1a..309017e 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 7221258..1e1bc73 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 436bdb5..34a1117 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 269311b..b42c2c2 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 cdae3cc..43b1bfe 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 c50aa28..21d2e6d 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 ||