X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2d37e348a09783cda723c7019640ee69de168324..a4583c75a1dd9fbbfdd3e0112ccc152847893d22:/src/kernel/resource/profile/trace_mgr.cpp diff --git a/src/kernel/resource/profile/trace_mgr.cpp b/src/kernel/resource/profile/trace_mgr.cpp index 7a273835ee..a796657473 100644 --- a/src/kernel/resource/profile/trace_mgr.cpp +++ b/src/kernel/resource/profile/trace_mgr.cpp @@ -79,7 +79,7 @@ DatedValue Profile::next(Event* event) 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(); @@ -100,8 +100,8 @@ Profile* Profile::from_string(std::string name, std::string input, double period 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, @@ -123,7 +123,7 @@ Profile* Profile::from_string(std::string name, std::string input, double period 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());