diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 24 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 20 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_input.c | 4 |
9 files changed, 33 insertions, 35 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index f019287144d..741d4b729ae 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -1329,7 +1329,7 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br) for (i = 0; i < side; ++i) { for (j = 0; j < side; ++j) { - float magn = sqrt(pow(i - half, 2) + pow(j - half, 2)); + float magn = sqrtf(powf(i - half, 2) + powf(j - half, 2)); im->rect_float[i * side + j] = BKE_brush_curve_strength_clamp(br, magn, half); } } diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index a1f87762db7..da9350cc7b9 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3155,7 +3155,7 @@ static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar /* find bounding-box range where target is located */ if (ownLoc[clamp_axis] < curveMin[clamp_axis]) { /* bounding-box range is before */ - offset = curveMin[clamp_axis] - ceil((curveMin[clamp_axis] - ownLoc[clamp_axis]) / len) * len; + offset = curveMin[clamp_axis] - ceilf((curveMin[clamp_axis] - ownLoc[clamp_axis]) / len) * len; /* now, we calculate as per normal, except using offset instead of curveMin[clamp_axis] */ curvetime = (ownLoc[clamp_axis] - offset) / (len); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index f483fd7dc8a..f676cfb2fb8 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -3292,9 +3292,9 @@ void BKE_ptcache_update_info(PTCacheID *pid) mb = (bytes > 1024.0f * 1024.0f); BLI_snprintf(mem_info, sizeof(mem_info), "%i frames in memory (%.1f %s)", - totframes, - bytes / (mb ? 1024.0f * 1024.0f : 1024.0f), - mb ? "Mb" : "kb"); + totframes, + bytes / (mb ? 1024.0f * 1024.0f : 1024.0f), + mb ? "Mb" : "kb"); } if (cache->flag & PTCACHE_OUTDATED) { diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index a36b2dd2c45..5459f689e9f 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -442,7 +442,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if (ELEM(but->type, ROW, MENU)) { EnumPropertyItem *item; int i, totitem, free; - int value = (but->type == ROW) ? but->hardmax : ui_get_but_val(but); + int value = (but->type == ROW) ? (int)but->hardmax : (int)ui_get_but_val(but); RNA_property_enum_items_gettexted(C, &but->rnapoin, but->rnaprop, &item, &totitem, &free); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 507ed2de07f..361244e9f13 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -4541,7 +4541,7 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event) mdiff[1] = opdata->mcenter[1] - event->mval[1]; factor = len_v2(mdiff) / opdata->initial_length; - factor = MAX2(1.0 - factor, 0.0); + factor = MAX2(1.0f - factor, 0.0f); RNA_float_set(op->ptr, "percent", factor); @@ -4837,7 +4837,7 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, wmEvent *event) else { amount = opdata->old_thickness - (len_v2(mdiff) - opdata->initial_length) / opdata->initial_length; - amount = MAX2(amount, 0.0); + amount = MAX2(amount, 0.0f); RNA_float_set(op->ptr, "thickness", amount); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 8b7e0dd0db1..76003be8dc9 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -2281,15 +2281,15 @@ void node_composit_backdrop_viewer(SpaceNode* snode, ImBuf* backdrop, bNode* nod void node_composit_backdrop_boxmask(SpaceNode* snode, ImBuf* backdrop, bNode* node, int x, int y) { - NodeBoxMask * boxmask = node->storage; + NodeBoxMask *boxmask = node->storage; const float backdropWidth = backdrop->x; const float backdropHeight = backdrop->y; const float aspect = backdropWidth/backdropHeight; - const float rad = DEG2RAD(-boxmask->rotation); - const float cosine = cos(rad); - const float sine = sin(rad); - const float halveBoxWidth = backdropWidth*(boxmask->width/2.0f); - const float halveBoxHeight = backdropHeight*(boxmask->height/2.0f)*aspect; + const float rad = DEG2RADF(-boxmask->rotation); + const float cosine = cosf(rad); + const float sine = sinf(rad); + const float halveBoxWidth = backdropWidth * (boxmask->width / 2.0f); + const float halveBoxHeight = backdropHeight * (boxmask->height / 2.0f) * aspect; float cx, cy, x1, x2, x3, x4; float y1, y2, y3, y4; @@ -2325,12 +2325,12 @@ void node_composit_backdrop_ellipsemask(SpaceNode* snode, ImBuf* backdrop, bNode NodeEllipseMask * ellipsemask = node->storage; const float backdropWidth = backdrop->x; const float backdropHeight = backdrop->y; - const float aspect = backdropWidth/backdropHeight; - const float rad = DEG2RAD(-ellipsemask->rotation); - const float cosine = cos(rad); - const float sine = sin(rad); - const float halveBoxWidth = backdropWidth*(ellipsemask->width/2.0f); - const float halveBoxHeight = backdropHeight*(ellipsemask->height/2.0f)*aspect; + const float aspect = backdropWidth / backdropHeight; + const float rad = DEG2RADF(-ellipsemask->rotation); + const float cosine = cosf(rad); + const float sine = sinf(rad); + const float halveBoxWidth = backdropWidth * (ellipsemask->width / 2.0f); + const float halveBoxHeight = backdropHeight * (ellipsemask->height / 2.0f) * aspect; float cx, cy, x1, x2, x3, x4; float y1, y2, y3, y4; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 496488922a5..fea6f7266b2 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -5554,7 +5554,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d, else #endif { - val= floorf(val+0.5f); + val = floor(val + 0.5); } /* convert frame out of nla-action time */ @@ -5640,7 +5640,7 @@ static void headerTimeTranslate(TransInfo *t, char *str) /* apply snapping + frame->seconds conversions */ if (autosnap == SACTSNAP_STEP) { if (do_time) - val= floorf((double)val/secf + 0.5f); + val= floorf((double)val / secf + 0.5); else val= floorf(val + 0.5f); } @@ -5688,9 +5688,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) if (autosnap == SACTSNAP_STEP) { if (do_time) - deltax= (float)(floor((deltax/secf) + 0.5f) * secf); + deltax = (float)(floor(((double)deltax / secf) + 0.5) * secf); else - deltax= (float)(floor(deltax + 0.5f)); + deltax = (float)(floor(deltax + 0.5f)); } val = BKE_nla_tweakedit_remap(adt, td->ival, NLATIME_CONVERT_MAP); @@ -5702,9 +5702,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) if (autosnap == SACTSNAP_STEP) { if (do_time) - val= (float)(floor((deltax/secf) + 0.5f) * secf); + val = (float)(floor(((double)deltax / secf) + 0.5) * secf); else - val= (float)(floor(val + 0.5f)); + val = (float)(floor(val + 0.5f)); } *(td->val) = td->ival + val; @@ -5954,9 +5954,9 @@ static void applyTimeScale(TransInfo *t) if (autosnap == SACTSNAP_STEP) { if (do_time) - fac= (float)(floor(fac/secf + 0.5f) * secf); + fac = (float)(floor((double)fac / secf + 0.5) * secf); else - fac= (float)(floor(fac + 0.5f)); + fac = (float)(floor(fac + 0.5f)); } /* check if any need to apply nla-mapping */ @@ -5964,9 +5964,7 @@ static void applyTimeScale(TransInfo *t) startx= BKE_nla_tweakedit_remap(adt, startx, NLATIME_CONVERT_UNMAP); /* now, calculate the new value */ - *(td->val) = td->ival - startx; - *(td->val) *= fac; - *(td->val) += startx; + *(td->val) = ((td->ival - startx) * fac) + startx; /* apply nearest snapping */ doAnimEdit_SnapFrame(t, td, td2d, adt, autosnap); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 8289cd0b10f..213a22b2c10 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3722,9 +3722,9 @@ void flushTransGraphData(TransInfo *t) switch (sipo->autosnap) { case SACTSNAP_FRAME: /* snap to nearest frame (or second if drawing seconds) */ if (sipo->flag & SIPO_DRAWTIME) - td2d->loc[0] = (float)(floorf((td2d->loc[0]/secf) + 0.5f) * secf); + td2d->loc[0] = floorf((td2d->loc[0] / secf) + 0.5) * secf; else - td2d->loc[0] = (float)(floorf(td2d->loc[0]+0.5f)); + td2d->loc[0] = floorf(td2d->loc[0] + 0.5); break; case SACTSNAP_MARKER: /* snap to nearest marker */ diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index f12961df0d9..9c485e17dc7 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -206,10 +206,10 @@ static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const int mva mdx = mval[0] - data[2]; mdy = mval[1] - data[3]; - distance = (length != 0.0) ? (mdx * dx + mdy * dy) / length: 0.0; + distance = (length != 0.0) ? (mdx * dx + mdy * dy) / length : 0.0; } - output[0] = (length != 0.0) ? (double)(distance / length) : 0.0f; + output[0] = (length != 0.0) ? (double)(distance / length) : 0.0; } } |