@@ -181,7 +181,7 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
181181 */
182182
183183 bool add_shortcut (const CH_edge &edge, V u, V v) {
184- bool inserted;
184+ bool inserted = false ;
185185 E e;
186186 if (edge.cost < 0 ) return false ;
187187
@@ -394,7 +394,7 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
394394 V u, V v, V w,
395395 std::vector<E> &shortcuts,
396396 std::ostringstream &log) {
397- bool found_e;
397+ bool found_e = false ;
398398 E e;
399399
400400 boost::tie (e, found_e) = boost::edge (u, w, this ->graph );
@@ -422,7 +422,7 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
422422 shortcut.add_contracted_edge_vertices (std::get<0 >(e2 ));
423423
424424 // Add shortcut in the current graph (to go on the process)
425- bool inserted;
425+ bool inserted = false ;
426426 E s;
427427 boost::tie (s, inserted) = boost::add_edge (u, w, this ->graph );
428428 this ->graph [s]= shortcut;
@@ -433,16 +433,15 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
433433 /* ! @brief computes p_max used in the contraction hierarchies method
434434 */
435435 int64_t compute_pmax (V u, V v, Identifiers<V> out_vertices) {
436- int64_t p_max;
436+ int64_t p_max = 0 ;
437437 E e, f;
438- bool found_e;
439- p_max = 0 ;
438+ bool found_e = false ;
440439 boost::tie (e, found_e) = boost::edge (u, v, this ->graph );
441440
442441 if (found_e) {
443442 p_max = this ->graph [e].cost ;
444443 for (V w : out_vertices) {
445- bool found_f;
444+ bool found_f = false ;
446445 boost::tie (f, found_f) = boost::edge (v, w, this ->graph );
447446 if ((found_f) && (u != w)) {
448447 if ((this ->graph [e].cost + this ->graph [f].cost ) > p_max) {
0 commit comments