Cleanup: quiet -Wcomma, cast to void where needed
This commit is contained in:
@@ -467,7 +467,10 @@ size_t blf_font_width_to_strlen(FontBLF *font, const char *str, size_t len, floa
|
||||
|
||||
blf_font_ensure_ascii_table(font);
|
||||
|
||||
while ((i_prev = i), (width_new = pen_x), ((i < len) && str[i])) {
|
||||
while ((void)(i_prev = i),
|
||||
(void)(width_new = pen_x),
|
||||
((i < len) && str[i]))
|
||||
{
|
||||
BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
|
||||
|
||||
if (UNLIKELY(c == BLI_UTF8_ERR))
|
||||
|
||||
@@ -71,15 +71,12 @@ bool BLI_lasso_is_edge_inside(const int mcords[][2], const unsigned int moves,
|
||||
int x0, int y0, int x1, int y1,
|
||||
const int error_value)
|
||||
{
|
||||
int v1[2], v2[2];
|
||||
unsigned int a;
|
||||
|
||||
if (x0 == error_value || x1 == error_value || moves == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
v1[0] = x0, v1[1] = y0;
|
||||
v2[0] = x1, v2[1] = y1;
|
||||
const int v1[2] = {x0, y0}, v2[2] = {x1, y1};
|
||||
|
||||
/* check points in lasso */
|
||||
if (BLI_lasso_is_point_inside(mcords, moves, v1[0], v1[1], error_value)) return true;
|
||||
@@ -88,7 +85,7 @@ bool BLI_lasso_is_edge_inside(const int mcords[][2], const unsigned int moves,
|
||||
/* no points in lasso, so we have to intersect with lasso edge */
|
||||
|
||||
if (isect_seg_seg_v2_int(mcords[0], mcords[moves - 1], v1, v2) > 0) return true;
|
||||
for (a = 0; a < moves - 1; a++) {
|
||||
for (unsigned int a = 0; a < moves - 1; a++) {
|
||||
if (isect_seg_seg_v2_int(mcords[a], mcords[a + 1], v1, v2) > 0) return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2811,8 +2811,8 @@ void plot_line_v2v2i(const int p1[2], const int p2[2], bool (*callback)(int, int
|
||||
signed char iy;
|
||||
|
||||
/* if x1 == x2 or y1 == y2, then it does not matter what we set here */
|
||||
int delta_x = (x2 > x1 ? (ix = 1, x2 - x1) : (ix = -1, x1 - x2)) << 1;
|
||||
int delta_y = (y2 > y1 ? (iy = 1, y2 - y1) : (iy = -1, y1 - y2)) << 1;
|
||||
int delta_x = (x2 > x1 ? ((void)(ix = 1), x2 - x1) : ((void)(ix = -1), x1 - x2)) << 1;
|
||||
int delta_y = (y2 > y1 ? ((void)(iy = 1), y2 - y1) : ((void)(iy = -1), y1 - y2)) << 1;
|
||||
|
||||
if (callback(x1, y1, userData) == 0) {
|
||||
return;
|
||||
|
||||
@@ -2497,7 +2497,8 @@ static void bmesh_vert_separate__cleanup(BMesh *bm, LinkNode *edges_separate)
|
||||
n_prev->next = n_step->next;
|
||||
n_step = n_prev;
|
||||
}
|
||||
} while ((n_prev = n_step),
|
||||
} while ((void)
|
||||
(n_prev = n_step),
|
||||
(n_step = n_step->next));
|
||||
|
||||
} while ((n_orig = n_orig->next) && n_orig->next);
|
||||
|
||||
@@ -197,7 +197,7 @@ void BM_face_interp_from_face_ex(
|
||||
if (do_vertex) {
|
||||
CustomData_bmesh_interp(&bm->vdata, blocks_v, w, NULL, f_src->len, l_iter->v->head.data);
|
||||
}
|
||||
} while (i++, (l_iter = l_iter->next) != l_first);
|
||||
} while ((void)i++, (l_iter = l_iter->next) != l_first);
|
||||
}
|
||||
|
||||
void BM_face_interp_from_face(BMesh *bm, BMFace *f_dst, const BMFace *f_src, const bool do_vertex)
|
||||
@@ -221,7 +221,7 @@ void BM_face_interp_from_face(BMesh *bm, BMFace *f_dst, const BMFace *f_src, con
|
||||
mul_v2_m3v3(cos_2d[i], axis_mat, l_iter->v->co);
|
||||
blocks_l[i] = l_iter->head.data;
|
||||
if (do_vertex) blocks_v[i] = l_iter->v->head.data;
|
||||
} while (i++, (l_iter = l_iter->next) != l_first);
|
||||
} while ((void)i++, (l_iter = l_iter->next) != l_first);
|
||||
|
||||
BM_face_interp_from_face_ex(bm, f_dst, f_src, do_vertex,
|
||||
blocks_l, blocks_v, cos_2d, axis_mat);
|
||||
@@ -650,7 +650,7 @@ void BM_loop_interp_from_face(
|
||||
if (do_vertex) {
|
||||
vblocks[i] = l_iter->v->head.data;
|
||||
}
|
||||
} while (i++, (l_iter = l_iter->next) != l_first);
|
||||
} while ((void)i++, (l_iter = l_iter->next) != l_first);
|
||||
|
||||
mul_v2_m3v3(co, axis_mat, l_dst->v->co);
|
||||
|
||||
@@ -687,7 +687,7 @@ void BM_vert_interp_from_face(BMesh *bm, BMVert *v_dst, const BMFace *f_src)
|
||||
do {
|
||||
mul_v2_m3v3(cos_2d[i], axis_mat, l_iter->v->co);
|
||||
blocks[i] = l_iter->v->head.data;
|
||||
} while (i++, (l_iter = l_iter->next) != l_first);
|
||||
} while ((void)i++, (l_iter = l_iter->next) != l_first);
|
||||
|
||||
mul_v2_m3v3(co, axis_mat, v_dst->co);
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ BLI_INLINE void BMO_slot_map_int_insert(
|
||||
{
|
||||
union { void *ptr; int val; } t = {NULL};
|
||||
BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_INT);
|
||||
BMO_slot_map_insert(op, slot, element, ((t.val = val), t.ptr));
|
||||
BMO_slot_map_insert(op, slot, element, ((void)(t.val = val), t.ptr));
|
||||
}
|
||||
|
||||
ATTR_NONNULL(1, 2)
|
||||
@@ -92,7 +92,7 @@ BLI_INLINE void BMO_slot_map_bool_insert(
|
||||
{
|
||||
union { void *ptr; bool val; } t = {NULL};
|
||||
BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_BOOL);
|
||||
BMO_slot_map_insert(op, slot, element, ((t.val = val), t.ptr));
|
||||
BMO_slot_map_insert(op, slot, element, ((void)(t.val = val), t.ptr));
|
||||
}
|
||||
|
||||
ATTR_NONNULL(1, 2)
|
||||
@@ -102,7 +102,7 @@ BLI_INLINE void BMO_slot_map_float_insert(
|
||||
{
|
||||
union { void *ptr; float val; } t = {NULL};
|
||||
BLI_assert(slot->slot_subtype.map == BMO_OP_SLOT_SUBTYPE_MAP_FLT);
|
||||
BMO_slot_map_insert(op, slot, element, ((t.val = val), t.ptr));
|
||||
BMO_slot_map_insert(op, slot, element, ((void)(t.val = val), t.ptr));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@ bool BM_face_split_edgenet(
|
||||
mul_v2_m3v3(cos_2d[i], axis_mat, l_iter->v->co);
|
||||
blocks[i] = l_iter->head.data;
|
||||
|
||||
} while (i++, (l_iter = l_iter->next) != l_first);
|
||||
} while ((void)i++, (l_iter = l_iter->next) != l_first);
|
||||
|
||||
|
||||
for (i = 0; i < edge_net_len; i++) {
|
||||
|
||||
@@ -1951,7 +1951,7 @@ bool BM_face_exists(BMVert **varr, int len, BMFace **r_existface)
|
||||
if (l_walk->v != varr[i_walk]) {
|
||||
break;
|
||||
}
|
||||
} while ((l_walk = l_walk->next), ++i_walk != len);
|
||||
} while ((void)(l_walk = l_walk->next), ++i_walk != len);
|
||||
}
|
||||
else if (l_iter_radial->prev->v == varr[1]) {
|
||||
BMLoop *l_walk = l_iter_radial->prev->prev;
|
||||
@@ -1959,7 +1959,7 @@ bool BM_face_exists(BMVert **varr, int len, BMFace **r_existface)
|
||||
if (l_walk->v != varr[i_walk]) {
|
||||
break;
|
||||
}
|
||||
} while ((l_walk = l_walk->prev), ++i_walk != len);
|
||||
} while ((void)(l_walk = l_walk->prev), ++i_walk != len);
|
||||
}
|
||||
|
||||
if (i_walk == len) {
|
||||
|
||||
@@ -54,7 +54,8 @@ static void bm_bridge_splice_loops(BMesh *bm, LinkData *el_a, LinkData *el_b, co
|
||||
interp_v3_v3v3(v_b->co, v_a->co, v_b->co, merge_factor);
|
||||
BLI_assert(v_a != v_b);
|
||||
BMO_slot_map_elem_insert(&op_weld, slot_targetmap, v_a, v_b);
|
||||
} while ((el_b = el_b->next),
|
||||
} while ((void)
|
||||
(el_b = el_b->next),
|
||||
(el_a = el_a->next));
|
||||
|
||||
BMO_op_exec(bm, &op_weld);
|
||||
@@ -95,7 +96,8 @@ static float bm_edgeloop_offset_length(
|
||||
BLI_assert(el_a->prev == NULL); /* must be first */
|
||||
do {
|
||||
len += len_v3v3(((BMVert *)el_a->data)->co, ((BMVert *)el_b->data)->co);
|
||||
} while ((el_b = el_b->next ? el_b->next : el_b_first),
|
||||
} while ((void)
|
||||
(el_b = el_b->next ? el_b->next : el_b_first),
|
||||
(el_a = el_a->next) && (len < len_max));
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ void bmo_dissolve_degenerate_exec(BMesh *bm, BMOperator *op)
|
||||
if (
|
||||
/* check the loop hasn't already been tested (and flag not to test again) */
|
||||
!BM_elem_flag_test(l_iter, BM_ELEM_TAG) &&
|
||||
(BM_elem_flag_enable(l_iter, BM_ELEM_TAG),
|
||||
((void)BM_elem_flag_enable(l_iter, BM_ELEM_TAG),
|
||||
|
||||
/* check we're marked to tested (radial edge already tested) */
|
||||
BMO_elem_flag_test(bm, l_iter->prev->e, EDGE_MARK) &&
|
||||
|
||||
@@ -170,7 +170,8 @@ static BMFace *bmo_face_copy(
|
||||
l_iter_dst = BM_FACE_FIRST_LOOP(f_dst);
|
||||
do {
|
||||
BM_elem_attrs_copy(bm_src, bm_dst, l_iter_src, l_iter_dst);
|
||||
} while ((l_iter_dst = l_iter_dst->next),
|
||||
} while ((void)
|
||||
(l_iter_dst = l_iter_dst->next),
|
||||
(l_iter_src = l_iter_src->next) != l_first_src);
|
||||
|
||||
/* Mark the face for output */
|
||||
|
||||
@@ -116,7 +116,8 @@ void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op)
|
||||
}
|
||||
}
|
||||
|
||||
} while (((l_new = l_new->next),
|
||||
} while (((void)
|
||||
(l_new = l_new->next),
|
||||
(l_org = l_org->next)) != l_org_first);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ static void bm_interp_face_store(InterpFace *iface, BMesh *bm, BMFace *f, MemAre
|
||||
|
||||
/* use later for index lookups */
|
||||
BM_elem_index_set(l_iter, i); /* set_dirty */
|
||||
} while (i++, (l_iter = l_iter->next) != l_first);
|
||||
} while ((void)i++, (l_iter = l_iter->next) != l_first);
|
||||
bm->elem_index_dirty |= BM_LOOP;
|
||||
}
|
||||
static void bm_interp_face_free(InterpFace *iface, BMesh *bm)
|
||||
@@ -293,7 +293,7 @@ static void bmo_face_inset_individual(
|
||||
|
||||
/* unrelated to splitting, but calc here */
|
||||
BM_edge_calc_face_tangent(l_iter->e, l_iter, edge_nors[i]);
|
||||
} while (i++, ((l_iter = l_iter->next) != l_first));
|
||||
} while ((void)i++, ((l_iter = l_iter->next) != l_first));
|
||||
|
||||
|
||||
/* build rim faces */
|
||||
@@ -324,7 +324,7 @@ static void bmo_face_inset_individual(
|
||||
BM_elem_attrs_copy(bm, bm, l_iter->next, l_other);
|
||||
BM_elem_attrs_copy(bm, bm, l_iter, l_other->next);
|
||||
}
|
||||
} while (i++, ((l_iter = l_iter->next) != l_first));
|
||||
} while ((void)i++, ((l_iter = l_iter->next) != l_first));
|
||||
|
||||
/* hold interpolation values */
|
||||
if (use_interpolate) {
|
||||
@@ -376,14 +376,14 @@ static void bmo_face_inset_individual(
|
||||
|
||||
|
||||
copy_v3_v3(coords[i], v_new_co);
|
||||
} while (i++, ((l_iter = l_iter->next) != l_first));
|
||||
} while ((void)i++, ((l_iter = l_iter->next) != l_first));
|
||||
|
||||
/* update the coords */
|
||||
l_iter = l_first;
|
||||
i = 0;
|
||||
do {
|
||||
copy_v3_v3(l_iter->v->co, coords[i]);
|
||||
} while (i++, ((l_iter = l_iter->next) != l_first));
|
||||
} while ((void)i++, ((l_iter = l_iter->next) != l_first));
|
||||
|
||||
|
||||
if (use_interpolate) {
|
||||
|
||||
@@ -140,7 +140,7 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op)
|
||||
offset_fac += len_v3v3(f_center, l_iter->v->co);
|
||||
}
|
||||
|
||||
} while (i++, (l_iter = l_iter->next) != l_first);
|
||||
} while ((void)i++, (l_iter = l_iter->next) != l_first);
|
||||
|
||||
if (use_relative_offset) {
|
||||
offset_fac /= (float)f->len;
|
||||
|
||||
@@ -635,7 +635,6 @@ void BM_mesh_calc_uvs_sphere(BMesh *bm, const short oflag)
|
||||
|
||||
void bmo_create_monkey_exec(BMesh *bm, BMOperator *op)
|
||||
{
|
||||
BMVert *eve;
|
||||
BMVert **tv = MEM_mallocN(sizeof(*tv) * monkeynv * 2, "tv");
|
||||
float mat[4][4];
|
||||
int i;
|
||||
@@ -653,9 +652,14 @@ void bmo_create_monkey_exec(BMesh *bm, BMOperator *op)
|
||||
tv[i] = BM_vert_create(bm, v, NULL, BM_CREATE_NOP);
|
||||
BMO_elem_flag_enable(bm, tv[i], VERT_MARK);
|
||||
|
||||
tv[monkeynv + i] = (fabsf(v[0] = -v[0]) < 0.001f) ?
|
||||
tv[i] :
|
||||
(eve = BM_vert_create(bm, v, NULL, BM_CREATE_NOP), mul_m4_v3(mat, eve->co), eve);
|
||||
if (fabsf(v[0] = -v[0]) < 0.001f) {
|
||||
tv[monkeynv + i] = tv[i];
|
||||
}
|
||||
else {
|
||||
BMVert *eve = BM_vert_create(bm, v, NULL, BM_CREATE_NOP);
|
||||
mul_m4_v3(mat, eve->co);
|
||||
tv[monkeynv + i] = eve;
|
||||
}
|
||||
|
||||
BMO_elem_flag_enable(bm, tv[monkeynv + i], VERT_MARK);
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ finally:
|
||||
l_iter = l_first = BM_FACE_FIRST_LOOP(f_new);
|
||||
do {
|
||||
BM_elem_attrs_copy(bm, bm, loops[i], l_iter);
|
||||
} while (i++, (l_iter = l_iter->next) != l_first);
|
||||
} while ((void)i++, (l_iter = l_iter->next) != l_first);
|
||||
|
||||
return f_new;
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ static int deg_debug_node_color_index(const DepsNode *node)
|
||||
OperationDepsNode *op_node = (OperationDepsNode *)node;
|
||||
if (op_node->is_noop())
|
||||
return 8;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
@@ -161,7 +161,7 @@ static void mouse_mesh_shortest_path_vert(
|
||||
verttag_set_cb((BMVert *)node->link, !all_set, &user_data);
|
||||
v_dst_last = node->link;
|
||||
}
|
||||
} while (depth++, (node = node->next));
|
||||
} while ((void)depth++, (node = node->next));
|
||||
|
||||
BLI_linklist_free(path, NULL);
|
||||
}
|
||||
@@ -336,7 +336,7 @@ static void mouse_mesh_shortest_path_edge(
|
||||
edgetag_set_cb((BMEdge *)node->link, !all_set, &user_data);
|
||||
e_dst_last = node->link;
|
||||
}
|
||||
} while (depth++, (node = node->next));
|
||||
} while ((void)depth++, (node = node->next));
|
||||
|
||||
BLI_linklist_free(path, NULL);
|
||||
}
|
||||
@@ -466,7 +466,7 @@ static void mouse_mesh_shortest_path_face(
|
||||
facetag_set_cb((BMFace *)node->link, !all_set, &user_data);
|
||||
f_dst_last = node->link;
|
||||
}
|
||||
} while (depth++, (node = node->next));
|
||||
} while ((void)depth++, (node = node->next));
|
||||
|
||||
BLI_linklist_free(path, NULL);
|
||||
}
|
||||
|
||||
@@ -1065,7 +1065,8 @@ static bool bm_vert_connect_select_history(BMesh *bm)
|
||||
else {
|
||||
changed |= bm_vert_connect_pair(bm, (BMVert *)ese_last->ele, (BMVert *)ese->ele);
|
||||
}
|
||||
} while ((ese_last = ese),
|
||||
} while ((void)
|
||||
(ese_last = ese),
|
||||
(ese = ese->next));
|
||||
|
||||
if (changed) {
|
||||
@@ -1105,7 +1106,8 @@ static bool bm_vert_connect_select_history(BMesh *bm)
|
||||
BM_edge_select_set(bm, e, true);
|
||||
changed = true;
|
||||
}
|
||||
} while ((ese_prev = ese),
|
||||
} while ((void)
|
||||
(ese_prev = ese),
|
||||
(ese = ese->next));
|
||||
|
||||
if (changed == false) {
|
||||
|
||||
@@ -2284,7 +2284,7 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
|
||||
|
||||
size_from = axis_from;
|
||||
}
|
||||
else if ((PyErr_Clear()), /* run but ignore the result */
|
||||
else if (((void)PyErr_Clear()), /* run but ignore the result */
|
||||
(size_from = mathutils_array_parse(vec_assign, 2, 4, value,
|
||||
"mathutils.Vector.**** = swizzle assignment")) == -1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user