diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-27 21:22:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-27 21:22:04 +0400 |
commit | a73c3fe5c992777718431d5e5bb5f8a2c3b7a1bc (patch) | |
tree | 51ca1d7a06715f0dde24196157c915b12da334c0 /source/blender/editors | |
parent | 9c8f1e2ef487483bc374feaed9ff709e07638623 (diff) |
subsurf, derived mesh and other misc files: floats were being implicitly promoted to doubles, adjust to use floats.
Diffstat (limited to 'source/blender/editors')
20 files changed, 52 insertions, 53 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index d0fa540a9dd..9c923d3492b 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -100,7 +100,7 @@ void ANIM_timecode_string_from_frame (char *str, Scene *scene, int power, short * to cope with 'half' frames, etc., which should be fine in most cases */ seconds= (int)cfra; - frames= (int)floor( ((cfra - seconds) * FPS) + 0.5f ); + frames= (int)floor( (((double)cfra - (double)seconds) * FPS) + 0.5 ); } else { /* seconds (with pixel offset rounding) */ @@ -399,9 +399,9 @@ float ANIM_unit_mapping_get_factor (Scene *scene, ID *id, FCurve *fcu, short res /* if the radians flag is not set, default to using degrees which need conversions */ if ((scene) && (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS) == 0) { if (restore) - return M_PI / 180.0f; /* degrees to radians */ + return M_PI / 180.0; /* degrees to radians */ else - return 180.0f / M_PI; /* radians to degrees */ + return 180.0 / M_PI; /* radians to degrees */ } } diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index d14ebc2c7bb..85063be852d 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -301,7 +301,7 @@ static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short /* --------------- */ -#define BINARYSEARCH_FRAMEEQ_THRESH 0.0001 +#define BINARYSEARCH_FRAMEEQ_THRESH 0.0001f /* Binary search algorithm for finding where to insert Envelope Data Point. * Returns the index to insert at (data already at that index will be offset if replace is 0) diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 662f038fd6e..c4108e0ce33 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -360,9 +360,9 @@ static void add_bezt_to_keyblocks_list(DLRBT_Tree *blocks, DLRBT_Tree *beztTree, * -> secondly, handles which control that section of the curve must be constant */ if ((!prev) || (!beztn)) return; - if (IS_EQ(beztn->vec[1][1], prev->vec[1][1])==0) return; - if (IS_EQ(beztn->vec[1][1], beztn->vec[0][1])==0) return; - if (IS_EQ(prev->vec[1][1], prev->vec[2][1])==0) return; + if (IS_EQF(beztn->vec[1][1], prev->vec[1][1])==0) return; + if (IS_EQF(beztn->vec[1][1], beztn->vec[0][1])==0) return; + if (IS_EQF(prev->vec[1][1], prev->vec[2][1])==0) return; /* if there are no blocks already, just add as root */ diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index a2b5e2b1c8d..1ce05573e85 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -537,7 +537,7 @@ static short ok_bezier_frame(KeyframeEditData *ked, BezTriple *bezt) short ok = 0; /* frame is stored in f1 property (this float accuracy check may need to be dropped?) */ - #define KEY_CHECK_OK(_index) IS_EQ(bezt->vec[_index][0], ked->f1) + #define KEY_CHECK_OK(_index) IS_EQF(bezt->vec[_index][0], ked->f1) KEYFRAME_OK_CHECKS(KEY_CHECK_OK); #undef KEY_CHECK_OK @@ -577,7 +577,7 @@ static short ok_bezier_value(KeyframeEditData *ked, BezTriple *bezt) * - this float accuracy check may need to be dropped? * - should value be stored in f2 instead so that we won't have conflicts when using f1 for frames too? */ - #define KEY_CHECK_OK(_index) IS_EQ(bezt->vec[_index][1], ked->f1) + #define KEY_CHECK_OK(_index) IS_EQF(bezt->vec[_index][1], ked->f1) KEYFRAME_OK_CHECKS(KEY_CHECK_OK); #undef KEY_CHECK_OK @@ -697,7 +697,7 @@ void bezt_remap_times(KeyframeEditData *ked, BezTriple *bezt) static short snap_bezier_nearest(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f2 & SELECT) - bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]+0.5)); + bezt->vec[1][0]= (float)(floorf(bezt->vec[1][0]+0.5f)); return 0; } diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 1709d8cb085..4e77cebf27d 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -2127,7 +2127,7 @@ float ED_rollBoneToVector(EditBone *bone, const float align_axis[3], const short sub_v3_v3v3(align_axis_proj, align_axis, vec); if(axis_only) { - if(angle_v3v3(align_axis_proj, mat[2]) > M_PI/2) { + if(angle_v3v3(align_axis_proj, mat[2]) > (float)(M_PI/2.0)) { negate_v3(align_axis_proj); } } @@ -4704,14 +4704,14 @@ static void envelope_bone_weighting(Object *ob, Mesh *mesh, float (*verts)[3], i bone->rad_head * scale, bone->rad_tail * scale, bone->dist * scale); /* add the vert to the deform group if weight!=0.0 */ - if (distance!=0.0) + if (distance != 0.0f) ED_vgroup_vert_add (ob, dgroup, i, distance, WEIGHT_REPLACE); else ED_vgroup_vert_remove (ob, dgroup, i); /* do same for mirror */ if (dgroupflip && dgroupflip[j] && iflip >= 0) { - if (distance!=0.0) + if (distance != 0.0f) ED_vgroup_vert_add (ob, dgroupflip[j], iflip, distance, WEIGHT_REPLACE); else @@ -4960,7 +4960,7 @@ static void pchan_clear_rot(bPoseChannel *pchan) pchan->rotAxis[2]= 0.0f; /* check validity of axis - axis should never be 0,0,0 (if so, then we make it rotate about y) */ - if (IS_EQ(pchan->rotAxis[0], pchan->rotAxis[1]) && IS_EQ(pchan->rotAxis[1], pchan->rotAxis[2])) + if (IS_EQF(pchan->rotAxis[0], pchan->rotAxis[1]) && IS_EQF(pchan->rotAxis[1], pchan->rotAxis[2])) pchan->rotAxis[1] = 1.0f; } else if (pchan->rotmode == ROT_MODE_QUAT) { diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 8d41ed5fec1..276f60bdf7f 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -384,7 +384,7 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s mt[1]= mb[1] * pthick; athick= len_v2(mt); dfac= pthick - (athick * 2); - if ( ((athick * 2.0f) < pthick) && (IS_EQ(athick, pthick)==0) ) + if ( ((athick * 2.0f) < pthick) && (IS_EQF(athick, pthick)==0) ) { mt[0] += (mb[0] * dfac); mt[1] += (mb[1] * dfac); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index f272352c183..aca9a401321 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -107,7 +107,7 @@ void ED_region_pixelspace(ARegion *ar) int width= ar->winrct.xmax-ar->winrct.xmin+1; int height= ar->winrct.ymax-ar->winrct.ymin+1; - wmOrtho2(-0.375, (float)width-0.375, -0.375, (float)height-0.375); + wmOrtho2(-0.375f, (float)width-0.375f, -0.375f, (float)height-0.375f); glLoadIdentity(); } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 41354c83cec..a40c62360c9 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -324,8 +324,7 @@ static short testsplitpoint(ScrArea *sa, char dir, float fac) if(dir=='h' && (sa->v2->vec.y- sa->v1->vec.y <= 2*AREAMINY)) return 0; // to be sure - if(fac<0.0) fac= 0.0; - if(fac>1.0) fac= 1.0; + CLAMP(fac, 0.0f, 1.0f); if(dir=='h') { y= sa->v1->vec.y+ fac*(sa->v2->vec.y- sa->v1->vec.y); @@ -654,14 +653,14 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey) /* FIXME, this resizing logic is no good when resizing the window + redrawing [#24428] * need some way to store these as floats internally and re-apply from there. */ tempf= ((float)sv->vec.x)*facx; - sv->vec.x= (short)(tempf+0.5); + sv->vec.x= (short)(tempf+0.5f); sv->vec.x+= AREAGRID-1; sv->vec.x-= (sv->vec.x % AREAGRID); CLAMP(sv->vec.x, 0, winsizex); tempf= ((float)sv->vec.y)*facy; - sv->vec.y= (short)(tempf+0.5); + sv->vec.y= (short)(tempf+0.5f); sv->vec.y+= AREAGRID-1; sv->vec.y-= (sv->vec.y % AREAGRID); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 1428a9a9075..1d818818908 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -537,8 +537,8 @@ static float calc_overlap(StrokeCache *cache, const char symm, const char axis, //distsq = len_squared_v3v3(mirror, cache->traced_location); distsq = len_squared_v3v3(mirror, cache->true_location); - if (distsq <= 4*(cache->radius_squared)) - return (2*(cache->radius) - sqrt(distsq)) / (2*(cache->radius)); + if (distsq <= 4.0f*(cache->radius_squared)) + return (2.0f*(cache->radius) - sqrtf(distsq)) / (2.0f*(cache->radius)); else return 0; } @@ -731,12 +731,12 @@ static float tex_strength(SculptSession *ss, Brush *br, float *point, const floa /* it is probably worth optimizing for those cases where the texture is not rotated by skipping the calls to atan2, sqrtf, sin, and cos. */ - if (rotation > 0.001 || rotation < -0.001) { - const float angle = atan2(y, x) + rotation; + if (rotation > 0.001f || rotation < -0.001f) { + const float angle = atan2f(y, x) + rotation; const float flen = sqrtf(x*x + y*y); - x = flen * cos(angle); - y = flen * sin(angle); + x = flen * cosf(angle); + y = flen * sinf(angle); } x *= br->mtex.size[0]; @@ -798,7 +798,7 @@ static void sculpt_clip(Sculpt *sd, SculptSession *ss, float *co, const float va if(sd->flags & (SCULPT_LOCK_X << i)) continue; - if((ss->cache->flag & (CLIP_X << i)) && (fabs(co[i]) <= ss->cache->clip_tolerance[i])) + if((ss->cache->flag & (CLIP_X << i)) && (fabsf(co[i]) <= ss->cache->clip_tolerance[i])) co[i]= 0.0f; else co[i]= val[i]; @@ -3135,7 +3135,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, st (brush->flag & BRUSH_RANDOM_ROTATION) && !(brush->flag & BRUSH_RAKE)) { - cache->special_rotation = 2*M_PI*BLI_frand(); + cache->special_rotation = 2.0f*(float)M_PI*BLI_frand(); } } diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 4f523f0ca76..22bf99053e8 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -309,7 +309,7 @@ static void file_draw_string(int sx, int sy, const char* string, float width, in fs.align = align; BLI_strncpy(fname,string, FILE_MAXFILE); - file_shorten_string(fname, width+1.0, 0); + file_shorten_string(fname, width + 1.0f, 0); /* no text clipping needed, uiStyleFontDraw does it but is a bit too strict (for buttons it works) */ rect.xmin = sx; diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 22f15b76dd3..0e61d30cccd 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -248,11 +248,11 @@ int ED_fileselect_layout_numfiles(FileLayout* layout, struct ARegion *ar) if (layout->flag & FILE_LAYOUT_HOR) { int width = ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*layout->tile_border_x; - numfiles = (float)width/(float)layout->tile_w+0.5; + numfiles = (float)width/(float)layout->tile_w + 0.5f; return numfiles*layout->rows; } else { int height = ar->v2d.cur.ymax - ar->v2d.cur.ymin - 2*layout->tile_border_y; - numfiles = (float)height/(float)layout->tile_h+0.5; + numfiles = (float)height/(float)layout->tile_h + 0.5f; return numfiles*layout->columns; } } diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index deffc60019e..1bb6e6f6edb 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -128,8 +128,8 @@ void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xmax, flo } /* ensure that the extents are not too extreme that view implodes...*/ - if ((xmin && xmax) && (fabs(*xmax - *xmin) < 0.1)) *xmax += 0.1; - if ((ymin && ymax) && (fabs(*ymax - *ymin) < 0.1)) *ymax += 0.1; + if ((xmin && xmax) && (fabsf(*xmax - *xmin) < 0.1f)) *xmax += 0.1f; + if ((ymin && ymax) && (fabsf(*ymax - *ymin) < 0.1f)) *ymax += 0.1f; /* free memory */ BLI_freelistN(&anim_data); @@ -1621,17 +1621,17 @@ static int graphkeys_euler_filter_exec (bContext *C, wmOperator *op) /* > 180 degree flip? */ if (fabs(prev->vec[1][1] - bezt->vec[1][1]) >= M_PI) { /* 360 degrees to add/subtract frame value until difference is acceptably small that there's no more flip */ - const double fac = 2.0 * M_PI; + const float fac = 2.0f * (float)M_PI; if (prev->vec[1][1] > bezt->vec[1][1]) { - while (fabs(bezt->vec[1][1] - prev->vec[1][1]) >= M_PI) { + while (fabsf(bezt->vec[1][1] - prev->vec[1][1]) >= (float)M_PI) { bezt->vec[0][1] += fac; bezt->vec[1][1] += fac; bezt->vec[2][1] += fac; } } else /* if (prev->vec[1][1] < bezt->vec[1][1]) */ { - while (fabs(bezt->vec[1][1] - prev->vec[1][1]) >= M_PI) { + while (fabsf(bezt->vec[1][1] - prev->vec[1][1]) >= (float)M_PI) { bezt->vec[0][1] -= fac; bezt->vec[1][1] -= fac; bezt->vec[2][1] -= fac; diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 3e028607172..4f2e68bb216 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -205,8 +205,8 @@ static void draw_image_grid(ARegion *ar, float zoomx, float zoomy) } /* the fine resolution level */ - blendfac= 0.25*gridsize - floor(0.25f*gridsize); - CLAMP(blendfac, 0.0, 1.0); + blendfac= 0.25f*gridsize - floorf(0.25f*gridsize); + CLAMP(blendfac, 0.0f, 1.0f); UI_ThemeColorShade(TH_BACK, (int)(20.0f*(1.0f-blendfac))); fac= 0.0f; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 56b5ed10c56..c560b68c01b 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -372,7 +372,7 @@ static int view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event) ARegion *ar= CTX_wm_region(C); float factor; - factor= 1.0 + (event->x-event->prevx+event->y-event->prevy)/300.0f; + factor= 1.0f + (event->x-event->prevx+event->y-event->prevy)/300.0f; RNA_float_set(op->ptr, "factor", factor); sima_zoom_set(sima, ar, sima->zoom*factor); ED_region_tag_redraw(CTX_wm_region(C)); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 1d643ba1a89..451e0e6e89b 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -204,7 +204,7 @@ void ED_image_aspect(Image *ima, float *aspx, float *aspy) *aspx= *aspy= 1.0; if((ima == NULL) || (ima->type == IMA_TYPE_R_RESULT) || (ima->type == IMA_TYPE_COMPOSITE) || - (ima->aspx==0.0 || ima->aspy==0.0)) + (ima->aspx==0.0f || ima->aspy==0.0f)) return; /* x is always 1 */ diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 5d3f3314bd9..701b0fc1de7 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -362,7 +362,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm return (OPERATOR_FINISHED|OPERATOR_PASS_THROUGH); } - if (rti->widthfac == 0.0) { + if (rti->widthfac == 0.0f) { /* initialise colors based on report type */ if(report->type & RPT_ERROR_ALL) { rti->col[0] = 1.0; @@ -396,7 +396,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm /* collapse report at end of timeout */ if (progress*timeout > timeout - COLLAPSE_TIMEOUT) { rti->widthfac = (progress*timeout - (timeout - COLLAPSE_TIMEOUT)) / COLLAPSE_TIMEOUT; - rti->widthfac = 1.0 - rti->widthfac; + rti->widthfac = 1.0f - rti->widthfac; send_note= 1; } diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 8848d4be76f..e830a421a59 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -255,10 +255,10 @@ static void nla_draw_strip_curves (NlaStrip *strip, float yminc, float ymaxc) } else { /* use blend in/out values only if both aren't zero */ - if ((IS_EQ(strip->blendin, 0.0f) && IS_EQ(strip->blendout, 0.0f))==0) { + if ((IS_EQF(strip->blendin, 0.0f) && IS_EQF(strip->blendout, 0.0f))==0) { glBegin(GL_LINE_STRIP); /* start of strip - if no blendin, start straight at 1, otherwise from 0 to 1 over blendin frames */ - if (IS_EQ(strip->blendin, 0.0f) == 0) { + if (IS_EQF(strip->blendin, 0.0f) == 0) { glVertex2f(strip->start, yminc); glVertex2f(strip->start + strip->blendin, ymaxc); } @@ -266,7 +266,7 @@ static void nla_draw_strip_curves (NlaStrip *strip, float yminc, float ymaxc) glVertex2f(strip->start, ymaxc); /* end of strip */ - if (IS_EQ(strip->blendout, 0.0f) == 0) { + if (IS_EQF(strip->blendout, 0.0f) == 0) { glVertex2f(strip->end - strip->blendout, ymaxc); glVertex2f(strip->end, yminc); } @@ -321,7 +321,7 @@ static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *UNUSED(nlt) /* this only draws after the strip */ case NLASTRIP_EXTEND_HOLD_FORWARD: /* only need to try and draw if the next strip doesn't occur immediately after */ - if ((strip->next == NULL) || (IS_EQ(strip->next->start, strip->end)==0)) { + if ((strip->next == NULL) || (IS_EQF(strip->next->start, strip->end)==0)) { /* set the drawing color to the color of the strip, but this time less faint */ glColor4f(color[0], color[1], color[2], 0.3f); @@ -378,7 +378,7 @@ static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *UNUSED(nlt) uiDrawBoxShade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); /* if action-clip strip, draw lines delimiting repeats too (in the same color as outline) */ - if ((strip->type == NLASTRIP_TYPE_CLIP) && IS_EQ(strip->repeat, 1.0f)==0) { + if ((strip->type == NLASTRIP_TYPE_CLIP) && IS_EQF(strip->repeat, 1.0f)==0) { float repeatLen = (strip->actend - strip->actstart) * strip->scale; int i; @@ -403,7 +403,7 @@ static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *UNUSED(nlt) /* draw start-line if not same as end of previous (and only if not the first strip) * - on upper half of strip */ - if ((cs->prev) && IS_EQ(cs->prev->end, cs->start)==0) + if ((cs->prev) && IS_EQF(cs->prev->end, cs->start)==0) fdrawline(cs->start, y, cs->start, ymaxc); /* draw end-line if not the last strip diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index a86f16ee10f..48bdcb88618 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -176,7 +176,7 @@ void boundbox_seq(Scene *scene, rctf *rect) if( min[0] > seq->startdisp-1) min[0]= seq->startdisp-1; if( max[0] < seq->enddisp+1) max[0]= seq->enddisp+1; - if( max[1] < seq->machine+2.0) max[1]= seq->machine+2.0; + if( max[1] < seq->machine+2) max[1]= seq->machine+2; seq= seq->next; } diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 9539846df28..6ba047d741a 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1108,7 +1108,7 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back) CLAMP(st->txtbar.ymax, pix_bottom_margin, ar->winy - pix_top_margin); st->pix_per_line= (pix_available > 0)? (float) ltexth/pix_available: 0; - if(st->pix_per_line<.1) st->pix_per_line=.1f; + if(st->pix_per_line < 0.1f) st->pix_per_line=0.1f; curl_off= text_get_span_wrap(st, ar, st->text->lines.first, st->text->curl); sell_off= text_get_span_wrap(st, ar, st->text->lines.first, st->text->sell); diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index a81865fc3b4..705fb83264c 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -157,13 +157,13 @@ void apply_keyb_grid(int shift, int ctrl, float *val, float fac1, float fac2, fl ctrl= !ctrl; if(ctrl && shift) { - if(fac3!= 0.0) *val= fac3*floor(*val/fac3 +.5); + if(fac3 != 0.0f) *val= fac3*floorf(*val/fac3 +0.5f); } else if(ctrl) { - if(fac2!= 0.0) *val= fac2*floor(*val/fac2 +.5); + if(fac2 != 0.0f) *val= fac2*floorf(*val/fac2 +0.5f); } else { - if(fac1!= 0.0) *val= fac1*floor(*val/fac1 +.5); + if(fac1 != 0.0f) *val= fac1*floorf(*val/fac1 +0.5f); } } |