[GRASS-SVN] r71477 - grass/trunk/lib/vector/dglib

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 7 12:47:03 PDT 2017


Author: mmetz
Date: 2017-09-07 12:47:02 -0700 (Thu, 07 Sep 2017)
New Revision: 71477

Modified:
   grass/trunk/lib/vector/dglib/graph_v1.h
   grass/trunk/lib/vector/dglib/graph_v2.h
Log:
dglib: fix pointer casting

Modified: grass/trunk/lib/vector/dglib/graph_v1.h
===================================================================
--- grass/trunk/lib/vector/dglib/graph_v1.h	2017-09-07 14:22:34 UTC (rev 71476)
+++ grass/trunk/lib/vector/dglib/graph_v1.h	2017-09-07 19:47:02 UTC (rev 71477)
@@ -103,13 +103,13 @@
  * Node Buffer Utilities
  */
 #define DGL_NODEBUFFER_SHIFT_v1(pgrp,o)		((dglInt32_t*)((pgrp)->pNodeBuffer + (o)))
-#define DGL_NODEBUFFER_OFFSET_v1(pgrp,p)	((dglInt32_t)(p - (dglInt32_t *)(pgrp)->pNodeBuffer))
+#define DGL_NODEBUFFER_OFFSET_v1(pgrp,p)	((dglInt32_t)((dglByte_t *)p - (dglByte_t *)(pgrp)->pNodeBuffer))
 
 /*
  * Edge Buffer Utilities
  */
 #define DGL_EDGEBUFFER_SHIFT_v1(pgrp,o)		((dglInt32_t*)((pgrp)->pEdgeBuffer + (o)))
-#define DGL_EDGEBUFFER_OFFSET_v1(pgrp,pl)	((dglInt32_t)(pl - (dglInt32_t *)(pgrp)->pEdgeBuffer))
+#define DGL_EDGEBUFFER_OFFSET_v1(pgrp,pl)	((dglInt32_t)((dglByte_t *)pl - (dglByte_t *)(pgrp)->pEdgeBuffer))
 
 
 

Modified: grass/trunk/lib/vector/dglib/graph_v2.h
===================================================================
--- grass/trunk/lib/vector/dglib/graph_v2.h	2017-09-07 14:22:34 UTC (rev 71476)
+++ grass/trunk/lib/vector/dglib/graph_v2.h	2017-09-07 19:47:02 UTC (rev 71477)
@@ -106,13 +106,13 @@
  * Node Buffer Utilities
  */
 #define DGL_NODEBUFFER_SHIFT_v2(pgrp,o)		((dglInt32_t*)((pgrp)->pNodeBuffer + (o)))
-#define DGL_NODEBUFFER_OFFSET_v2(pgrp,p)		((dglInt32_t)(p - (dglInt32_t *)(pgrp)->pNodeBuffer))
+#define DGL_NODEBUFFER_OFFSET_v2(pgrp,p)		((dglInt32_t)((dglByte_t *)p - (dglByte_t *)(pgrp)->pNodeBuffer))
 
 /*
  * Edge Buffer Utilities
  */
 #define DGL_EDGEBUFFER_SHIFT_v2(pgrp,o)		((dglInt32_t*)((pgrp)->pEdgeBuffer + (o)))
-#define DGL_EDGEBUFFER_OFFSET_v2(pgrp,pl)		((dglInt32_t)(pl - (dglInt32_t *)(pgrp)->pEdgeBuffer))
+#define DGL_EDGEBUFFER_OFFSET_v2(pgrp,pl)		((dglInt32_t)((dglByte_t *)pl - (dglByte_t *)(pgrp)->pEdgeBuffer))
 
 
 



More information about the grass-commit mailing list