Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Replace redundant type with "auto" (src/smpi/).
[simgrid.git] / src / smpi / bindings / smpi_pmpi_type.cpp
index 49b1a87..8bf129a 100644 (file)
@@ -136,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<int*>(xbt_malloc(blocklength*count*sizeof(int)));
+  auto* blocklens = static_cast<int*>(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);
@@ -161,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<int*>(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);