Cleanup: warnings

This commit is contained in:
Campbell Barton 2015-04-23 16:09:30 +10:00
parent 0287b39468
commit 87b3e62b3d
4 changed files with 14 additions and 11 deletions

View 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]);
}
}
}

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

View 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;
}
}
}
}

View 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]);
}