diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-27 06:26:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-27 06:52:58 +0300 |
commit | 5520b8df4b578595afcfc074a1acb96359bce49c (patch) | |
tree | a14ab9f8047492364370370e7e40bfd2ac16bb49 /source/blender | |
parent | 2a5e92c989d80d79d3eaf43202ee979a2dc88042 (diff) |
cleanup: double promotion
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_curve.h | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 8 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_compositing.c | 23 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_animation.c | 4 |
5 files changed, 23 insertions, 16 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 4aeeaa87269..a4c071d88a7 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -234,6 +234,7 @@ static int isNurbsel_count(Curve *cu, Nurb *nu) /* ******************* PRINTS ********************* */ +#if 0 void printknots(Object *obedit) { ListBase *editnurb = object_editcurve_get(obedit); @@ -253,6 +254,7 @@ void printknots(Object *obedit) } } } +#endif /* ********************* Shape keys *************** */ diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 58e64f30b05..27e9cad4fd5 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -90,7 +90,9 @@ bool ED_curve_active_center(struct Curve *cu, float center[3]); bool mouse_font(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); +#if 0 /* debug only */ void printknots(struct Object *obedit); +#endif #endif /* __ED_CURVE_H__ */ diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index b6de4465149..098f0d04d78 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -1320,7 +1320,7 @@ static float project_paint_uvpixel_mask( ca_mask = w[0] * ca1 + w[1] * ca2 + w[2] * ca3; ca_mask = curvemapping_evaluateF(ps->cavity_curve, 0, ca_mask); - CLAMP(ca_mask, 0.0, 1.0); + CLAMP(ca_mask, 0.0f, 1.0f); mask *= ca_mask; } @@ -2060,8 +2060,10 @@ static void project_bucket_clip_face( /* detect pathological case where face the three vertices are almost colinear in screen space. * mostly those will be culled but when flood filling or with smooth shading it's a possibility */ if (dist_squared_to_line_v2(v1coSS, v2coSS, v3coSS) < 0.5f || - dist_squared_to_line_v2(v2coSS, v3coSS, v1coSS) < 0.5f) + dist_squared_to_line_v2(v2coSS, v3coSS, v1coSS) < 0.5f) + { colinear = true; + } /* get the UV space bounding box */ inside_bucket_flag |= BLI_rctf_isect_pt_v(bucket_bounds, v1coSS); @@ -3271,7 +3273,7 @@ static void proj_paint_state_cavity_init(ProjPaintState *ps) mul_v3_fl(edges[a], 1.0f / counter[a]); normal_short_to_float_v3(no, mv->no); /* augment the diffe*/ - cavities[a] = saacos(10.0f * dot_v3v3(no, edges[a])) * M_1_PI; + cavities[a] = saacos(10.0f * dot_v3v3(no, edges[a])) * (float)M_1_PI; } else cavities[a] = 0.0; diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c index 08291d0d1c6..89b8ba2e681 100644 --- a/source/blender/gpu/intern/gpu_compositing.c +++ b/source/blender/gpu/intern/gpu_compositing.c @@ -148,22 +148,23 @@ static GPUTexture * create_concentric_sample_texture(int side) } #endif -static GPUTexture * create_spiral_sample_texture(int numsaples) +static GPUTexture *create_spiral_sample_texture(int numsaples) { GPUTexture *tex; - float *texels = (float *)MEM_mallocN(sizeof(float) * 2 * numsaples, "concentric_tex"); + float (*texels)[2] = MEM_mallocN(sizeof(float[2]) * numsaples, "concentric_tex"); + const float numsaples_inv = 1.0f / numsaples; int i; - /* random number to ensure we don't get conciding samples every circle */ + /* arbitrary number to ensure we don't get conciding samples every circle */ const float spirals = 7.357; for (i = 0; i < numsaples; i++) { - float r = (i + 0.5f) / (float) numsaples; - float phi = 2.0f * M_PI * r * spirals; - texels[i * 2] = r * cos(phi); - texels[i * 2 + 1] = r * sin(phi); + float r = (i + 0.5f) * numsaples_inv; + float phi = r * spirals * (float)(2.0 * M_PI); + texels[i][0] = r * cosf(phi); + texels[i][1] = r * sinf(phi); } - tex = GPU_texture_create_1D_procedural(numsaples, texels, NULL); + tex = GPU_texture_create_1D_procedural(numsaples, (float *)texels, NULL); MEM_freeN(texels); return tex; } @@ -273,8 +274,8 @@ static GPUTexture * create_jitter_texture(void) int i; for (i = 0; i < 64 * 64; i++) { - jitter[i][0] = 2.0f * BLI_frand() - 1.0; - jitter[i][1] = 2.0f * BLI_frand() - 1.0; + jitter[i][0] = 2.0f * BLI_frand() - 1.0f; + jitter[i][1] = 2.0f * BLI_frand() - 1.0f; normalize_v2(jitter[i]); } @@ -714,7 +715,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str float scale_camera = 0.001f / scale; float aperture = 2.0f * scale_camera * fx_dof->focal_length / fx_dof->fstop; - dof_params[0] = aperture * fabs(scale_camera * fx_dof->focal_length / (fx_dof->focus_distance - scale_camera * fx_dof->focal_length)); + dof_params[0] = aperture * fabsf(scale_camera * fx_dof->focal_length / (fx_dof->focus_distance - scale_camera * fx_dof->focal_length)); dof_params[1] = fx_dof->focus_distance; dof_params[2] = fx->gbuffer_dim[0] / (scale_camera * fx_dof->sensor); dof_params[3] = 0.0f; diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index e4696d87992..df1e6dd55dd 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -574,8 +574,8 @@ static void rna_def_common_keying_flags(StructRNA *srna, short reg) prop = RNA_def_property(srna, "use_insertkey_override_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "keyingoverride", INSERTKEY_XYZ2RGB); RNA_def_property_ui_text(prop, "Override F-Curve Colors - XYZ to RGB", - "Override default setting to set color for newly added transformation F-Curves (Location, Rotation, Scale) " - "to be based on the transform axis"); + "Override default setting to set color for newly added transformation F-Curves " + "(Location, Rotation, Scale) to be based on the transform axis"); if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); |