From: Arnaud Giersch Date: Sat, 21 Oct 2017 20:56:50 +0000 (+0200) Subject: Replace single case switch by an if. X-Git-Tag: v3.18~399^2~6 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3b62b91376f62df2b9817850875ae21d5af14265 Replace single case switch by an if. --- diff --git a/src/mc/mc_dwarf.cpp b/src/mc/mc_dwarf.cpp index 440de3a4ae..88e1369519 100644 --- a/src/mc/mc_dwarf.cpp +++ b/src/mc/mc_dwarf.cpp @@ -799,17 +799,13 @@ static std::unique_ptr MC_die_to_variable( dwarf_attr(die, DW_AT_start_scope, &attr); int form = dwarf_whatform(&attr); simgrid::dwarf::FormClass form_class = simgrid::dwarf::classify_form(form); - switch (form_class) { - case simgrid::dwarf::FormClass::Constant: { - Dwarf_Word value; - variable->start_scope = - dwarf_formudata(&attr, &value) == 0 ? (size_t) value : 0; - break; - } - - default: // includes FormClass::RangeListPtr (TODO) - xbt_die("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s", (unsigned)form, - (unsigned)form_class, name == nullptr ? "?" : name); + if (form_class == simgrid::dwarf::FormClass::Constant) { + Dwarf_Word value; + variable->start_scope = dwarf_formudata(&attr, &value) == 0 ? (size_t)value : 0; + } else { + // TODO: FormClass::RangeListPtr + xbt_die("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s", (unsigned)form, + (unsigned)form_class, name == nullptr ? "?" : name); } }