fix coverity issue 1258907 Division or modulo by float zero
This commit is contained in:
		
							parent
							
								
									79de97d814
								
							
						
					
					
						commit
						d31c6fe286
					
				| @ -44,6 +44,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||
| #include <gdal/ogrsf_frmts.h> | #include <gdal/ogrsf_frmts.h> | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | #include <osrm/Coordinate.h> | ||||||
|  | 
 | ||||||
| #include <fstream> | #include <fstream> | ||||||
| #include <memory> | #include <memory> | ||||||
| #include <string> | #include <string> | ||||||
| @ -142,7 +144,7 @@ int main(int argc, char *argv[]) | |||||||
|         traffic_lights_list.clear(); |         traffic_lights_list.clear(); | ||||||
|         traffic_lights_list.shrink_to_fit(); |         traffic_lights_list.shrink_to_fit(); | ||||||
| 
 | 
 | ||||||
|         // Building an node-based graph 
 |         // Building an node-based graph
 | ||||||
|         DeallocatingVector<TarjanEdge> graph_edge_list; |         DeallocatingVector<TarjanEdge> graph_edge_list; | ||||||
|         for (const NodeBasedEdge &input_edge : edge_list) |         for (const NodeBasedEdge &input_edge : edge_list) | ||||||
|         { |         { | ||||||
| @ -190,7 +192,7 @@ int main(int argc, char *argv[]) | |||||||
|         DeleteFileIfExists("component.shx"); |         DeleteFileIfExists("component.shx"); | ||||||
|         DeleteFileIfExists("component.shp"); |         DeleteFileIfExists("component.shp"); | ||||||
| 
 | 
 | ||||||
|         Percent p(number_of_nodes); |         Percent p(graph->GetNumberOfNodes()); | ||||||
| 
 | 
 | ||||||
|         OGRRegisterAll(); |         OGRRegisterAll(); | ||||||
| 
 | 
 | ||||||
| @ -221,10 +223,9 @@ int main(int argc, char *argv[]) | |||||||
|         SimpleLogger().Write() << "shapefile setup took " << TIMER_MSEC(SCC_RUN_SETUP)/1000. << "s"; |         SimpleLogger().Write() << "shapefile setup took " << TIMER_MSEC(SCC_RUN_SETUP)/1000. << "s"; | ||||||
| 
 | 
 | ||||||
|         uint64_t total_network_distance = 0; |         uint64_t total_network_distance = 0; | ||||||
|         p.reinit(number_of_nodes); |         p.reinit(graph->GetNumberOfNodes()); | ||||||
|         // const NodeID last_u_node = m_node_based_graph->GetNumberOfNodes();
 |  | ||||||
|         TIMER_START(SCC_OUTPUT); |         TIMER_START(SCC_OUTPUT); | ||||||
|         for (const NodeID source : osrm::irange(0u, number_of_nodes)) |         for (const NodeID source : osrm::irange(0u, graph->GetNumberOfNodes())) | ||||||
|         { |         { | ||||||
|             p.printIncrement(); |             p.printIncrement(); | ||||||
|             for (const auto current_edge : graph->GetAdjacentEdgeRange(source)) |             for (const auto current_edge : graph->GetAdjacentEdgeRange(source)) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user