[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59370] trunk/blender/source/blender: rename recently added BLI_ghash_assign() -> BLI_ghash_reinsert()

Campbell Barton ideasman42 at gmail.com
Wed Aug 21 18:06:04 CEST 2013


Revision: 59370
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59370
Author:   campbellbarton
Date:     2013-08-21 16:06:03 +0000 (Wed, 21 Aug 2013)
Log Message:
-----------
rename recently added BLI_ghash_assign() -> BLI_ghash_reinsert()

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/pbvh_bmesh.c
    trunk/blender/source/blender/blenlib/BLI_ghash.h
    trunk/blender/source/blender/blenlib/intern/BLI_ghash.c
    trunk/blender/source/blender/bmesh/intern/bmesh_log.c
    trunk/blender/source/blender/makesrna/intern/rna_define.c

Modified: trunk/blender/source/blender/blenkernel/intern/pbvh_bmesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/pbvh_bmesh.c	2013-08-21 16:00:53 UTC (rev 59369)
+++ trunk/blender/source/blender/blenkernel/intern/pbvh_bmesh.c	2013-08-21 16:06:03 UTC (rev 59370)
@@ -368,7 +368,7 @@
 	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);

Modified: trunk/blender/source/blender/blenlib/BLI_ghash.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_ghash.h	2013-08-21 16:00:53 UTC (rev 59369)
+++ trunk/blender/source/blender/blenlib/BLI_ghash.h	2013-08-21 16:06:03 UTC (rev 59370)
@@ -59,7 +59,7 @@
 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);

Modified: trunk/blender/source/blender/blenlib/intern/BLI_ghash.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_ghash.c	2013-08-21 16:00:53 UTC (rev 59369)
+++ trunk/blender/source/blender/blenlib/intern/BLI_ghash.c	2013-08-21 16:06:03 UTC (rev 59370)
@@ -177,11 +177,8 @@
 /**
  * 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);

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_log.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_log.c	2013-08-21 16:00:53 UTC (rev 59369)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_log.c	2013-08-21 16:06:03 UTC (rev 59370)
@@ -118,8 +118,8 @@
 {
 	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 @@
 {
 	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 */

Modified: trunk/blender/source/blender/makesrna/intern/rna_define.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_define.c	2013-08-21 16:00:53 UTC (rev 59369)
+++ trunk/blender/source/blender/makesrna/intern/rna_define.c	2013-08-21 16:06:03 UTC (rev 59370)
@@ -3208,7 +3208,7 @@
 	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);




More information about the Bf-blender-cvs mailing list