X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cf482439821f2e52d3a573c4abe8763be830800a..ea74f5d95928a521a588737e81f1de94eef25d19:/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c diff --git a/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c index 6ddb623680..b0b6c66abb 100644 --- a/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c +++ b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c @@ -1,6 +1,6 @@ /* A simple example ping-pong program to test MPI_Send and MPI_Recv */ -/* Copyright (c) 2009-2019. The SimGrid Team. +/* Copyright (c) 2009-2022. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -9,15 +9,13 @@ #include #include -static void test_opts(int* argc, char **argv[]){ - int found = 0, ret; - while ((ret = getopt(*argc, *argv, "s")) >= 0) - { - switch (ret) { - case 's': +static void test_opts(int argc, char* const argv[]) +{ + int found = 0; + int ret; + while ((ret = getopt(argc, argv, "s")) >= 0) { + if (ret == 's') found = 1; - break; - } } if (found!=1){ printf("(smpi_)getopt failed ! \n"); @@ -32,11 +30,10 @@ int main(int argc, char *argv[]) int rank; int msg = 99; MPI_Status status; - int err = MPI_Init(&argc, &argv); /* Initialize MPI */ /* test getopt function */ - test_opts(&argc, &argv); + test_opts(argc, argv); if (err != MPI_SUCCESS) { printf("MPI initialization failed!\n");