X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/83f0364920918d0380a5d538216193bfe00ddc47..3b56ba0e1914362b1c7e6b7d84bf72e2fe88f3c2:/examples/c/exec-waitany/exec-waitany.c diff --git a/examples/c/exec-waitany/exec-waitany.c b/examples/c/exec-waitany/exec-waitany.c index b5caa0b8d4..bfff989960 100644 --- a/examples/c/exec-waitany/exec-waitany.c +++ b/examples/c/exec-waitany/exec-waitany.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2019-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2019-2023. 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. */ @@ -41,7 +41,7 @@ static void worker(int argc, char* argv[]) * terminated. */ while (pending_execs_count > 0) { - int pos; + ssize_t pos; if (with_timeout) pos = sg_exec_wait_any_for(pending_execs, pending_execs_count, 4); else @@ -51,14 +51,14 @@ static void worker(int argc, char* argv[]) XBT_INFO("Do not wait any longer for an activity"); pending_execs_count = 0; } else { - XBT_INFO("Activity at position %d is complete", pos); + XBT_INFO("Activity at position %zd is complete", pos); memmove(pending_execs + pos, pending_execs + pos + 1, sizeof(sg_exec_t) * (pending_execs_count - pos - 1)); pending_execs_count--; } XBT_INFO("%d activities remain pending", pending_execs_count); } - free(pending_execs); + xbt_free(pending_execs); } int main(int argc, char* argv[])