From: Arnaud Giersch Date: Wed, 24 Jul 2019 16:04:51 +0000 (+0200) Subject: [cppcheck] Reduce scope for variable. X-Git-Tag: v3.24~140 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e3771caa277bcafe6b67c9bfaf18ab8ee70001a7?hp=6f2eb14fe202d65be982586cc8c4b6169b39779c;ds=sidebyside [cppcheck] Reduce scope for variable. --- diff --git a/src/smpi/mpi/smpi_comm.cpp b/src/smpi/mpi/smpi_comm.cpp index 1ecccf4610..8571f381b4 100644 --- a/src/smpi/mpi/smpi_comm.cpp +++ b/src/smpi/mpi/smpi_comm.cpp @@ -40,11 +40,11 @@ Comm::Comm(MPI_Group group, MPI_Topology topo, int smp, int in_id) : group_(grou is_blocked_ = 0; info_ = MPI_INFO_NULL; errhandler_ = MPI_ERRORS_ARE_FATAL; - static int global_id_=0; //First creation of comm is done before SIMIX_run, so only do comms for others if(in_id==MPI_UNDEFINED && smp==0 && this->rank()!=MPI_UNDEFINED ){ int id; if(this->rank()==0){ + static int global_id_ = 0; id=global_id_; global_id_++; }