Cleanup: warnings

This commit is contained in:
Campbell Barton 2016-07-22 04:05:38 +10:00
parent 9279bee583
commit 1cc0ce58fd
9 changed files with 27 additions and 23 deletions

View File

@ -78,8 +78,8 @@ void BKE_camera_init(Camera *cam)
/* stereoscopy 3d */
cam->stereo.interocular_distance = 0.065f;
cam->stereo.convergence_distance = 30.f * 0.065f;
cam->stereo.pole_merge_angle_from = DEG2RAD(60.0f);
cam->stereo.pole_merge_angle_to = DEG2RAD(75.0f);
cam->stereo.pole_merge_angle_from = DEG2RADF(60.0f);
cam->stereo.pole_merge_angle_to = DEG2RADF(75.0f);
}
void *BKE_camera_add(Main *bmain, const char *name)

View File

@ -4483,7 +4483,7 @@ static void dynamicPaint_doSmudge(DynamicPaintSurface *surface, DynamicPaintBrus
CLAMP_MIN(max_velocity, vel);
}
steps = (int)ceil(max_velocity / bData->average_dist * timescale);
steps = (int)ceil((double)max_velocity / bData->average_dist * (double)timescale);
CLAMP(steps, 0, 12);
eff_scale = brush->smudge_strength / (float)steps * timescale;
@ -4634,7 +4634,7 @@ static int dynamicPaint_prepareEffectStep(
/* calculate average values (single thread) */
for (int index = 0; index < sData->total_points; index++) {
average_force += (*force)[index * 4 + 3];
average_force += (double)(*force)[index * 4 + 3];
}
average_force /= sData->total_points;
}
@ -4651,7 +4651,7 @@ static int dynamicPaint_prepareEffectStep(
shrink_speed = surface->shrink_speed;
fastest_effect = max_fff(spread_speed, shrink_speed, average_force);
avg_dist = bData->average_dist * CANVAS_REL_SIZE / getSurfaceDimension(sData);
avg_dist = bData->average_dist * (double)CANVAS_REL_SIZE / (double)getSurfaceDimension(sData);
steps = (int)ceilf(1.5f * EFF_MOVEMENT_PER_FRAME * fastest_effect / avg_dist * timescale);
CLAMP(steps, 1, 20);
@ -5009,7 +5009,8 @@ static void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescal
const float wave_scale = CANVAS_REL_SIZE / canvas_size;
/* allocate memory */
PaintWavePoint *prevPoint = MEM_mallocN(sData->total_points * sizeof(PaintWavePoint), "Temp previous points for wave simulation");
PaintWavePoint *prevPoint = MEM_mallocN(
sData->total_points * sizeof(PaintWavePoint), __func__);
if (!prevPoint)
return;
@ -5019,13 +5020,14 @@ static void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescal
int numOfNeighs = sData->adj_data->n_num[index];
for (i = 0; i < numOfNeighs; i++) {
average_dist += bNeighs[sData->adj_data->n_index[index] + i].dist;
average_dist += (double)bNeighs[sData->adj_data->n_index[index] + i].dist;
}
}
average_dist *= wave_scale / sData->adj_data->total_targets;
average_dist *= (double)wave_scale / sData->adj_data->total_targets;
/* determine number of required steps */
steps = (int)ceil((WAVE_TIME_FAC * timescale * surface->wave_timescale) / (average_dist / wave_speed / 3));
steps = (int)ceil((double)(WAVE_TIME_FAC * timescale * surface->wave_timescale) /
(average_dist / (double)wave_speed / 3));
CLAMP(steps, 1, 20);
timescale /= steps;

View File

@ -1280,7 +1280,7 @@ void blo_freefiledata(FileData *fd)
if (fd->filesdna)
DNA_sdna_free(fd->filesdna);
if (fd->compflags)
MEM_freeN(fd->compflags);
MEM_freeN((void *)fd->compflags);
if (fd->datamap)
oldnewmap_free(fd->datamap);

View File

@ -1194,8 +1194,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (camera->stereo.pole_merge_angle_from == 0.0f &&
camera->stereo.pole_merge_angle_to == 0.0f)
{
camera->stereo.pole_merge_angle_from = DEG2RAD(60.0f);
camera->stereo.pole_merge_angle_to = DEG2RAD(75.0f);
camera->stereo.pole_merge_angle_from = DEG2RADF(60.0f);
camera->stereo.pole_merge_angle_to = DEG2RADF(75.0f);
}
}

View File

@ -4032,7 +4032,7 @@ static int edbm_decimate_exec(bContext *C, wmOperator *op)
const MDeformVert *dv = BM_ELEM_CD_GET_VOID_P(v, cd_dvert_offset);
weight = defvert_find_weight(dv, defbase_act);
if (invert_vertex_group) {
weight = 1.0 - weight;
weight = 1.0f - weight;
}
}
else {

View File

@ -1107,7 +1107,7 @@ static void reconstruct_struct(
if (spc[0] >= firststructtypenr && !ispointer(name)) {
/* struct field type */
/* where does the old struct data start (and is there an old one?) */
cpo = find_elem(oldsdna, type, name, spo, data, &sppo);
cpo = (char *)find_elem(oldsdna, type, name, spo, data, &sppo);
if (cpo) {
oldSDNAnr = DNA_struct_find_nr_ex(oldsdna, type, &oldsdna_index_last);
@ -1184,7 +1184,7 @@ void DNA_struct_switch_endian(const SDNA *oldsdna, int oldSDNAnr, char *data)
if (spc[0] >= firststructtypenr && !ispointer(name)) {
/* struct field type */
/* where does the old data start (is there one?) */
char *cpo = find_elem(oldsdna, type, name, spo, data, NULL);
char *cpo = (char *)find_elem(oldsdna, type, name, spo, data, NULL);
if (cpo) {
oldSDNAnr = DNA_struct_find_nr_ex(oldsdna, type, &oldsdna_index_last);
@ -1250,7 +1250,8 @@ void *DNA_struct_reconstruct(
{
int a, curSDNAnr, curlen = 0, oldlen;
const short *spo, *spc;
char *cur, *cpc, *cpo;
char *cur, *cpc;
const char *cpo;
const char *type;
/* oldSDNAnr == structnr, we're looking for the corresponding 'cur' number */

View File

@ -498,13 +498,13 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
/* Roll In/Out */
prop = RNA_def_property(srna, "bbone_rollin", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "roll1");
RNA_def_property_range(prop, -M_PI * 2.0f, M_PI * 2.0f);
RNA_def_property_range(prop, -M_PI * 2.0, M_PI * 2.0);
RNA_def_property_ui_text(prop, "Roll In", "Roll offset for the start of the B-Bone, adjusts twist");
RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
prop = RNA_def_property(srna, "bbone_rollout", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "roll2");
RNA_def_property_range(prop, -M_PI * 2.0f, M_PI * 2.0f);
RNA_def_property_range(prop, -M_PI * 2.0, M_PI * 2.0);
RNA_def_property_ui_text(prop, "Roll Out", "Roll offset for the end of the B-Bone, adjusts twist");
RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);

View File

@ -159,13 +159,13 @@ static void rna_def_camera_stereo_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
prop = RNA_def_property(srna, "pole_merge_angle_from", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, 0.0f, M_PI / 2.0f);
RNA_def_property_range(prop, 0.0f, M_PI / 2.0);
RNA_def_property_ui_text(prop, "Pole Merge Start Angle",
"Angle at which interocular distance starts to fade to 0");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
prop = RNA_def_property(srna, "pole_merge_angle_to", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, 0.0f, M_PI / 2.0f);
RNA_def_property_range(prop, 0.0f, M_PI / 2.0);
RNA_def_property_ui_text(prop, "Pole Merge End Angle",
"Angle at which interocular distance is 0");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);

View File

@ -144,8 +144,9 @@ static void mix_normals(
break;
}
interp_v3_v3v3_slerp_safe(*no_new, *no_old, *no_new,
(mix_limit < M_PI) ? min_ff(fac, mix_limit / angle_v3v3(*no_new, *no_old)) : fac);
interp_v3_v3v3_slerp_safe(
*no_new, *no_old, *no_new,
(mix_limit < (float)M_PI) ? min_ff(fac, mix_limit / angle_v3v3(*no_new, *no_old)) : fac);
}
MEM_SAFE_FREE(facs);
@ -390,7 +391,7 @@ static DerivedMesh *normalEditModifier_do(NormalEditModifierData *smd, Object *o
const bool use_current_clnors = !((smd->mix_mode == MOD_NORMALEDIT_MIX_COPY) &&
(smd->mix_factor == 1.0f) &&
(smd->defgrp_name[0] == '\0') &&
(smd->mix_limit == M_PI));
(smd->mix_limit == (float)M_PI));
int defgrp_index;
MDeformVert *dvert;