From: degomme Date: Mon, 13 Feb 2017 14:06:01 +0000 (+0100) Subject: sonar found these potential issues .. why not. X-Git-Tag: v3_15~408 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/602a32ab49bec0ad2ea69d6eb09dbe9bb33dbac7?ds=sidebyside sonar found these potential issues .. why not. --- diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index b7b181cf95..47a3374dec 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -790,7 +790,7 @@ int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[]) SIMIX_global_init(&argc, argv); MSG_init(&argc,argv); - SMPI_switch_data_segment = smpi_switch_data_segment; + SMPI_switch_data_segment = &smpi_switch_data_segment; smpi_init_options(); diff --git a/src/smpi/smpi_mpi_dt.cpp b/src/smpi/smpi_mpi_dt.cpp index 1268a50187..f7d69c5c15 100644 --- a/src/smpi/smpi_mpi_dt.cpp +++ b/src/smpi/smpi_mpi_dt.cpp @@ -424,8 +424,9 @@ void smpi_datatype_free(MPI_Datatype* type){ void smpi_datatype_use(MPI_Datatype type){ - if(type != MPI_DATATYPE_NULL) - type->in_use++; + if(type == MPI_DATATYPE_NULL) + return; + type->in_use++; if(type->sizeof_substruct!=0){ static_cast((type)->substruct)->subtype_use(&type);