Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics: remove redundant "case" clause.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 13 Oct 2017 10:22:17 +0000 (12:22 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 14 Oct 2017 21:48:41 +0000 (23:48 +0200)
include/xbt/future.hpp
src/mc/mc_checkpoint.cpp
src/mc/mc_dwarf.cpp
src/mc/mc_snapshot.hpp

index a374bec..95b3557 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016. The SimGrid Team.
+/* Copyright (c) 2015-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -123,9 +123,6 @@ public:
   T get()
   {
     switch (status_) {
-      case ResultStatus::invalid:
-      default:
-        throw std::logic_error("Invalid result");
       case ResultStatus::value: {
         T value = std::move(value_);
         value_.~T();
@@ -139,6 +136,8 @@ public:
         std::rethrow_exception(std::move(exception));
         break;
       }
+      default:
+        throw std::logic_error("Invalid result");
     }
   }
 private:
index dcea47e..abd51e2 100644 (file)
@@ -60,11 +60,6 @@ namespace mc {
 static void restore(mc_mem_region_t region)
 {
   switch(region->storage_type()) {
-  case simgrid::mc::StorageType::NoData:
-  default:
-    xbt_die("Storage type not supported");
-    break;
-
   case simgrid::mc::StorageType::Flat:
     mc_model_checker->process().write_bytes(region->flat_data().get(),
       region->size(), region->permanent_address());
@@ -78,6 +73,10 @@ static void restore(mc_mem_region_t region)
     for (auto& p : region->privatized_data())
       restore(&p);
     break;
+
+  default: // includes StorageType::NoData
+    xbt_die("Storage type not supported");
+    break;
   }
 }
 
index 3a21afc..84df334 100644 (file)
@@ -532,13 +532,10 @@ static void MC_dwarf_fill_member_location(
                 (uint64_t) type->id, type->name.c_str());
       break;
     }
-  case simgrid::dwarf::FormClass::LocListPtr:
-    // Reference to a location list:
-    // TODO
-  case simgrid::dwarf::FormClass::Reference:
-    // It's supposed to be possible in DWARF2 but I couldn't find its semantic
-    // in the spec.
+
   default:
+    // includes FormClass::LocListPtr (reference to a location list: TODO) and FormClass::Reference (it's supposed to be
+    // possible in DWARF2 but I couldn't find its semantic in the spec)
     xbt_die("Can't handle form class (%d) / form 0x%x as DW_AT_member_location", (int)form_class, (unsigned)form);
   }
 
@@ -800,18 +797,16 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
     int form = dwarf_whatform(&attr);
     simgrid::dwarf::FormClass form_class = simgrid::dwarf::classify_form(form);
     switch (form_class) {
-    case simgrid::dwarf::FormClass::Constant:
-      {
+      case simgrid::dwarf::FormClass::Constant: {
         Dwarf_Word value;
         variable->start_scope =
             dwarf_formudata(&attr, &value) == 0 ? (size_t) value : 0;
         break;
       }
 
-    case simgrid::dwarf::FormClass::RangeListPtr:     // TODO
-    default:
-      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);
+      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);
     }
   }
 
index 686019f..6eab444 100644 (file)
@@ -46,8 +46,7 @@ static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, mc_me
       simgrid::mc::RegionSnapshot& subregion = region->privatized_data()[process_index];
       return mc_translate_address_region(addr, &subregion, process_index);
     }
-    case simgrid::mc::StorageType::NoData:
-    default:
+    default: // includes StorageType::NoData
       xbt_die("Storage type not supported");
   }
 }
@@ -191,10 +190,6 @@ static XBT_ALWAYS_INLINE const void* MC_region_read(mc_mem_region_t region, void
   xbt_assert(region->contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.");
 
   switch (region->storage_type()) {
-    case simgrid::mc::StorageType::NoData:
-    default:
-      xbt_die("Storage type not supported");
-
     case simgrid::mc::StorageType::Flat:
       return (char*)region->flat_data().get() + offset;
 
@@ -210,9 +205,9 @@ static XBT_ALWAYS_INLINE const void* MC_region_read(mc_mem_region_t region, void
       }
     }
 
-    // We currently do not pass the process_index to this function so we assume
-    // that the privatized region has been resolved in the callers:
-    case simgrid::mc::StorageType::Privatized:
+    default:
+      // includes StorageType::NoData and StorageType::Privatized (we currently do not pass the process_index to this
+      // function so we assume that the privatized region has been resolved in the callers)
       xbt_die("Storage type not supported");
   }
 }