diff options
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_bmesh.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_ghash.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 5 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_log.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 2 |
5 files changed, 8 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index bc2a47a540b..5aae6276a79 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -368,7 +368,7 @@ static void pbvh_bmesh_vert_ownership_transfer(PBVH *bvh, PBVHNode *new_owner, BLI_ghash_remove(current_owner->bm_unique_verts, v, NULL, NULL); /* Set new ownership */ - BLI_ghash_assign(bvh->bm_vert_to_node, v, + BLI_ghash_reinsert(bvh->bm_vert_to_node, v, SET_INT_IN_POINTER(new_owner - bvh->nodes), NULL, NULL); BLI_ghash_insert(new_owner->bm_unique_verts, v, NULL); BLI_ghash_remove(new_owner->bm_other_verts, v, NULL, NULL); diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index 97dbcc051c4..8e9558de53a 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -59,7 +59,7 @@ enum { GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info); void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp); void BLI_ghash_insert(GHash *gh, void *key, void *val); -void BLI_ghash_assign(GHash *gh, void *key, void *val, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp); +void BLI_ghash_reinsert(GHash *gh, void *key, void *val, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp); void *BLI_ghash_lookup(GHash *gh, const void *key); void **BLI_ghash_lookup_p(GHash *gh, const void *key); bool BLI_ghash_remove(GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp); diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 03f5d60079b..2a8dd795549 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -177,11 +177,8 @@ void BLI_ghash_insert(GHash *gh, void *key, void *val) /** * Assign a new value to a key that may already be in ghash. * Avoids #BLI_ghash_remove, #BLI_ghash_insert calls (double lookups) - * - * \note We may want to have 'BLI_ghash_assign_ex' function that takes - * GHashKeyFreeFP & GHashValFreeFP args. for now aren't needed. */ -void BLI_ghash_assign(GHash *gh, void *key, void *val, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) +void BLI_ghash_reinsert(GHash *gh, void *key, void *val, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) { const unsigned int hash = ghash_keyhash(gh, key); Entry *e = ghash_lookup_entry_ex(gh, key, hash); diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c index 1309aa6543d..09fdb0c73f6 100644 --- a/source/blender/bmesh/intern/bmesh_log.c +++ b/source/blender/bmesh/intern/bmesh_log.c @@ -118,8 +118,8 @@ static void bm_log_vert_id_set(BMLog *log, BMVert *v, unsigned int id) { void *vid = SET_INT_IN_POINTER(id); - BLI_ghash_assign(log->id_to_elem, vid, v, NULL, NULL); - BLI_ghash_assign(log->elem_to_id, v, vid, NULL, NULL); + BLI_ghash_reinsert(log->id_to_elem, vid, v, NULL, NULL); + BLI_ghash_reinsert(log->elem_to_id, v, vid, NULL, NULL); } /* Get a vertex from its unique ID */ @@ -142,8 +142,8 @@ static void bm_log_face_id_set(BMLog *log, BMFace *f, unsigned int id) { void *fid = SET_INT_IN_POINTER(id); - BLI_ghash_assign(log->id_to_elem, fid, f, NULL, NULL); - BLI_ghash_assign(log->elem_to_id, f, fid, NULL, NULL); + BLI_ghash_reinsert(log->id_to_elem, fid, f, NULL, NULL); + BLI_ghash_reinsert(log->elem_to_id, f, fid, NULL, NULL); } /* Get a face from its unique ID */ diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 287d7ee2ed3..214fd2954f7 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -3208,7 +3208,7 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA if (prop->identifier) { if (cont->prophash) { prop->identifier = BLI_strdup(prop->identifier); - BLI_ghash_assign(cont->prophash, (void *)prop->identifier, prop, NULL, NULL); + BLI_ghash_reinsert(cont->prophash, (void *)prop->identifier, prop, NULL, NULL); } else { prop->identifier = BLI_strdup(prop->identifier); |