Custom Data API: redundant pointer-to-pointer arg
authorCampbell Barton <ideasman42@gmail.com>
Wed, 24 Sep 2014 08:50:29 +0000 (18:50 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 24 Sep 2014 08:50:29 +0000 (18:50 +1000)
source/blender/blenkernel/BKE_customdata.h
source/blender/blenkernel/intern/customdata.c
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_interp.c

index 5a1e173f0b3619ea9134a21a9c589b6682412f97..9a6524cc9abbfdadd229121c37cf72fb67439015 100644 (file)
@@ -310,7 +310,7 @@ void CustomData_set_layer_flag(struct CustomData *data, int type, int flag);
 
 void CustomData_bmesh_set_default(struct CustomData *data, void **block);
 void CustomData_bmesh_free_block(struct CustomData *data, void **block);
-void CustomData_bmesh_free_block_data(struct CustomData *data, void **block);
+void CustomData_bmesh_free_block_data(struct CustomData *data, void *block);
 
 /* copy custom data to/from layers as in mesh/derivedmesh, to editmesh
  * blocks of data. the CustomData's must not be compatible */
index ab3cf5851e9097ed09662d53a6c9350434de1e4d..63eb3b397b062f422026e081dd46d9b5fb96b566 100644 (file)
@@ -2554,12 +2554,12 @@ void CustomData_bmesh_free_block(CustomData *data, void **block)
 /**
  * Same as #CustomData_bmesh_free_block but zero the memory rather then freeing.
  */
-void CustomData_bmesh_free_block_data(CustomData *data, void **block)
+void CustomData_bmesh_free_block_data(CustomData *data, void *block)
 {
        const LayerTypeInfo *typeInfo;
        int i;
 
-       if (*block == NULL)
+       if (block == NULL)
                return;
 
        for (i = 0; i < data->totlayer; ++i) {
@@ -2568,13 +2568,13 @@ void CustomData_bmesh_free_block_data(CustomData *data, void **block)
 
                        if (typeInfo->free) {
                                int offset = data->layers[i].offset;
-                               typeInfo->free((char *)*block + offset, 1, typeInfo->size);
+                               typeInfo->free((char *)block + offset, 1, typeInfo->size);
                        }
                }
        }
 
        if (data->totsize)
-               memset(*block, 0, data->totsize);
+               memset(block, 0, data->totsize);
 }
 
 static void CustomData_bmesh_alloc_block(CustomData *data, void **block)
index eef1e7bbb4fdb70169a415b7956f35364f169993..e0348fea6360bd8bbd04a2cbf502ae92e001d8c6 100644 (file)
@@ -505,7 +505,7 @@ static void bm_vert_attrs_copy(BMesh *source_mesh, BMesh *target_mesh,
                return;
        }
        copy_v3_v3(target_vertex->no, source_vertex->no);
-       CustomData_bmesh_free_block_data(&target_mesh->vdata, &target_vertex->head.data);
+       CustomData_bmesh_free_block_data(&target_mesh->vdata, target_vertex->head.data);
        CustomData_bmesh_copy_data(&source_mesh->vdata, &target_mesh->vdata,
                                   source_vertex->head.data, &target_vertex->head.data);
 }
@@ -517,7 +517,7 @@ static void bm_edge_attrs_copy(BMesh *source_mesh, BMesh *target_mesh,
                BLI_assert(!"BMEdge: source and targer match");
                return;
        }
-       CustomData_bmesh_free_block_data(&target_mesh->edata, &target_edge->head.data);
+       CustomData_bmesh_free_block_data(&target_mesh->edata, target_edge->head.data);
        CustomData_bmesh_copy_data(&source_mesh->edata, &target_mesh->edata,
                                   source_edge->head.data, &target_edge->head.data);
 }
@@ -529,7 +529,7 @@ static void bm_loop_attrs_copy(BMesh *source_mesh, BMesh *target_mesh,
                BLI_assert(!"BMLoop: source and targer match");
                return;
        }
-       CustomData_bmesh_free_block_data(&target_mesh->ldata, &target_loop->head.data);
+       CustomData_bmesh_free_block_data(&target_mesh->ldata, target_loop->head.data);
        CustomData_bmesh_copy_data(&source_mesh->ldata, &target_mesh->ldata,
                                   source_loop->head.data, &target_loop->head.data);
 }
@@ -542,7 +542,7 @@ static void bm_face_attrs_copy(BMesh *source_mesh, BMesh *target_mesh,
                return;
        }
        copy_v3_v3(target_face->no, source_face->no);
-       CustomData_bmesh_free_block_data(&target_mesh->pdata, &target_face->head.data);
+       CustomData_bmesh_free_block_data(&target_mesh->pdata, target_face->head.data);
        CustomData_bmesh_copy_data(&source_mesh->pdata, &target_mesh->pdata,
                                   source_face->head.data, &target_face->head.data);
        target_face->mat_nr = source_face->mat_nr;
index 306b6e743503696309b41c1a29b68b71986022c7..a32f28169f64263d3ac614262c0768243f187c64 100644 (file)
@@ -54,7 +54,7 @@ static void bm_data_interp_from_elem(CustomData *data_layer, BMElem *ele1, BMEle
                                /* do nothing */
                        }
                        else {
-                               CustomData_bmesh_free_block_data(data_layer, &ele_dst->head.data);
+                               CustomData_bmesh_free_block_data(data_layer, ele_dst->head.data);
                                CustomData_bmesh_copy_data(data_layer, data_layer, ele1->head.data, &ele_dst->head.data);
                        }
                }
@@ -63,7 +63,7 @@ static void bm_data_interp_from_elem(CustomData *data_layer, BMElem *ele1, BMEle
                                /* do nothing */
                        }
                        else {
-                               CustomData_bmesh_free_block_data(data_layer, &ele_dst->head.data);
+                               CustomData_bmesh_free_block_data(data_layer, ele_dst->head.data);
                                CustomData_bmesh_copy_data(data_layer, data_layer, ele2->head.data, &ele_dst->head.data);
                        }
                }