X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/08e7455d67920bbd7a87f440d00f2c1e071314a0..5b547799240cfe5d60c1c4161e3fc8849095e2ca:/teshsuite/s4u/wait-any-for/wait-any-for.cpp diff --git a/teshsuite/s4u/wait-any-for/wait-any-for.cpp b/teshsuite/s4u/wait-any-for/wait-any-for.cpp index 494d56179d..9438f45e04 100644 --- a/teshsuite/s4u/wait-any-for/wait-any-for.cpp +++ b/teshsuite/s4u/wait-any-for/wait-any-for.cpp @@ -1,3 +1,8 @@ +/* Copyright (c) 2019-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. */ + #include #include #include @@ -25,12 +30,12 @@ static void worker() XBT_INFO("All comms have started"); std::vector comms = {put1, put2, get1, get2}; - while (!comms.empty()) { - int index = simgrid::s4u::Comm::wait_any_for(&comms, 0.5); + while (not comms.empty()) { + ssize_t index = simgrid::s4u::Comm::wait_any_for(comms, 0.5); if (index < 0) XBT_INFO("wait_any_for: Timeout reached"); else { - XBT_INFO("wait_any_for: A comm finished (index=%d, #comms=%zu)", index, comms.size()); + XBT_INFO("wait_any_for: A comm finished (index=%zd, #comms=%zu)", index, comms.size()); comms.erase(comms.begin() + index); } }