From c00da93d1db911595d148e3ef1b163515916d03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 22 Jul 2015 15:49:19 +0200 Subject: [PATCH] fix warning about using a bool in a switch --- .../demo/Mesh_3/C3t3_rib_exporter_plugin.cpp | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Mesh_3/demo/Mesh_3/C3t3_rib_exporter_plugin.cpp b/Mesh_3/demo/Mesh_3/C3t3_rib_exporter_plugin.cpp index 41db2b47a00..3309df86d2d 100644 --- a/Mesh_3/demo/Mesh_3/C3t3_rib_exporter_plugin.cpp +++ b/Mesh_3/demo/Mesh_3/C3t3_rib_exporter_plugin.cpp @@ -642,19 +642,17 @@ void C3t3_rib_exporter_plugin:: write_turn_background_light(bool turn_on, std::ofstream& out) { - switch (turn_on) + if (!turn_on) { - case false: - out << "Illuminate 1 1" << std::endl; - if ( ! parameters_.is_preview ) { out << "Illuminate 2 1" << std::endl; } - out << "Illuminate 99 0" << std::endl; - break; - - case true: - out << "Illuminate 1 0" << std::endl; - if ( ! parameters_.is_preview ) { out << "Illuminate 2 0" << std::endl; } - out << "Illuminate 99 1" << std::endl; - break; + out << "Illuminate 1 1" << std::endl; + if ( ! parameters_.is_preview ) { out << "Illuminate 2 1" << std::endl; } + out << "Illuminate 99 0" << std::endl; + } + else + { + out << "Illuminate 1 0" << std::endl; + if ( ! parameters_.is_preview ) { out << "Illuminate 2 0" << std::endl; } + out << "Illuminate 99 1" << std::endl; } }