Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/pose_select.c3
-rw-r--r--source/blender/editors/curve/editcurve.c59
-rw-r--r--source/blender/editors/include/BIF_gl.h20
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c2
-rw-r--r--source/blender/editors/object/object_bake_api.c2
5 files changed, 39 insertions, 47 deletions
diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c
index 61386615934..76284ba44de 100644
--- a/source/blender/editors/armature/pose_select.c
+++ b/source/blender/editors/armature/pose_select.c
@@ -70,7 +70,8 @@
/* ***************** Pose Select Utilities ********************* */
/* Note: SEL_TOGGLE is assumed to have already been handled! */
-static void pose_do_bone_select(bPoseChannel *pchan, const int select_mode) {
+static void pose_do_bone_select(bPoseChannel *pchan, const int select_mode)
+{
/* select pchan only if selectable, but deselect works always */
switch (select_mode) {
case SEL_SELECT:
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 4db22154e68..b0371b8dd6c 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1165,7 +1165,7 @@ int ED_curve_updateAnimPaths(Curve *cu)
/* ********************* LOAD and MAKE *************** */
-static int *initialize_index_map(Object *obedit, int *r_old_totvert, bool reverse)
+static int *initialize_index_map(Object *obedit, int *r_old_totvert)
{
Curve *curve = (Curve *) obedit->data;
EditNurb *editnurb = curve->editnurb;
@@ -1200,29 +1200,15 @@ static int *initialize_index_map(Object *obedit, int *r_old_totvert, bool revers
while (a--) {
keyIndex = getCVKeyIndex(editnurb, bezt);
if (keyIndex) {
- if (reverse) {
- if (keyIndex->switched) {
- old_to_new_map[vertex_index] = keyIndex->vertex_index + 2;
- old_to_new_map[vertex_index + 1] = keyIndex->vertex_index + 1;
- old_to_new_map[vertex_index + 2] = keyIndex->vertex_index;
- }
- else {
- old_to_new_map[vertex_index] = keyIndex->vertex_index;
- old_to_new_map[vertex_index + 1] = keyIndex->vertex_index + 1;
- old_to_new_map[vertex_index + 2] = keyIndex->vertex_index + 2;
- }
+ if (keyIndex->switched) {
+ old_to_new_map[keyIndex->vertex_index] = vertex_index + 2;
+ old_to_new_map[keyIndex->vertex_index + 1] = vertex_index + 1;
+ old_to_new_map[keyIndex->vertex_index + 2] = vertex_index;
}
else {
- if (keyIndex->switched) {
- old_to_new_map[keyIndex->vertex_index] = vertex_index + 2;
- old_to_new_map[keyIndex->vertex_index + 1] = vertex_index + 1;
- old_to_new_map[keyIndex->vertex_index + 2] = vertex_index;
- }
- else {
- old_to_new_map[keyIndex->vertex_index] = vertex_index;
- old_to_new_map[keyIndex->vertex_index + 1] = vertex_index + 1;
- old_to_new_map[keyIndex->vertex_index + 2] = vertex_index + 2;
- }
+ old_to_new_map[keyIndex->vertex_index] = vertex_index;
+ old_to_new_map[keyIndex->vertex_index + 1] = vertex_index + 1;
+ old_to_new_map[keyIndex->vertex_index + 2] = vertex_index + 2;
}
}
vertex_index += 3;
@@ -1236,12 +1222,7 @@ static int *initialize_index_map(Object *obedit, int *r_old_totvert, bool revers
while (a--) {
keyIndex = getCVKeyIndex(editnurb, bp);
if (keyIndex) {
- if (reverse) {
- old_to_new_map[vertex_index] = keyIndex->vertex_index;
- }
- else {
- old_to_new_map[keyIndex->vertex_index] = vertex_index;
- }
+ old_to_new_map[keyIndex->vertex_index] = vertex_index;
}
vertex_index++;
bp++;
@@ -1253,7 +1234,7 @@ static int *initialize_index_map(Object *obedit, int *r_old_totvert, bool revers
return old_to_new_map;
}
-static void remap_hooks_and_vertex_parents(Object *obedit, bool reverse)
+static void remap_hooks_and_vertex_parents(Object *obedit)
{
Object *object;
Curve *curve = (Curve *) obedit->data;
@@ -1268,9 +1249,7 @@ static void remap_hooks_and_vertex_parents(Object *obedit, bool reverse)
ELEM(object->partype, PARVERT1, PARVERT3))
{
if (old_to_new_map == NULL) {
- old_to_new_map = initialize_index_map(obedit,
- &old_totvert,
- reverse);
+ old_to_new_map = initialize_index_map(obedit, &old_totvert);
}
if (object->par1 < old_totvert) {
@@ -1299,9 +1278,7 @@ static void remap_hooks_and_vertex_parents(Object *obedit, bool reverse)
int i, j;
if (old_to_new_map == NULL) {
- old_to_new_map = initialize_index_map(obedit,
- &old_totvert,
- reverse);
+ old_to_new_map = initialize_index_map(obedit, &old_totvert);
}
for (i = j = 0; i < hmd->totindex; i++) {
@@ -1338,6 +1315,8 @@ void load_editNurb(Object *obedit)
Nurb *nu, *newnu;
ListBase newnurb = {NULL, NULL}, oldnurb = cu->nurb;
+ remap_hooks_and_vertex_parents(obedit);
+
for (nu = editnurb->first; nu; nu = nu->next) {
newnu = BKE_nurb_duplicate(nu);
BLI_addtail(&newnurb, newnu);
@@ -6892,9 +6871,8 @@ void CURVE_OT_tilt_clear(wmOperatorType *ot)
/****************** undo for curves ****************/
-static void undoCurve_to_editCurve(void *ucu, void *edata, void *cu_v)
+static void undoCurve_to_editCurve(void *ucu, void *UNUSED(edata), void *cu_v)
{
- Object *obedit = (Object *) edata;
Curve *cu = cu_v;
UndoCurve *undoCurve = ucu;
ListBase *undobase = &undoCurve->nubase;
@@ -6903,8 +6881,6 @@ static void undoCurve_to_editCurve(void *ucu, void *edata, void *cu_v)
EditNurb *editnurb = cu->editnurb;
AnimData *ad = BKE_animdata_from_id(&cu->id);
- remap_hooks_and_vertex_parents(obedit, true);
-
BKE_nurbList_free(editbase);
if (undoCurve->undoIndex) {
@@ -6938,9 +6914,8 @@ static void undoCurve_to_editCurve(void *ucu, void *edata, void *cu_v)
ED_curve_updateAnimPaths(cu);
}
-static void *editCurve_to_undoCurve(void *edata, void *cu_v)
+static void *editCurve_to_undoCurve(void *UNUSED(edata), void *cu_v)
{
- Object *obedit = (Object *) edata;
Curve *cu = cu_v;
ListBase *nubase = BKE_curve_editNurbs_get(cu);
UndoCurve *undoCurve;
@@ -6976,8 +6951,6 @@ static void *editCurve_to_undoCurve(void *edata, void *cu_v)
undoCurve->actvert = cu->actvert;
undoCurve->actnu = cu->actnu;
- remap_hooks_and_vertex_parents(obedit, false);
-
return undoCurve;
}
diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h
index 477a7c0ce17..4258bbcd359 100644
--- a/source/blender/editors/include/BIF_gl.h
+++ b/source/blender/editors/include/BIF_gl.h
@@ -58,8 +58,24 @@
* */
void cpack(unsigned int x);
-#define glMultMatrixf(x) glMultMatrixf( (float *)(x))
-#define glLoadMatrixf(x) glLoadMatrixf( (float *)(x))
+
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
+# define glMultMatrixf(x) \
+ glMultMatrixf(_Generic(x, \
+ float *: (float *)(x), \
+ float (*)[4]: (float *)(x), \
+ const float *: (float *)(x), \
+ const float (*)[4]: (float *)(x)) \
+)
+# define glLoadMatrixf(x) \
+ glLoadMatrixf(_Generic(x, \
+ float *: (float *)(x), \
+ float (*)[4]: (float *)(x)) \
+)
+#else
+# define glMultMatrixf(x) glMultMatrixf((float *)(x))
+# define glLoadMatrixf(x) glLoadMatrixf((float *)(x))
+#endif
#define GLA_PIXEL_OFS 0.375f
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 3609abf6cb5..92bbd9482e2 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -3496,7 +3496,9 @@ static int edbm_dissolve_verts_exec(bContext *C, wmOperator *op)
if (!EDBM_op_callf(em, op,
"dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
BM_ELEM_SELECT, use_face_split, use_boundary_tear))
+ {
return OPERATOR_CANCELLED;
+ }
EDBM_update_generic(em, true, true);
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 57b7bab2275..66236bf9ace 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -178,7 +178,7 @@ static bool write_internal_bake_pixels(
void *lock;
bool is_float;
char *mask_buffer = NULL;
- const size_t num_pixels = width * height;
+ const size_t num_pixels = (size_t)width * (size_t)height;
ibuf = BKE_image_acquire_ibuf(image, NULL, &lock);