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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-08 16:35:14 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-08 16:35:14 +0400
commitec33687d6cf74775e37fdc1a14e22dea08289cb1 (patch)
treea98875cf3deae05c46cdd70192858b8844ab1ea4 /source/blender/bmesh/intern
parent724746dba2deed8e336fc66b36bfc3b5b1858a8e (diff)
parent7b9adab594d1cc670d642b56ae8d76069ce91107 (diff)
Merged changes in the trunk up to revision 52815.
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c11
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.h6
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.c2
3 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index ba5e7569c31..590edc45d07 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -42,8 +42,8 @@
#include "intern/bmesh_private.h"
/* used as an extern, defined in bmesh.h */
-BMAllocTemplate bm_mesh_allocsize_default = {512, 1024, 2048, 512};
-BMAllocTemplate bm_mesh_chunksize_default = {512, 1024, 2048, 512};
+const BMAllocTemplate bm_mesh_allocsize_default = {512, 1024, 2048, 512};
+const BMAllocTemplate bm_mesh_chunksize_default = {512, 1024, 2048, 512};
static void bm_mempool_init(BMesh *bm, const BMAllocTemplate *allocsize)
{
@@ -109,7 +109,7 @@ void BM_mesh_elem_toolflags_clear(BMesh *bm)
*
* \note ob is needed by multires
*/
-BMesh *BM_mesh_create(BMAllocTemplate *allocsize)
+BMesh *BM_mesh_create(const BMAllocTemplate *allocsize)
{
/* allocate the structure */
BMesh *bm = MEM_callocN(sizeof(BMesh), __func__);
@@ -206,6 +206,11 @@ void BM_mesh_clear(BMesh *bm)
bm->stackdepth = 1;
bm->totflags = 1;
+
+ CustomData_reset(&bm->vdata);
+ CustomData_reset(&bm->edata);
+ CustomData_reset(&bm->ldata);
+ CustomData_reset(&bm->pdata);
}
/**
diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h
index b592f863cd1..8baba568fb8 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.h
+++ b/source/blender/bmesh/intern/bmesh_mesh.h
@@ -31,7 +31,7 @@ struct BMAllocTemplate;
void BM_mesh_elem_toolflags_ensure(BMesh *bm);
void BM_mesh_elem_toolflags_clear(BMesh *bm);
-BMesh *BM_mesh_create(struct BMAllocTemplate *allocsize);
+BMesh *BM_mesh_create(const struct BMAllocTemplate *allocsize);
void BM_mesh_free(BMesh *bm);
void BM_mesh_data_free(BMesh *bm);
@@ -57,8 +57,8 @@ typedef struct BMAllocTemplate {
int totvert, totedge, totloop, totface;
} BMAllocTemplate;
-extern BMAllocTemplate bm_mesh_allocsize_default;
-extern BMAllocTemplate bm_mesh_chunksize_default;
+extern const BMAllocTemplate bm_mesh_allocsize_default;
+extern const BMAllocTemplate bm_mesh_chunksize_default;
enum {
BM_MESH_CREATE_USE_TOOLFLAGS = (1 << 0)
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c
index ba38f230f0b..baec0b7745d 100644
--- a/source/blender/bmesh/intern/bmesh_operators.c
+++ b/source/blender/bmesh/intern/bmesh_operators.c
@@ -256,7 +256,7 @@ BMOpSlot *BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identif
if (UNLIKELY(slot_code < 0)) {
//return &BMOpEmptySlot;
BLI_assert(0);
- NULL; /* better crash */
+ return NULL; /* better crash */
}
return &slot_args[slot_code];