X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/709364a65f29534ba568135b1f7714427e274bc2..2750bde086c69304587076350db922bfd9da04f6:/src/smpi/bindings/smpi_pmpi_type.cpp diff --git a/src/smpi/bindings/smpi_pmpi_type.cpp b/src/smpi/bindings/smpi_pmpi_type.cpp index 056316cdac..8bf129a268 100644 --- a/src/smpi/bindings/smpi_pmpi_type.cpp +++ b/src/smpi/bindings/smpi_pmpi_type.cpp @@ -17,6 +17,7 @@ int PMPI_Type_free(MPI_Datatype * datatype) return MPI_ERR_TYPE; } else { simgrid::smpi::Datatype::unref(*datatype); + *datatype=MPI_DATATYPE_NULL; return MPI_SUCCESS; } } @@ -135,7 +136,7 @@ int PMPI_Type_create_indexed_block(int count, int blocklength, const int* indice { CHECK_COUNT(1, count) CHECK_MPI_NULL(4, MPI_DATATYPE_NULL, MPI_ERR_TYPE, old_type) - int* blocklens=static_cast(xbt_malloc(blocklength*count*sizeof(int))); + auto* blocklens = static_cast(xbt_malloc(blocklength * count * sizeof(int))); for (int i = 0; i < count; i++) blocklens[i]=blocklength; int retval = simgrid::smpi::Datatype::create_indexed(count, blocklens, indices, old_type, new_type); @@ -160,7 +161,7 @@ int PMPI_Type_create_hindexed_block(int count, int blocklength, const MPI_Aint* MPI_Datatype* new_type) { CHECK_COUNT(1, count) CHECK_MPI_NULL(4, MPI_DATATYPE_NULL, MPI_ERR_TYPE, old_type) - int* blocklens=(int*)xbt_malloc(blocklength*count*sizeof(int)); + auto* blocklens = static_cast(xbt_malloc(blocklength * count * sizeof(int))); for (int i = 0; i < count; i++) blocklens[i] = blocklength; int retval = simgrid::smpi::Datatype::create_hindexed(count, blocklens, indices, old_type, new_type);