From 5d6359c1cc11cbbdbb04aeb328493d7801687c43 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 23 Mar 2018 14:42:46 +0100 Subject: [PATCH 1/1] Declare one variable per statement. --- src/smpi/mpi/smpi_datatype.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/smpi/mpi/smpi_datatype.cpp b/src/smpi/mpi/smpi_datatype.cpp index 7103d09008..7f5470a34f 100644 --- a/src/smpi/mpi/smpi_datatype.cpp +++ b/src/smpi/mpi/smpi_datatype.cpp @@ -500,11 +500,9 @@ int Datatype::create_struct(int count, int* block_lengths, MPI_Aint* indices, MP int Datatype::create_subarray(int ndims, int* array_of_sizes, int* array_of_subsizes, int* array_of_starts, int order, MPI_Datatype oldtype, MPI_Datatype *newtype){ - - int i, step, end; MPI_Datatype tmp; - - for (i=0; i < ndims; i++) { + + for (int i = 0; i < ndims; i++) { if (array_of_subsizes[i] > array_of_sizes[i]){ XBT_WARN("subarray : array_of_subsizes > array_of_sizes for dim %d",i); return MPI_ERR_ARG; @@ -516,7 +514,10 @@ int Datatype::create_subarray(int ndims, int* array_of_sizes, } MPI_Aint extent = oldtype->get_extent(); - + + int i; + int step; + int end; if( order==MPI_ORDER_C ) { i = ndims - 1; step = -1; -- 2.20.1