Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please codacy: use long form of negation in C++
[simgrid.git] / src / surf / surf_interface.cpp
index dd505c0..cbb08ad 100644 (file)
@@ -137,7 +137,7 @@ std::ifstream* surf_ifsopen(const char* name)
     std::string buff = path_elm + FILE_DELIM + name;
     fs->open(buff.c_str(), std::ifstream::in);
 
     std::string buff = path_elm + FILE_DELIM + name;
     fs->open(buff.c_str(), std::ifstream::in);
 
-    if (!fs->fail()) {
+    if (not fs->fail()) {
       XBT_DEBUG("Found file at %s", buff.c_str());
       return fs;
     }
       XBT_DEBUG("Found file at %s", buff.c_str());
       return fs;
     }
@@ -192,7 +192,7 @@ const char *__surf_get_initial_path()
   unsigned int len = GetCurrentDirectory(MAX_PATH + 1, current_directory);
   char root[4] = { 0 };
 
   unsigned int len = GetCurrentDirectory(MAX_PATH + 1, current_directory);
   char root[4] = { 0 };
 
-  if (!len)
+  if (not len)
     return nullptr;
 
   strncpy(root, current_directory, 3);
     return nullptr;
 
   strncpy(root, current_directory, 3);
@@ -243,10 +243,10 @@ int find_model_description(s_surf_model_description_t * table,
   char *name_list = nullptr;
 
   for (i = 0; table[i].name; i++)
   char *name_list = nullptr;
 
   for (i = 0; table[i].name; i++)
-    if (!strcmp(name, table[i].name)) {
+    if (not strcmp(name, table[i].name)) {
       return i;
     }
       return i;
     }
-  if (!table[0].name)
+  if (not table[0].name)
     xbt_die("No model is valid! This is a bug.");
   name_list = xbt_strdup(table[0].name);
   for (i = 1; table[i].name; i++) {
     xbt_die("No model is valid! This is a bug.");
   name_list = xbt_strdup(table[0].name);
   for (i = 1; table[i].name; i++) {
@@ -354,9 +354,9 @@ void surf_init(int *argc, char **argv)
   SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_free);
 
   xbt_init(argc, argv);
   SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_free);
 
   xbt_init(argc, argv);
-  if (!all_existing_models)
+  if (not all_existing_models)
     all_existing_models = new std::vector<simgrid::surf::Model*>();
     all_existing_models = new std::vector<simgrid::surf::Model*>();
-  if (!future_evt_set)
+  if (not future_evt_set)
     future_evt_set = new simgrid::trace_mgr::future_evt_set();
 
   TRACE_surf_alloc();
     future_evt_set = new simgrid::trace_mgr::future_evt_set();
 
   TRACE_surf_alloc();
@@ -453,7 +453,7 @@ double Model::nextOccuringEventLazy(double now)
   lmm_solve(maxminSystem_);
   XBT_DEBUG("After share resources, The size of modified actions set is %zd", modifiedSet_->size());
 
   lmm_solve(maxminSystem_);
   XBT_DEBUG("After share resources, The size of modified actions set is %zd", modifiedSet_->size());
 
-  while(!modifiedSet_->empty()) {
+  while (not modifiedSet_->empty()) {
     Action *action = &(modifiedSet_->front());
     modifiedSet_->pop_front();
     bool max_dur_flag = false;
     Action *action = &(modifiedSet_->front());
     modifiedSet_->pop_front();
     bool max_dur_flag = false;
@@ -766,7 +766,7 @@ void Action::cancel(){
 
 int Action::unref(){
   refcount_--;
 
 int Action::unref(){
   refcount_--;
-  if (!refcount_) {
+  if (not refcount_) {
     if (action_hook.is_linked())
       stateSet_->erase(stateSet_->iterator_to(*this));
     if (getVariable())
     if (action_hook.is_linked())
       stateSet_->erase(stateSet_->iterator_to(*this));
     if (getVariable())