X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cff982bd049d26d7acbd0e23324e0de051b06d0d..c972ddd5a74b83c183357f707e7dfba87d48e750:/src/kernel/resource/profile/Profile.cpp diff --git a/src/kernel/resource/profile/Profile.cpp b/src/kernel/resource/profile/Profile.cpp index 03b6da096f..b6167c491d 100644 --- a/src/kernel/resource/profile/Profile.cpp +++ b/src/kernel/resource/profile/Profile.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2004-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -28,10 +28,8 @@ namespace profile { Profile::Profile() { /* Add the first fake event storing the time at which the trace begins */ - DatedValue val(0, -1); - StochasticDatedValue stoval(0, -1); - event_list.emplace_back(val); - stochastic_event_list.emplace_back(stoval); + event_list.emplace_back(0, -1); + stochastic_event_list.emplace_back(0, -1); } Profile::~Profile() = default; @@ -131,7 +129,7 @@ Profile* Profile::from_string(const std::string& name, const std::string& input, std::vector splittedval((std::istream_iterator(iss)), std::istream_iterator()); - xbt_assert(splittedval.size() > 0, "Invalid profile line"); + xbt_assert(not splittedval.empty(), "Invalid profile line"); if (splittedval[0] == "DET") { stochevent.date_law = Distribution::DET; @@ -183,8 +181,8 @@ Profile* Profile::from_string(const std::string& name, const std::string& input, profile->stochastic_event_list.emplace_back(stochevent); } else { - 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(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_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,