From 602a32ab49bec0ad2ea69d6eb09dbe9bb33dbac7 Mon Sep 17 00:00:00 2001 From: degomme Date: Mon, 13 Feb 2017 15:06:01 +0100 Subject: [PATCH] sonar found these potential issues .. why not. --- src/smpi/smpi_global.cpp | 2 +- src/smpi/smpi_mpi_dt.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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); -- 2.20.1