return dateVal;
}
-Profile* Profile::from_string(std::string name, std::string input, double periodicity)
+Profile* Profile::from_string(const std::string& name, const std::string& input, double periodicity)
{
int linecount = 0;
simgrid::kernel::profile::Profile* profile = new simgrid::kernel::profile::Profile();
if (sscanf(val.c_str(), "LOOPAFTER %lg\n", &periodicity) == 1)
continue;
- xbt_assert(sscanf(val.c_str(), "%lg %lg\n", &event.date_, &event.value_) == 2, "%s:%d: Syntax error in trace\n%s",
- name.c_str(), linecount, input.c_str());
+ XBT_ATTRIB_UNUSED int res = sscanf(val.c_str(), "%lg %lg\n", &event.date_, &event.value_);
+ xbt_assert(res == 2, "%s:%d: Syntax error in trace\n%s", name.c_str(), linecount, input.c_str());
xbt_assert(last_event->date_ <= event.date_,
"%s:%d: Invalid trace: Events must be sorted, but time %g > time %g.\n%s", name.c_str(), linecount,
return profile;
}
-Profile* Profile::from_file(std::string path)
+Profile* Profile::from_file(const std::string& path)
{
xbt_assert(not path.empty(), "Cannot parse a trace from an empty filename");
xbt_assert(trace_list.find(path) == trace_list.end(), "Refusing to define trace %s twice", path.c_str());