Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove dead code after exception throw.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 26 Feb 2019 20:32:47 +0000 (21:32 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 27 Feb 2019 14:26:19 +0000 (15:26 +0100)
src/instr/instr_interface.cpp
src/kernel/activity/IoImpl.cpp
src/kernel/activity/SleepImpl.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Io.cpp
src/simix/ActorImpl.cpp
src/simix/popping_generated.cpp
src/simix/simcalls.py
src/surf/StorageImpl.cpp
src/xbt/dynar.cpp

index 6e15de3..14e3d3b 100644 (file)
@@ -283,7 +283,6 @@ static void instr_user_variable(double time, const char* resource, const char* v
           break;
         default:
           THROW_IMPOSSIBLE;
-          break;
       }
     }
   }
index f8fd4c9..daacc4a 100644 (file)
@@ -87,7 +87,6 @@ void IoImpl::post()
       break;
     default:
       THROW_IMPOSSIBLE;
-      break;
   }
   on_completion(this);
 
index edabd24..25ff77d 100644 (file)
@@ -60,7 +60,6 @@ void SleepImpl::post()
 
       default:
         THROW_IMPOSSIBLE;
-        break;
     }
     if (not simcall->issuer->get_host()->is_on()) {
       simcall->issuer->context_->iwannadie = true;
index 6d3f9f1..a921bcf 100644 (file)
@@ -234,7 +234,6 @@ void VirtualMachineImpl::shutdown(smx_actor_t issuer)
         break;
       default: /* SURF_VM_STATE_RUNNING or unexpected values */
         THROW_IMPOSSIBLE;
-        break;
     }
     XBT_VERB("Shutting down the VM %s even if it's not running but %s", piface_->get_cname(), stateName);
   }
index 0e69a7b..d75abb1 100644 (file)
@@ -52,7 +52,6 @@ Exec* Exec::wait()
 Exec* Exec::wait_for(double)
 {
   THROW_UNIMPLEMENTED;
-  return this;
 }
 
 /** @brief Returns whether the state of the exec is finished */
index 52f55b4..129fc60 100644 (file)
@@ -44,7 +44,6 @@ Io* Io::wait()
 Io* Io::wait_for(double)
 {
   THROW_UNIMPLEMENTED;
-  return this;
 }
 
 bool Io::test()
@@ -59,7 +58,7 @@ bool Io::test()
 
   THROW_UNIMPLEMENTED;
 
-  return false;
+  // return false
 }
 
 /** @brief Returns the amount of flops that remain to be done */
index 1123281..f456507 100644 (file)
@@ -81,7 +81,6 @@ ActorImplPtr ActorImpl::attach(std::string name, void* data, s4u::Host* host,
     XBT_WARN("Cannot launch process '%s' on failed host '%s'", name.c_str(), host->get_cname());
     std::rethrow_exception(
         std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host.")));
-    return nullptr;
   }
 
   ActorImpl* actor = new ActorImpl(xbt::string(name), host);
@@ -454,7 +453,6 @@ ActorImplPtr ActorImpl::create(std::string name, simix::ActorCode code, void* da
     XBT_WARN("Cannot launch actor '%s' on failed host '%s'", name.c_str(), host->get_cname());
     std::rethrow_exception(
         std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot create actor on failed host.")));
-    return nullptr;
   }
 
   ActorImpl* actor = new ActorImpl(simgrid::xbt::string(name), host);
index 1d7194f..2227301 100644 (file)
@@ -177,7 +177,6 @@ case SIMCALL_RUN_BLOCKING:
     case SIMCALL_NONE:
       THROWF(arg_error, 0, "Asked to do the noop syscall on %s@%s", simcall->issuer->get_cname(),
              sg_host_get_name(simcall->issuer->get_host()));
-      break;
     default:
       THROW_IMPOSSIBLE;
   }
index 2f8b00c..d214ff1 100755 (executable)
@@ -350,7 +350,6 @@ if __name__ == '__main__':
     fd.write('    case SIMCALL_NONE:\n')
     fd.write('      THROWF(arg_error, 0, "Asked to do the noop syscall on %s@%s", simcall->issuer->get_cname(),\n')
     fd.write('             sg_host_get_name(simcall->issuer->get_host()));\n')
-    fd.write('      break;\n')
     fd.write('    default:\n')
     fd.write('      THROW_IMPOSSIBLE;\n')
     fd.write('  }\n')
index afc9463..55a31bd 100644 (file)
@@ -71,7 +71,6 @@ void StorageImpl::destroy()
 bool StorageImpl::is_used()
 {
   THROW_UNIMPLEMENTED;
-  return false;
 }
 
 void StorageImpl::apply_event(kernel::profile::Event* /*event*/, double /*value*/)
index 1bd60bb..6b9a739 100644 (file)
@@ -444,7 +444,6 @@ unsigned int xbt_dynar_search(xbt_dynar_t const dynar, void* const elem)
     }
 
   THROWF(not_found_error, 0, "Element %p not part of dynar %p", elem, dynar);
-  return 0; // Won't happen, just to please eclipse
 }
 
 /** @brief Returns the position of the element in the dynar (or -1 if not found)