From 3fa8f6002562c5df0b7bb9deb09b6f81ce1e28b6 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 15 Jan 2016 10:21:00 +0100 Subject: [PATCH] fix "variable may be used uninitialized" warning --- .../Plugins/PMP/Isotropic_remeshing_plugin.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp index 8f76806f534..30e7af40669 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp @@ -242,11 +242,10 @@ public Q_SLOTS: void isotropic_remeshing_of_several_polyhedra() { // Remeshing parameters - bool parameters_set = false; - bool edges_only; - double target_length; - unsigned int nb_iter; - bool protect; + bool edges_only = false; + double target_length = 0.; + unsigned int nb_iter = 1; + bool protect = false; BOOST_FOREACH(int index, scene->selectionIndices()) { @@ -259,7 +258,7 @@ public Q_SLOTS: << " is not a Polyhedron, remeshing skipped\n"; continue; } - else if (!parameters_set) + else if (target_length == 0.) { QDialog dialog(mw); Ui::Isotropic_remeshing_dialog ui = remeshing_dialog(&dialog, poly_item); @@ -277,12 +276,14 @@ public Q_SLOTS: nb_iter = ui.nbIterations_spinbox->value(); protect = ui.protect_checkbox->isChecked(); - parameters_set = true; break; } } - if(!parameters_set) + if(target_length == 0.) + { std::cout << "Remeshing aborted" << std::endl; + return; + } // wait cursor QApplication::setOverrideCursor(Qt::WaitCursor);