cleanup: double promotion
authorCampbell Barton <ideasman42@gmail.com>
Fri, 27 Feb 2015 03:26:34 +0000 (14:26 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 27 Feb 2015 03:52:58 +0000 (14:52 +1100)
source/blender/editors/curve/editcurve.c
source/blender/editors/include/ED_curve.h
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/gpu/intern/gpu_compositing.c
source/blender/makesrna/intern/rna_animation.c

index 4aeeaa8726989688955daeac0509e75c16f47f06..a4c071d88a7c3e61ed1bb98d1fded3f5eb36463e 100644 (file)
@@ -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 *************** */
 
index 58e64f30b057e5cb52b06857c7e6ab151e58d409..27e9cad4fd5dec732bd6269f0b9380d0ac7692e8 100644 (file)
@@ -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__ */
index b6de44651492b9ce4fce564ae6980b39efd3ad32..098f0d04d780539df14eb4f47f1b59669dfcda96 100644 (file)
@@ -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;
index 08291d0d1c6b13fb4a676af8c2719f183cee4c23..89b8ba2e6815a5b6496ef79e0e48edb793bb218b 100644 (file)
@@ -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;
index e4696d87992b244e1f4de40540d30891e1f97107..df1e6dd55dd2df877cbdcc9e3a815ab20334789e 100644 (file)
@@ -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);