use math functions for copying matrix/vector types, also cast const pointers for...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 26 Jul 2013 10:43:23 +0000 (10:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 26 Jul 2013 10:43:23 +0000 (10:43 +0000)
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/bmesh/intern/bmesh_operators.c
source/blender/modifiers/intern/MOD_simpledeform.c
source/blender/modifiers/intern/MOD_skin.c

index 720500d188b263a260847bd44fcca1dd84a0bf1d..feb18c3babeeeaab8522b4b96b755506c066d054 100644 (file)
@@ -1582,17 +1582,17 @@ static void emDM_release(DerivedMesh *dm)
 
        if (DM_release(dm)) {
                if (bmdm->vertexCos) {
-                       MEM_freeN(bmdm->vertexCos);
+                       MEM_freeN((void *)bmdm->vertexCos);
                        if (bmdm->vertexNos) {
-                               MEM_freeN(bmdm->vertexNos);
+                               MEM_freeN((void *)bmdm->vertexNos);
                        }
                        if (bmdm->polyNos) {
-                               MEM_freeN(bmdm->polyNos);
+                               MEM_freeN((void *)bmdm->polyNos);
                        }
                }
 
                if (bmdm->polyCos) {
-                       MEM_freeN(bmdm->polyCos);
+                       MEM_freeN((void *)bmdm->polyCos);
                }
 
                MEM_freeN(bmdm);
index 63c00d5b5456e0cdf92b31cc061c12f8ebaf01e0..e0268d6b504fc3c05a94cb404461dd0ef810f0fa 100644 (file)
@@ -411,7 +411,7 @@ void BMO_slot_mat_set(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], cons
        slot->data.p = BLI_memarena_alloc(op->arena, sizeof(float) * 4 * 4);
        
        if (size == 4) {
-               memcpy(slot->data.p, mat, sizeof(float) * 4 * 4);
+               copy_m4_m4(slot->data.p, (float (*)[4])mat);
        }
        else if (size == 3) {
                copy_m4_m3(slot->data.p, (float (*)[3])mat);
index d6dc8482ee2c370d0729d548b52d878aa03c7e60..d260312fe3d3a22e727ed62fb42e68f0f39b0c87 100644 (file)
@@ -262,7 +262,7 @@ static void copyData(ModifierData *md, ModifierData *target)
        tsmd->axis  = smd->axis;
        tsmd->origin = smd->origin;
        tsmd->factor = smd->factor;
-       memcpy(tsmd->limit, smd->limit, sizeof(tsmd->limit));
+       copy_v2_v2(tsmd->limit, smd->limit);
        BLI_strncpy(tsmd->vgroup_name, smd->vgroup_name, sizeof(tsmd->vgroup_name));
 }
 
index daf0e5c9dc34113decba4def9b0ffd5e9de3f5a4..91dcf721e4b37c35486ccdca143c8986fb65e74a 100644 (file)
@@ -690,7 +690,7 @@ static void build_emats_stack(BLI_Stack *stack, int *visited_e, EMat *emat,
        /* Add neighbors to stack */
        for (i = 0; i < emap[v].count; i++) {
                /* Add neighbors to stack */
-               memcpy(stack_elem.mat, emat[e].mat, sizeof(float) * 3 * 3);
+               copy_m3_m3(stack_elem.mat, emat[e].mat);
                stack_elem.e = emap[v].indices[i];
                stack_elem.parent_v = v;
                BLI_stack_push(stack, &stack_elem);