code cleanup: warnings
authorCampbell Barton <ideasman42@gmail.com>
Tue, 18 Sep 2012 03:15:12 +0000 (03:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 18 Sep 2012 03:15:12 +0000 (03:15 +0000)
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/editors/mask/mask_add.c
source/blender/editors/mesh/meshtools.c
source/blender/render/intern/raytrace/rayobject_vbvh.cpp

index e75ecfb641e7e3c38b8c59e8aed1f9ccbc4a95de..232bea6749b5e97b1ed11c43a4dfbbfcbd8a516d 100644 (file)
@@ -983,8 +983,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                
                default: {
 #ifdef WITH_X11_XINPUT
-                       if (xe->type == window->GetXTablet().MotionEvent)
-                       {
+                       if (xe->type == window->GetXTablet().MotionEvent) {
                                XDeviceMotionEvent *data = (XDeviceMotionEvent *)xe;
 
                                /* stroke might begin without leading ProxyIn event,
@@ -993,23 +992,23 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                                setTabletMode(window, data->deviceid);
 
                                window->GetXTablet().CommonData.Pressure =
-                                   data->axis_data[2] / ((float)window->GetXTablet().PressureLevels);
-                       
+                                       data->axis_data[2] / ((float)window->GetXTablet().PressureLevels);
+
                                /* the (short) cast and the &0xffff is bizarre and unexplained anywhere,
                                 * but I got garbage data without it. Found it in the xidump.c source --matt */
                                window->GetXTablet().CommonData.Xtilt =
-                                   (short)(data->axis_data[3] & 0xffff) / ((float)window->GetXTablet().XtiltLevels);
+                                       (short)(data->axis_data[3] & 0xffff) / ((float)window->GetXTablet().XtiltLevels);
                                window->GetXTablet().CommonData.Ytilt =
-                                   (short)(data->axis_data[4] & 0xffff) / ((float)window->GetXTablet().YtiltLevels);
+                                       (short)(data->axis_data[4] & 0xffff) / ((float)window->GetXTablet().YtiltLevels);
                        }
-                       else if (xe->type == window->GetXTablet().ProxInEvent)
-                       {
+                       else if (xe->type == window->GetXTablet().ProxInEvent) {
                                XProximityNotifyEvent *data = (XProximityNotifyEvent *)xe;
 
                                setTabletMode(window, data->deviceid);
                        }
-                       else if (xe->type == window->GetXTablet().ProxOutEvent)
+                       else if (xe->type == window->GetXTablet().ProxOutEvent) {
                                window->GetXTablet().CommonData.Active = GHOST_kTabletModeNone;
+                       }
 #endif // WITH_X11_XINPUT
                        break;
                }
index 92bffe46357d5cd889fee7c4e741cf78cc347ff3..bc556490d12400b6c979e6c94506f6701c2d690e 100644 (file)
@@ -210,8 +210,8 @@ public:
 
 #if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
        XIM
-       getX11_XIM(
-               ) {
+       getX11_XIM()
+       {
                return m_xim;
        }
 #endif
@@ -235,7 +235,7 @@ public:
         */
        void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
 
-#if WITH_XDND
+#ifdef WITH_XDND
        /**
         * Creates a drag'n'drop event and pushes it immediately onto the event queue. 
         * Called by GHOST_DropTargetX11 class.
index 4e3096d03254b3e607b773646a8a99fc4db36fd8..a44b5e7691bcf0e251c7b75f2a95783b11d6e390 100644 (file)
@@ -1772,7 +1772,6 @@ static void give_parvert(Object *par, int nr, float vec[3])
        if (par->type == OB_MESH) {
                Mesh *me = par->data;
                DerivedMesh *dm;
-               int count;
 
                em = me->edit_btmesh;
 
@@ -1795,6 +1794,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
                dm = (em) ? em->derivedFinal : par->derivedFinal;
                        
                if (dm) {
+                       int count = 0;
                        int numVerts = dm->getNumVerts(dm);
 
                        if (nr < numVerts) {
@@ -1803,7 +1803,6 @@ static void give_parvert(Object *par, int nr, float vec[3])
                                int i;
 
                                /* get the average of all verts with (original index == nr) */
-                               count = 0;
                                if (index) {
                                        for (i = 0; i < numVerts; i++) {
                                                if (index[i] == nr) {
index 26952db8fba456bdab5cc3e4d6d9d5ab218277e1..ef03db7ed8fbbf337ac0b217936557ca660c94eb 100644 (file)
@@ -4539,8 +4539,8 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
        /* can happen with bad pointcache or physics calculation
         * since this becomes geometry, nan's and inf's crash raytrace code.
         * better not allow this. */
-       if (!finite(bb->vec[0]) || !finite(bb->vec[1]) || !finite(bb->vec[2]) ||
-           !finite(bb->vel[0]) || !finite(bb->vel[1]) || !finite(bb->vel[2]) )
+       if ((!finite(bb->vec[0])) || (!finite(bb->vec[1])) || (!finite(bb->vec[2])) ||
+           (!finite(bb->vel[0])) || (!finite(bb->vel[1])) || (!finite(bb->vel[2])) )
        {
                zero_v3(bb->vec);
                zero_v3(bb->vel);
index 7fe1ac09df652e411881ae834c7d15c57f1f3f35..a254a6a9278a18f085ae3c1a8816eb4017adb636 100644 (file)
@@ -64,7 +64,7 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
        MaskLayer *masklay, *point_masklay;
        MaskSpline *point_spline;
        MaskSplinePoint *point = NULL;
-       float dist, co[2];
+       float dist = FLT_MAX, co[2];
        int width, height;
        float u;
        float scalex, scaley;
@@ -125,7 +125,7 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
 
                                                cur_dist = dist_to_line_segment_v2(co, a, b);
 
-                                               if (point == NULL || cur_dist < dist) {
+                                               if (cur_dist < dist) {
                                                        if (tangent)
                                                                sub_v2_v2v2(tangent, &diff_points[2 * i + 2], &diff_points[2 * i]);
 
index a7467ee4c79a5c07329f62ce8fa4a2f0ebfb10a4..aa09572b2a791940b32bc778ede7d4332a674abe 100644 (file)
@@ -709,9 +709,9 @@ static void mesh_octree_add_nodes(MocNode **basetable, const float co[3], const
        float fx, fy, fz;
        int vx, vy, vz;
        
-       if (!finite(co[0]) ||
-           !finite(co[1]) ||
-           !finite(co[2]))
+       if ((finite(co[0]) == FALSE) ||
+           (finite(co[1]) == FALSE) ||
+           (finite(co[2]) == FALSE))
        {
                return;
        }
@@ -940,9 +940,9 @@ static BMVert *editbmesh_get_x_mirror_vert_spatial(Object *ob, BMEditMesh *em, c
        intptr_t poinval;
        
        /* ignore nan verts */
-       if (!finite(co[0]) ||
-           !finite(co[1]) ||
-           !finite(co[2]))
+       if ((finite(co[0]) == FALSE) ||
+           (finite(co[1]) == FALSE) ||
+           (finite(co[2]) == FALSE))
        {
                return NULL;
        }
index d6ae602d3e9c41604769abf590c4ccb027136eae..85c9d0d402fe061879bc038015b43545878f5691 100644 (file)
@@ -152,6 +152,7 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(m
        }
 }
 
+#if 0  /* UNUSED */
 static void bfree(VBVHTree *tree)
 {
        if (tot_pushup + tot_pushdown + tot_hints + tot_moves) {
@@ -169,6 +170,7 @@ static void bfree(VBVHTree *tree)
        }
        bvh_free(tree);
 }
+#endif
 
 /* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */
 template<class Tree, int STACK_SIZE>