Cleanup: fix harmless compiler warnings.

This commit is contained in:
Brecht Van Lommel
2018-09-27 14:29:53 +02:00
parent 4de1e673a4
commit 0f6b2504f8
6 changed files with 13 additions and 21 deletions

View File

@@ -716,7 +716,7 @@ float Camera::world_to_raster_size(float3 P)
float3 D = transform_point(&worldtocamera, P);
float dist = len(D);
Ray ray = {0};
Ray ray = {{0}};
/* Distortion can become so great that the results become meaningless, there
* may be a better way to do this, but calculating differentials from the

View File

@@ -87,14 +87,12 @@ BLI_INLINE int rotate_quad_to_corner(const float u, const float v,
*r_u = 2.0f * (1.0f - u);
*r_v = 2.0f * (1.0f - v);
}
else if (u <= 0.5f && v >= 0.5f) {
else {
BLI_assert(u <= 0.5f && v >= 0.5f);
corner = 3;
*r_u = 2.0f * (1.0f - v);
*r_v = 2.0f * u;
}
else {
BLI_assert(!"Unexpected corner configuration");
}
return corner;
}

View File

@@ -237,13 +237,11 @@ BLI_INLINE void rotate_corner_to_quad(
*r_u = 0.5f + v * 0.5f;
*r_v = 0.5f + u * 0.5f;
}
else if (corner == 3) {
else {
BLI_assert(corner == 3);
*r_u = 0.5f - u * 0.5f;
*r_v = 0.5f + v * 0.5f;
}
else {
BLI_assert(!"Unexpected corner configuration");
}
}
static void subdiv_ccg_eval_regular_grid(CCGEvalGridsData *data,

View File

@@ -93,14 +93,12 @@ BLI_INLINE int rotate_quad_to_corner(const float u, const float v,
*r_u = 2.0f * (1.0f - u);
*r_v = 2.0f * (1.0f - v);
}
else if (u <= 0.5f && v >= 0.5f) {
else {
BLI_assert(u <= 0.5f && v >= 0.5f);
corner = 3;
*r_u = 2.0f * (1.0f - v);
*r_v = 2.0f * u;
}
else {
BLI_assert(!"Unexpected corner configuration");
}
return corner;
}

View File

@@ -103,14 +103,12 @@ BLI_INLINE int rotate_quad_to_corner(const float u, const float v,
*r_u = 2.0f * (1.0f - u);
*r_v = 2.0f * (1.0f - v);
}
else if (u <= 0.5f && v >= 0.5f) {
else {
BLI_assert(u <= 0.5f && v >= 0.5f);
corner = 3;
*r_u = 2.0f * (1.0f - v);
*r_v = 2.0f * u;
}
else {
BLI_assert(!"Unexpected corner configuration");
}
return corner;
}

View File

@@ -287,7 +287,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
Object *ob = objects[ob_index];
BMEditMesh *em = BKE_editmesh_from_object(ob);
BMesh *bm = em->bm;
Material ***material_array;
Material ***material_array = NULL;
invert_m4_m4(ob->imat, ob->obmat);
int custom_data_offset = 0;
@@ -418,10 +418,10 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
BMEditMesh *em = BKE_editmesh_from_object(ob);
BMesh *bm = em->bm;
bool changed = false;
Material ***material_array;
Material ***material_array = NULL;
int custom_data_offset;
bool has_custom_data_layer;
bool has_custom_data_layer = false;
switch (type) {
case SIMFACE_MATERIAL:
{
@@ -880,7 +880,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
BMesh *bm = em->bm;
bool changed = false;
bool has_custom_data_layer;
bool has_custom_data_layer = false;
switch (type) {
case SIMEDGE_FREESTYLE:
{