@@ -182,7 +182,7 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
182182 */
183183
184184 bool add_shortcut (const CH_edge &edge, V u, V v) {
185- bool inserted;
185+ bool inserted = false ;
186186 E e;
187187 if (edge.cost < 0 ) return false ;
188188
@@ -395,7 +395,7 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
395395 V u, V v, V w,
396396 std::vector<E> &shortcuts,
397397 std::ostringstream &log) {
398- bool found_e;
398+ bool found_e = false ;
399399 E e;
400400
401401 boost::tie (e, found_e) = boost::edge (u, w, this ->graph );
@@ -423,7 +423,7 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
423423 shortcut.add_contracted_edge_vertices (std::get<0 >(e2 ));
424424
425425 // Add shortcut in the current graph (to go on the process)
426- bool inserted;
426+ bool inserted = false ;
427427 E s;
428428 boost::tie (s, inserted) = boost::add_edge (u, w, this ->graph );
429429 this ->graph [s]= shortcut;
@@ -434,16 +434,15 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
434434 /* ! @brief computes p_max used in the contraction hierarchies method
435435 */
436436 int64_t compute_pmax (V u, V v, Identifiers<V> out_vertices) {
437- int64_t p_max;
437+ int64_t p_max = 0 ;
438438 E e, f;
439- bool found_e;
440- p_max = 0 ;
439+ bool found_e = false ;
441440 boost::tie (e, found_e) = boost::edge (u, v, this ->graph );
442441
443442 if (found_e) {
444443 p_max = this ->graph [e].cost ;
445444 for (V w : out_vertices) {
446- bool found_f;
445+ bool found_f = false ;
447446 boost::tie (f, found_f) = boost::edge (v, w, this ->graph );
448447 if ((found_f) && (u != w)) {
449448 if ((this ->graph [e].cost + this ->graph [f].cost ) > p_max) {
0 commit comments