namespace simgrid {
namespace surf {
-simgrid::xbt::signal<void(void)> surfExitCallbacks;
-
+simgrid::xbt::signal<void()> surfExitCallbacks;
}
}
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;
}
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);
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;
}
- 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++) {
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*>();
- if (!future_evt_set)
+ if (not future_evt_set)
future_evt_set = new simgrid::trace_mgr::future_evt_set();
TRACE_surf_alloc();
free(stype->model);
free(stype->type_id);
free(stype->content);
- free(stype->content_type);
xbt_dict_free(&(stype->properties));
delete stype->model_properties;
free(stype);
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;
}
if ((action->getMaxDuration() > NO_MAX_DURATION) &&
- (min == -1 || action->getStartTime() + action->getMaxDuration() < min)) {
+ (min <= -1 || action->getStartTime() + action->getMaxDuration() < min)) {
// when the task will complete anyway because of the deadline if any
min = action->getStartTime() + action->getMaxDuration();
max_dur_flag = true;
}
-
XBT_DEBUG("Action(%p) corresponds to variable %d", action, action->getVariable()->id_int);
XBT_DEBUG("Action(%p) Start %f. May finish at %f (got a share of %f). Max_duration %f", action,
action->getStartTime(), min, share,
action->getMaxDuration());
- if (min != -1) {
+ if (min > -1) {
action->heapUpdate(actionHeap_, min, max_dur_flag ? MAX_DURATION : NORMAL);
XBT_DEBUG("Insert at heap action(%p) min %f now %f", action, min, now);
} else
return isOn_;
}
bool Resource::isOff() const {
- return ! isOn_;
+ return not isOn_;
}
void Resource::turnOn()
int Action::unref(){
refcount_--;
- if (!refcount_) {
+ if (not refcount_) {
if (action_hook.is_linked())
stateSet_->erase(stateSet_->iterator_to(*this));
if (getVariable())