[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59725] trunk/blender/source/blender/ blenlib: add hash iterator functions to access the pointer to the value.

Campbell Barton ideasman42 at gmail.com
Mon Sep 2 04:58:54 CEST 2013


Revision: 59725
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59725
Author:   campbellbarton
Date:     2013-09-02 02:58:53 +0000 (Mon, 02 Sep 2013)
Log Message:
-----------
add hash iterator functions to access the pointer to the value.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_edgehash.h
    trunk/blender/source/blender/blenlib/BLI_ghash.h
    trunk/blender/source/blender/blenlib/intern/BLI_ghash.c
    trunk/blender/source/blender/blenlib/intern/edgehash.c

Modified: trunk/blender/source/blender/blenlib/BLI_edgehash.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_edgehash.h	2013-09-02 00:47:27 UTC (rev 59724)
+++ trunk/blender/source/blender/blenlib/BLI_edgehash.h	2013-09-02 02:58:53 UTC (rev 59725)
@@ -62,6 +62,7 @@
 void                BLI_edgehashIterator_free(EdgeHashIterator *ehi);
 void                BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *v0_r, unsigned int *v1_r);
 void               *BLI_edgehashIterator_getValue(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT;
+void              **BLI_edgehashIterator_getValue_p(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT;
 void                BLI_edgehashIterator_setValue(EdgeHashIterator *ehi, void *val);
 void                BLI_edgehashIterator_step(EdgeHashIterator *ehi);
 bool                BLI_edgehashIterator_isDone(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT;

Modified: trunk/blender/source/blender/blenlib/BLI_ghash.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_ghash.h	2013-09-02 00:47:27 UTC (rev 59724)
+++ trunk/blender/source/blender/blenlib/BLI_ghash.h	2013-09-02 02:58:53 UTC (rev 59725)
@@ -86,6 +86,7 @@
 
 void          *BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
 void          *BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
+void         **BLI_ghashIterator_getValue_p(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
 
 void           BLI_ghashIterator_step(GHashIterator *ghi);
 bool           BLI_ghashIterator_done(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;

Modified: trunk/blender/source/blender/blenlib/intern/BLI_ghash.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_ghash.c	2013-09-02 00:47:27 UTC (rev 59724)
+++ trunk/blender/source/blender/blenlib/intern/BLI_ghash.c	2013-09-02 02:58:53 UTC (rev 59725)
@@ -602,6 +602,18 @@
 }
 
 /**
+ * Retrieve the value from an iterator.
+ *
+ * \param ghi The iterator.
+ * \return The value at the current index, or NULL if the
+ * iterator is done.
+ */
+void **BLI_ghashIterator_getValue_p(GHashIterator *ghi)
+{
+	return ghi->curEntry ? &ghi->curEntry->val : NULL;
+}
+
+/**
  * Steps the iterator to the next index.
  *
  * \param ghi The iterator.

Modified: trunk/blender/source/blender/blenlib/intern/edgehash.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/edgehash.c	2013-09-02 00:47:27 UTC (rev 59724)
+++ trunk/blender/source/blender/blenlib/intern/edgehash.c	2013-09-02 02:58:53 UTC (rev 59725)
@@ -484,6 +484,14 @@
 }
 
 /**
+ * Retrieve the pointer to the value from an iterator.
+ */
+void **BLI_edgehashIterator_getValue_p(EdgeHashIterator *ehi)
+{
+	return ehi->curEntry ? &ehi->curEntry->val : NULL;
+}
+
+/**
  * Set the value for an iterator.
  */
 void BLI_edgehashIterator_setValue(EdgeHashIterator *ehi, void *val)




More information about the Bf-blender-cvs mailing list