Cleanup: warnings
authorCampbell Barton <ideasman42@gmail.com>
Thu, 23 Apr 2015 06:09:30 +0000 (16:09 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 23 Apr 2015 06:09:30 +0000 (16:09 +1000)
source/blender/blenkernel/intern/ocean.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/transform/transform_conversions.c
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

index b89b5ab4bbc627aebe1003def85082eaedb9dd00..1a178fb2bdf912969c6a4eb877f9f5d8642fa1b6 100644 (file)
@@ -738,8 +738,8 @@ static void set_height_normalize_factor(struct Ocean *oc)
 
        for (i = 0; i < oc->_M; ++i) {
                for (j = 0; j < oc->_N; ++j) {
-                       if (max_h < fabsf(oc->_disp_y[i * oc->_N + j])) {
-                               max_h = fabsf(oc->_disp_y[i * oc->_N + j]);
+                       if (max_h < fabs(oc->_disp_y[i * oc->_N + j])) {
+                               max_h = fabs(oc->_disp_y[i * oc->_N + j]);
                        }
                }
        }
index 0be1ad66ec811e3182c4be6ee0b979613de7562e..520ad4f89b4a84b4beeca58cb89ca51c6fc93439 100644 (file)
@@ -1589,8 +1589,8 @@ unsigned int ED_view3d_backbuf_sample_rect(
                                        /* get x,y pixel coords from the offset
                                         * (manhatten distance in keeping with other screen-based selection) */
                                        *r_dist = (float)(
-                                               abs(((tbuf - buf->rect) % size) - (size / 2)) +
-                                               abs(((tbuf - buf->rect) / size) - (size / 2)));
+                                               abs(((int)(tbuf - buf->rect) % size) - (size / 2)) +
+                                               abs(((int)(tbuf - buf->rect) / size) - (size / 2)));
 
                                        /* indices start at 1 here */
                                        index = (*tbuf - min) + 1;
index 0cdc2b5eb6c1d3a5677eb364eced8888798c51fa..8aa26c3241373001abaf7f74c0440f8b90699de1 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <string.h>
 #include <math.h>
+#include <limits.h>
 
 #include "DNA_anim_types.h"
 #include "DNA_brush_types.h"
@@ -3755,13 +3756,14 @@ static void createTransActionData(bContext *C, TransInfo *t)
                                        }
                                        else {
                                                bGPDframe *gpf_iter;
-                                               float min = FLT_MAX;
+                                               int min = INT_MAX;
                                                for (gpf_iter = gpl->frames.first; gpf_iter; gpf_iter = gpf->next) {
                                                        if (gpf_iter->flag & GP_FRAME_SELECT) {
                                                                if (FrameOnMouseSide(t->frame_side, (float)gpf_iter->framenum, cfra)) {
-                                                                       float val = fabsf(gpf->framenum - gpf_iter->framenum);
-                                                                       if (val < min)
+                                                                       int val = abs(gpf->framenum - gpf_iter->framenum);
+                                                                       if (val < min) {
                                                                                min = val;
+                                                                       }
                                                                }
                                                        }
                                                }
@@ -3781,13 +3783,14 @@ static void createTransActionData(bContext *C, TransInfo *t)
                                                }
                                                else {
                                                        MaskLayerShape *masklay_iter;
-                                                       float min = FLT_MAX;
+                                                       int min = INT_MAX;
                                                        for (masklay_iter = masklay->splines_shapes.first; masklay_iter; masklay_iter = masklay_iter->next) {
                                                                if (masklay_iter->flag & MASK_SHAPE_SELECT) {
                                                                        if (FrameOnMouseSide(t->frame_side, (float)masklay_iter->frame, cfra)) {
-                                                                               float val = fabsf(masklay_shape->frame - masklay_iter->frame);
-                                                                               if (val < min)
+                                                                               int val = abs(masklay_shape->frame - masklay_iter->frame);
+                                                                               if (val < min) {
                                                                                        min = val;
+                                                                               }
                                                                        }
                                                                }
                                                        }
index 984273ec63e91d1bd78f5c99825acd9d9740eb8c..186abdfe5987786ec12aa4e8b1e1fdbf13f7848e 100644 (file)
@@ -3672,7 +3672,7 @@ void CcdPhysicsEnvironment::SetupObjectConstraints(KX_GameObject *obj_src, KX_Ga
                        break;
        }
 
-       for (dof; dof < dof_max; dof++) {
+       for (; dof < dof_max; dof++) {
                if (dat->flag & dofbit) {
                        phys_env->SetConstraintParam(constraintId, dof, dat->minLimit[dof], dat->maxLimit[dof]);
                }