Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make it easier to mark execution paths as DEADCODE, and mark one of them :)
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 9 Jan 2016 23:54:40 +0000 (00:54 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 9 Jan 2016 23:54:40 +0000 (00:54 +0100)
include/xbt/ex.h
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp

index 59e442b..526c374 100644 (file)
@@ -462,6 +462,8 @@ XBT_PUBLIC( void )__xbt_ex_terminate_default(xbt_ex_t * e);
   THROWF(unknown_error, 0, "The Impossible Did Happen (yet again)")
 #define THROW_UNIMPLEMENTED \
   THROWF(unknown_error, 0, "Function %s unimplemented",_XBT_FUNCTION)
+#define THROW_DEADCODE \
+  THROWF(unknown_error, 0, "Function %s was supposed to be DEADCODE, but it's not",_XBT_FUNCTION)
 
 #define DIE_IMPOSSIBLE xbt_die("The Impossible Did Happen (yet again)")
 
index d1c9c0d..4d3b104 100644 (file)
@@ -591,14 +591,14 @@ namespace surf {
 
 Resource::Resource()
 : p_name(NULL), p_model(NULL)
-{} // FIXME: DEADCODE?
+{THROW_DEADCODE;} // FIXME: DEADCODE?
 
 Resource::Resource(Model *model, const char *name)
-  : Resource(model, name, 1/*SURF_RESOURCE_ON*/)
-{} // FIXME: DEADCODE?
+  : Resource(model, name, 1/*ON*/)
+{}
 
 Resource::Resource(Model *model, const char *name, lmm_constraint_t constraint)
-  : Resource(model, name, constraint, 1/*SURF_RESOURCE_ON*/)
+  : Resource(model, name, constraint, 1/*ON*/)
 {}
   
 Resource::Resource(Model *model, const char *name, lmm_constraint_t constraint, int initiallyOn)
@@ -612,7 +612,7 @@ Resource::Resource(Model *model, const char *name, int initiallyOn)
   : p_name(xbt_strdup(name))
   , p_model(model)
   , m_isOn(initiallyOn)
-{} // FIXME: DEADCODE?
+{}
 
 
 Resource::~Resource() {
index 5855cca..dc8d9bc 100644 (file)
@@ -483,7 +483,7 @@ public: /* LMM */
   /** @brief Get the lmm constraint associated to this Resource if it is part of a LMM component */
   lmm_constraint_t getConstraint();
 protected:
-  lmm_constraint_t p_constraint;
+  lmm_constraint_t p_constraint = nullptr;
 };
 
 }