Browse Source

Vlib: Stephan Turek: fix node costs

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56680 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 years ago
parent
commit
e21edada02
1 changed files with 3 additions and 2 deletions
  1. 3 2
      lib/vector/Vlib/net.c

+ 3 - 2
lib/vector/Vlib/net.c

@@ -98,6 +98,7 @@ Vect_net_build_graph(struct Map_info *Map,
     double dcost, bdcost, ll;
     int cost, bcost;
     dglGraph_s *gr;
+    dglInt32_t dgl_cost;
     dglInt32_t opaqueset[16] =
 	{ 360000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
     struct field_info *Fi;
@@ -426,9 +427,9 @@ Vect_net_build_graph(struct Map_info *Map,
 	    else {
 		cost = (dglInt32_t) Map->dgraph.cost_multip * dcost;
 	    }
+	    dgl_cost = cost;
 	    G_debug(3, "Set node's cost to %d", cost);
-	    dglNodeSet_Attr(gr, dglGetNode(gr, (dglInt32_t) i),
-			    (dglInt32_t *) (dglInt32_t) & cost);
+	    dglNodeSet_Attr(gr, dglGetNode(gr, (dglInt32_t) i), &dgl_cost);
 	    Map->dgraph.node_costs[i] = dcost;
 	}
 	db_close_database_shutdown_driver(driver);