From fdbf26cd4e0dc0f7b25ffe11d025ef10375495e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkovsky@mmg.fjfi.cvut.cz>
Date: Tue, 28 Dec 2021 16:07:02 +0100
Subject: [PATCH] clang-tidy: refactor the code to one statement per
 declaration [readability-isolate-declaration]

See https://clang.llvm.org/extra/clang-tidy/checks/readability-isolate-declaration.html
---
 src/Benchmarks/BLAS/array-operations.h        |  6 +++--
 src/Benchmarks/BLAS/gemv.h                    |  7 ++++--
 src/Benchmarks/BLAS/triad.h                   | 24 ++++++++++++++-----
 src/Benchmarks/BLAS/vector-operations.h       | 18 ++++++++++----
 .../tnl-benchmark-simple-heat-equation.h      |  4 +++-
 .../Segments/Kernels/CSRAdaptiveKernel.hpp    |  3 ++-
 src/TNL/Algorithms/Segments/SlicedEllpack.hpp |  3 ++-
 .../Algorithms/Segments/SlicedEllpackView.hpp |  3 ++-
 src/TNL/Containers/StaticVector.h             |  6 +++--
 src/TNL/Matrices/SparseMatrix.hpp             |  3 ++-
 .../DistributedMeshes/DistributedGrid.hpp     |  6 +++--
 src/TNL/Meshes/GridDetails/Grid2D_impl.h      |  3 ++-
 src/TNL/Meshes/GridDetails/Grid3D_impl.h      |  4 +++-
 .../MeshDetails/layers/EntityTags/Layer.h     |  9 ++++---
 src/TNL/Meshes/Readers/MeshReader.h           |  6 +++--
 src/TNL/Meshes/Readers/NetgenReader.h         |  3 ++-
 src/TNL/Meshes/Readers/VTKReader.h            | 15 ++++++++----
 src/TNL/Meshes/Writers/PVTIWriter.hpp         |  4 +++-
 src/TNL/Meshes/Writers/VTIWriter.hpp          |  4 +++-
 src/TNL/Meshes/Writers/VTUWriter.hpp          |  3 ++-
 src/TNL/Timer.hpp                             |  3 ++-
 src/Tools/tnl-decompose-mesh.cpp              |  9 ++++---
 22 files changed, 103 insertions(+), 43 deletions(-)

diff --git a/src/Benchmarks/BLAS/array-operations.h b/src/Benchmarks/BLAS/array-operations.h
index 99b934c7b6..a0c339722a 100644
--- a/src/Benchmarks/BLAS/array-operations.h
+++ b/src/Benchmarks/BLAS/array-operations.h
@@ -23,8 +23,10 @@ benchmarkArrayOperations( Benchmark<> & benchmark,
 
    double datasetSize = (double) size * sizeof( Real ) / oneGB;
 
-   HostArray hostArray, hostArray2;
-   CudaArray deviceArray, deviceArray2;
+   HostArray hostArray;
+   HostArray hostArray2;
+   CudaArray deviceArray;
+   CudaArray deviceArray2;
    hostArray.setSize( size );
    hostArray2.setSize( size );
 #ifdef HAVE_CUDA
diff --git a/src/Benchmarks/BLAS/gemv.h b/src/Benchmarks/BLAS/gemv.h
index e5fb88cbe4..4080ef566c 100644
--- a/src/Benchmarks/BLAS/gemv.h
+++ b/src/Benchmarks/BLAS/gemv.h
@@ -32,8 +32,11 @@ benchmarkGemv( Benchmark<> & benchmark, int rows, int columns )
    HostMatrix hostMatrix;
    RowMajorCudaMatrix rowMajorCudaMatrix;
    ColumnMajorCudaMatrix columnMajorCudaMatrix;
-   HostVector inHostVector, outHostVector;
-   CudaVector inCudaVector, outCudaVector1, outCudaVector2;
+   HostVector inHostVector;
+   HostVector outHostVector;
+   CudaVector inCudaVector;
+   CudaVector outCudaVector1;
+   CudaVector outCudaVector2;
 
    hostMatrix.setDimensions( rows, columns );
    inHostVector.setSize( columns );
diff --git a/src/Benchmarks/BLAS/triad.h b/src/Benchmarks/BLAS/triad.h
index f5fc2609cd..4e0de12adf 100644
--- a/src/Benchmarks/BLAS/triad.h
+++ b/src/Benchmarks/BLAS/triad.h
@@ -32,8 +32,12 @@ benchmarkTriad( Benchmark<> & benchmark,
       using HostArray = Containers::Array< Real, Devices::Host, Index, HostAllocator >;
       using CudaArray = Containers::Array< Real, Devices::Cuda, Index, CudaAllocator >;
 
-      HostArray a_h, b_h, c_h;
-      CudaArray a_d, b_d, c_d;
+      HostArray a_h;
+      HostArray b_h;
+      HostArray c_h;
+      CudaArray a_d;
+      CudaArray b_d;
+      CudaArray c_d;
       a_h.setSize( size );
       b_h.setSize( size );
       c_h.setSize( size );
@@ -76,8 +80,12 @@ benchmarkTriad( Benchmark<> & benchmark,
       using HostArray = Containers::Array< Real, Devices::Host, Index, CudaHostAllocator >;
       using CudaArray = Containers::Array< Real, Devices::Cuda, Index, CudaAllocator >;
 
-      HostArray a_h, b_h, c_h;
-      CudaArray a_d, b_d, c_d;
+      HostArray a_h;
+      HostArray b_h;
+      HostArray c_h;
+      CudaArray a_d;
+      CudaArray b_d;
+      CudaArray c_d;
       a_h.setSize( size );
       b_h.setSize( size );
       c_h.setSize( size );
@@ -119,7 +127,9 @@ benchmarkTriad( Benchmark<> & benchmark,
    {
       using HostArray = Containers::Array< Real, Devices::Host, Index, CudaHostAllocator >;
 
-      HostArray a_h, b_h, c_h;
+      HostArray a_h;
+      HostArray b_h;
+      HostArray c_h;
       a_h.setSize( size );
       b_h.setSize( size );
       c_h.setSize( size );
@@ -150,7 +160,9 @@ benchmarkTriad( Benchmark<> & benchmark,
    {
       using Array = Containers::Array< Real, Devices::Host, Index, CudaManagedAllocator >;
 
-      Array a, b, c;
+      Array a;
+      Array b;
+      Array c;
       a.setSize( size );
       b.setSize( size );
       c.setSize( size );
diff --git a/src/Benchmarks/BLAS/vector-operations.h b/src/Benchmarks/BLAS/vector-operations.h
index 2186cd4822..df242012f4 100644
--- a/src/Benchmarks/BLAS/vector-operations.h
+++ b/src/Benchmarks/BLAS/vector-operations.h
@@ -39,8 +39,14 @@ benchmarkVectorOperations( Benchmark<> & benchmark,
 
    double datasetSize = (double) size * sizeof( Real ) / oneGB;
 
-   HostVector hostVector( size ), hostVector2( size ), hostVector3( size ), hostVector4( size );
-   CudaVector deviceVector, deviceVector2, deviceVector3, deviceVector4;
+   HostVector hostVector( size );
+   HostVector hostVector2( size );
+   HostVector hostVector3( size );
+   HostVector hostVector4( size );
+   CudaVector deviceVector;
+   CudaVector deviceVector2;
+   CudaVector deviceVector3;
+   CudaVector deviceVector4;
 #ifdef HAVE_CUDA
    deviceVector.setSize( size );
    deviceVector2.setSize( size );
@@ -48,12 +54,16 @@ benchmarkVectorOperations( Benchmark<> & benchmark,
    deviceVector4.setSize( size );
 #endif
 
-   HostView hostView( hostVector ), hostView2( hostVector2 ), hostView3( hostVector3 ), hostView4( hostVector4 );
+   HostView hostView( hostVector );
+   HostView hostView2( hostVector2 );
+   HostView hostView3( hostVector3 );
+   HostView hostView4( hostVector4 );
 #ifdef HAVE_CUDA
    CudaView deviceView( deviceVector ), deviceView2( deviceVector2 ), deviceView3( deviceVector3 ), deviceView4( deviceVector4 );
 #endif
 
-   Real resultHost, resultDevice;
+   Real resultHost;
+   Real resultDevice;
 
 #ifdef HAVE_CUDA
    cublasHandle_t cublasHandle;
diff --git a/src/Benchmarks/HeatEquation/tnl-benchmark-simple-heat-equation.h b/src/Benchmarks/HeatEquation/tnl-benchmark-simple-heat-equation.h
index 0d366b4073..cf83a45ca1 100644
--- a/src/Benchmarks/HeatEquation/tnl-benchmark-simple-heat-equation.h
+++ b/src/Benchmarks/HeatEquation/tnl-benchmark-simple-heat-equation.h
@@ -579,7 +579,9 @@ int main( int argc, char* argv[] )
    if( ! parseCommandLine( argc, argv, config, parameters ) )
       return EXIT_FAILURE;
 
-   Timer timer, computationTimer, updateTimer;
+   Timer timer;
+   Timer computationTimer;
+   Timer updateTimer;
 
    String device = parameters.getParameter< String >( "device" );
    if( device == "host" &&
diff --git a/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernel.hpp b/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernel.hpp
index 5ef388ab44..7283585683 100644
--- a/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernel.hpp
+++ b/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernel.hpp
@@ -129,7 +129,8 @@ CSRAdaptiveKernel< Index, Device >::initValueSize( const Offsets& offsets )
       TNL::Containers::Vector< typename Offsets::IndexType, TNL::Devices::Host, typename Offsets::IndexType >;
    HostOffsetsType hostOffsets( offsets );
    const Index rows = offsets.getSize();
-   Index start( 0 ), nextStart( 0 );
+   Index start( 0 );
+   Index nextStart( 0 );
    size_t sum;
 
    // Fill blocks
diff --git a/src/TNL/Algorithms/Segments/SlicedEllpack.hpp b/src/TNL/Algorithms/Segments/SlicedEllpack.hpp
index 13ae01a44b..caef47f641 100644
--- a/src/TNL/Algorithms/Segments/SlicedEllpack.hpp
+++ b/src/TNL/Algorithms/Segments/SlicedEllpack.hpp
@@ -163,7 +163,8 @@ SlicedEllpack< Device, Index, IndexAllocator, Organization, SliceSize >::getGlob
 {
    const IndexType sliceIdx = segmentIdx / SliceSize;
    const IndexType segmentInSliceIdx = segmentIdx % SliceSize;
-   IndexType sliceOffset, segmentSize;
+   IndexType sliceOffset;
+   IndexType segmentSize;
    if( std::is_same< DeviceType, Devices::Host >::value ) {
       sliceOffset = this->sliceOffsets[ sliceIdx ];
       segmentSize = this->sliceSegmentSizes[ sliceIdx ];
diff --git a/src/TNL/Algorithms/Segments/SlicedEllpackView.hpp b/src/TNL/Algorithms/Segments/SlicedEllpackView.hpp
index abb3f56903..85834e1799 100644
--- a/src/TNL/Algorithms/Segments/SlicedEllpackView.hpp
+++ b/src/TNL/Algorithms/Segments/SlicedEllpackView.hpp
@@ -110,7 +110,8 @@ SlicedEllpackView< Device, Index, Organization, SliceSize >::getGlobalIndex( con
 {
    const IndexType sliceIdx = segmentIdx / SliceSize;
    const IndexType segmentInSliceIdx = segmentIdx % SliceSize;
-   IndexType sliceOffset, segmentSize;
+   IndexType sliceOffset;
+   IndexType segmentSize;
    if( std::is_same< DeviceType, Devices::Host >::value ) {
       sliceOffset = this->sliceOffsets[ sliceIdx ];
       segmentSize = this->sliceSegmentSizes[ sliceIdx ];
diff --git a/src/TNL/Containers/StaticVector.h b/src/TNL/Containers/StaticVector.h
index 750ac1de3c..6549de274a 100644
--- a/src/TNL/Containers/StaticVector.h
+++ b/src/TNL/Containers/StaticVector.h
@@ -209,7 +209,8 @@ __cuda_callable__
 Real
 TriangleArea( const StaticVector< 2, Real >& a, const StaticVector< 2, Real >& b, const StaticVector< 2, Real >& c )
 {
-   StaticVector< 3, Real > u1, u2;
+   StaticVector< 3, Real > u1;
+   StaticVector< 3, Real > u2;
    u1.x() = b.x() - a.x();
    u1.y() = b.y() - a.y();
    u1.z() = 0.0;
@@ -226,7 +227,8 @@ __cuda_callable__
 Real
 TriangleArea( const StaticVector< 3, Real >& a, const StaticVector< 3, Real >& b, const StaticVector< 3, Real >& c )
 {
-   StaticVector< 3, Real > u1, u2;
+   StaticVector< 3, Real > u1;
+   StaticVector< 3, Real > u2;
    u1.x() = b.x() - a.x();
    u1.y() = b.y() - a.y();
    u1.z() = b.z() - a.z();
diff --git a/src/TNL/Matrices/SparseMatrix.hpp b/src/TNL/Matrices/SparseMatrix.hpp
index 313639c13b..f53e8c3cbe 100644
--- a/src/TNL/Matrices/SparseMatrix.hpp
+++ b/src/TNL/Matrices/SparseMatrix.hpp
@@ -1031,7 +1031,8 @@ SparseMatrix< Real, Device, Index, MatrixType, Segments, ComputeReal, RealAlloca
             [ = ] __cuda_callable__( IndexType rowIdx, IndexType localIdx, IndexType & columnIndex, RealType & value ) mutable
          {
             RealType inValue( 0.0 );
-            IndexType bufferIdx, column( rowLocalIndexes_view[ rowIdx ] );
+            IndexType bufferIdx;
+            IndexType column( rowLocalIndexes_view[ rowIdx ] );
             while( inValue == 0.0 && column < matrix_columns ) {
                bufferIdx = ( rowIdx - baseRow ) * maxRowLength + column++;
                inValue = thisValuesBuffer_view[ bufferIdx ];
diff --git a/src/TNL/Meshes/DistributedMeshes/DistributedGrid.hpp b/src/TNL/Meshes/DistributedMeshes/DistributedGrid.hpp
index 25d8713963..c859188549 100644
--- a/src/TNL/Meshes/DistributedMeshes/DistributedGrid.hpp
+++ b/src/TNL/Meshes/DistributedMeshes/DistributedGrid.hpp
@@ -133,7 +133,8 @@ template< int Dimension, typename Real, typename Device, typename Index >
 void
 DistributedMesh< Grid< Dimension, Real, Device, Index > >::setGhostLevels( int levels )
 {
-   SubdomainOverlapsType lowerOverlap, upperOverlap;
+   SubdomainOverlapsType lowerOverlap;
+   SubdomainOverlapsType upperOverlap;
    SubdomainOverlapsGetter< GridType >::getOverlaps( this, lowerOverlap, upperOverlap, levels );
    setOverlaps( lowerOverlap, upperOverlap );
 }
@@ -347,7 +348,8 @@ DistributedMesh< Grid< Dimension, Real, Device, Index > >::SetupByCut(
       typename GridType::CoordinatesType outDimensions;
       // set local grid
       typename GridType::PointType localOrigin;
-      typename GridType::CoordinatesType localBegin, localGridSize;
+      typename GridType::CoordinatesType localBegin;
+      typename GridType::CoordinatesType localGridSize;
 
       for( int i = 0; i < Dimension; i++ ) {
          outOrigin[ i ] = fromGlobalMesh.getOrigin()[ savedDimensions[ i ] ];
diff --git a/src/TNL/Meshes/GridDetails/Grid2D_impl.h b/src/TNL/Meshes/GridDetails/Grid2D_impl.h
index bd9e6256d2..91b45bec83 100644
--- a/src/TNL/Meshes/GridDetails/Grid2D_impl.h
+++ b/src/TNL/Meshes/GridDetails/Grid2D_impl.h
@@ -43,7 +43,8 @@ Grid< 2, Real, Device, Index >::computeSpaceStepPowers()
    const RealType& hx = this->spaceSteps.x();
    const RealType& hy = this->spaceSteps.y();
 
-   Real auxX, auxY;
+   Real auxX;
+   Real auxY;
    for( int i = 0; i < 5; i++ ) {
       switch( i ) {
          case 0:
diff --git a/src/TNL/Meshes/GridDetails/Grid3D_impl.h b/src/TNL/Meshes/GridDetails/Grid3D_impl.h
index baaa43f339..671afcf4e8 100644
--- a/src/TNL/Meshes/GridDetails/Grid3D_impl.h
+++ b/src/TNL/Meshes/GridDetails/Grid3D_impl.h
@@ -44,7 +44,9 @@ Grid< 3, Real, Device, Index >::computeSpaceStepPowers()
    const RealType& hy = this->spaceSteps.y();
    const RealType& hz = this->spaceSteps.z();
 
-   Real auxX, auxY, auxZ;
+   Real auxX;
+   Real auxY;
+   Real auxZ;
    for( int i = 0; i < 5; i++ ) {
       switch( i ) {
          case 0:
diff --git a/src/TNL/Meshes/MeshDetails/layers/EntityTags/Layer.h b/src/TNL/Meshes/MeshDetails/layers/EntityTags/Layer.h
index 759e27b454..bca7dde795 100644
--- a/src/TNL/Meshes/MeshDetails/layers/EntityTags/Layer.h
+++ b/src/TNL/Meshes/MeshDetails/layers/EntityTags/Layer.h
@@ -138,7 +138,8 @@ public:
       ghostsOffset = tags.getSize() - ghostEntities;
 
       if( ! std::is_same< Device, Devices::Cuda >::value ) {
-         GlobalIndexType i = 0, b = 0;
+         GlobalIndexType i = 0;
+         GlobalIndexType b = 0;
          for( GlobalIndexType e = 0; e < tags.getSize(); e++ ) {
             if( tags[ e ] & EntityTags::BoundaryEntity )
                boundaryIndices[ b++ ] = e;
@@ -156,7 +157,8 @@ public:
          using OrderingHostArray = typename OrderingArray::template Self< typename OrderingArray::ValueType, Devices::Host >;
 
          EntityTagsHostArray hostTags;
-         OrderingHostArray hostBoundaryIndices, hostInteriorIndices;
+         OrderingHostArray hostBoundaryIndices;
+         OrderingHostArray hostInteriorIndices;
 
          hostTags.setLike( tags );
          hostInteriorIndices.setLike( interiorIndices );
@@ -164,7 +166,8 @@ public:
 
          hostTags = tags;
 
-         GlobalIndexType i = 0, b = 0;
+         GlobalIndexType i = 0;
+         GlobalIndexType b = 0;
          for( GlobalIndexType e = 0; e < tags.getSize(); e++ ) {
             if( hostTags[ e ] & EntityTags::BoundaryEntity )
                hostBoundaryIndices[ b++ ] = e;
diff --git a/src/TNL/Meshes/Readers/MeshReader.h b/src/TNL/Meshes/Readers/MeshReader.h
index 7b929c1b08..b07168c216 100644
--- a/src/TNL/Meshes/Readers/MeshReader.h
+++ b/src/TNL/Meshes/Readers/MeshReader.h
@@ -118,7 +118,8 @@ public:
                                 "gridSpacing has invalid size: " + std::to_string( gridSpacing.size() ) + " (should be 3)" );
 
       // split the extent into begin and end
-      typename MeshType::CoordinatesType begin, end;
+      typename MeshType::CoordinatesType begin;
+      typename MeshType::CoordinatesType end;
       for( int i = 0; i < begin.getSize(); i++ ) {
          begin[ i ] = gridExtent[ 2 * i ];
          end[ i ] = gridExtent[ 2 * i + 1 ];
@@ -126,7 +127,8 @@ public:
       mesh.setDimensions( end - begin );
 
       // transform the origin and calculate proportions
-      typename MeshType::PointType origin, proportions;
+      typename MeshType::PointType origin;
+      typename MeshType::PointType proportions;
       for( int i = 0; i < origin.getSize(); i++ ) {
          origin[ i ] = gridOrigin[ i ] + begin[ i ] * gridSpacing[ i ];
          proportions[ i ] = ( end[ i ] - begin[ i ] ) * gridSpacing[ i ];
diff --git a/src/TNL/Meshes/Readers/NetgenReader.h b/src/TNL/Meshes/Readers/NetgenReader.h
index 3a221d5cce..c11f3d5eb9 100644
--- a/src/TNL/Meshes/Readers/NetgenReader.h
+++ b/src/TNL/Meshes/Readers/NetgenReader.h
@@ -60,7 +60,8 @@ public:
 
       // arrays holding the data from the file
       std::vector< double > pointsArray;
-      std::vector< std::int32_t > connectivityArray, offsetsArray;
+      std::vector< std::int32_t > connectivityArray;
+      std::vector< std::int32_t > offsetsArray;
       std::vector< std::uint8_t > typesArray;
 
       // read points
diff --git a/src/TNL/Meshes/Readers/VTKReader.h b/src/TNL/Meshes/Readers/VTKReader.h
index 67f95964ad..9c7e39619d 100644
--- a/src/TNL/Meshes/Readers/VTKReader.h
+++ b/src/TNL/Meshes/Readers/VTKReader.h
@@ -45,7 +45,8 @@ public:
       // parse the file, find the starting positions of all relevant sections
       findSections( inputFile );
 
-      std::string line, aux;
+      std::string line;
+      std::string aux;
       std::istringstream iss;
 
       // parse points section
@@ -66,7 +67,8 @@ public:
 
       // arrays holding the data from the VTK file
       std::vector< double > pointsArray;
-      std::vector< std::int64_t > cellConnectivityArray, cellOffsetsArray;
+      std::vector< std::int64_t > cellConnectivityArray;
+      std::vector< std::int64_t > cellOffsetsArray;
       std::vector< std::uint8_t > typesArray;
 
       // read points
@@ -269,7 +271,8 @@ public:
          iss >> aux >> datatype;
 
          // arrays for polyhedral mesh
-         std::vector< std::int64_t > faceConnectivityArray, faceOffsetsArray;
+         std::vector< std::int64_t > faceConnectivityArray;
+         std::vector< std::int64_t > faceOffsetsArray;
          std::int64_t faceIndex = 0;
 
          // read connectivity
@@ -657,7 +660,8 @@ protected:
                int values_per_element = 1;
 
                // additional metadata
-               std::string array_name, datatype;
+               std::string array_name;
+               std::string datatype;
 
                if( type == "SCALARS" ) {
                   // parse the rest of the line: SCALARS <array_name> <datatype>
@@ -760,7 +764,8 @@ protected:
 
       // type: SCALARS, VECTORS, etc.
       // datatype: int, float, double
-      std::string type, datatype;
+      std::string type;
+      std::string datatype;
 
       // parse the metadata line
       std::string line;
diff --git a/src/TNL/Meshes/Writers/PVTIWriter.hpp b/src/TNL/Meshes/Writers/PVTIWriter.hpp
index 211d337c93..6a24705cb1 100644
--- a/src/TNL/Meshes/Writers/PVTIWriter.hpp
+++ b/src/TNL/Meshes/Writers/PVTIWriter.hpp
@@ -60,7 +60,9 @@ PVTIWriter< Grid >::writeImageData( const Grid& globalGrid, const unsigned Ghost
    if( pImageDataOpen )
       throw std::logic_error( "The <PImageData> tag is already open." );
 
-   std::stringstream extent, origin, spacing;
+   std::stringstream extent;
+   std::stringstream origin;
+   std::stringstream spacing;
 
    auto dims = globalGrid.getDimensions();
    for( int j = 0; j < dims.getSize(); j++ )
diff --git a/src/TNL/Meshes/Writers/VTIWriter.hpp b/src/TNL/Meshes/Writers/VTIWriter.hpp
index 4433f4e3b6..362e7b2433 100644
--- a/src/TNL/Meshes/Writers/VTIWriter.hpp
+++ b/src/TNL/Meshes/Writers/VTIWriter.hpp
@@ -62,7 +62,9 @@ VTIWriter< Mesh >::writeImageData( const typename Mesh::PointType& gridOrigin,
    if( imageDataOpen )
       throw std::logic_error( "The <ImageData> tag is already open." );
 
-   std::stringstream extent, origin, spacing;
+   std::stringstream extent;
+   std::stringstream origin;
+   std::stringstream spacing;
 
    for( int j = 0; j < Mesh::getMeshDimension(); j++ )
       extent << begin[ j ] << " " << end[ j ] << " ";
diff --git a/src/TNL/Meshes/Writers/VTUWriter.hpp b/src/TNL/Meshes/Writers/VTUWriter.hpp
index 0ce2910aa1..6a945dc337 100644
--- a/src/TNL/Meshes/Writers/VTUWriter.hpp
+++ b/src/TNL/Meshes/Writers/VTUWriter.hpp
@@ -67,7 +67,8 @@ VTUWriter< Mesh >::writeEntities( const Mesh& mesh )
 
    // collect all data before writing
    using IndexType = typename Mesh::GlobalIndexType;
-   std::vector< IndexType > connectivity, offsets;
+   std::vector< IndexType > connectivity;
+   std::vector< IndexType > offsets;
    std::vector< std::uint8_t > types;
    detail::MeshEntitiesVTUCollector< Mesh, EntityDimension >::exec( mesh, connectivity, offsets, types );
 
diff --git a/src/TNL/Timer.hpp b/src/TNL/Timer.hpp
index 14fc3202c0..6f62f6eae5 100644
--- a/src/TNL/Timer.hpp
+++ b/src/TNL/Timer.hpp
@@ -121,7 +121,8 @@ Timer::durationToDouble( const Duration& duration ) const
 inline unsigned long long
 Timer::rdtsc() const
 {
-   unsigned hi, lo;
+   unsigned hi;
+   unsigned lo;
    __asm__ __volatile__( "rdtsc" : "=a"( lo ), "=d"( hi ) );
    return ( (unsigned long long) lo ) | ( ( (unsigned long long) hi ) << 32 );
 }
diff --git a/src/Tools/tnl-decompose-mesh.cpp b/src/Tools/tnl-decompose-mesh.cpp
index 7ab9982ddf..4aad8fc7b6 100644
--- a/src/Tools/tnl-decompose-mesh.cpp
+++ b/src/Tools/tnl-decompose-mesh.cpp
@@ -321,7 +321,8 @@ decompose_and_save( const Mesh& mesh,
    IndexArray seed_to_cell_index( cellsCount );
    for( unsigned p = 0; p < nparts; p++ ) {
       Index assigned = 0;
-      std::set< Index > boundary, ghost_neighbors;
+      std::set< Index > boundary;
+      std::set< Index > ghost_neighbors;
       for( Index local_idx = 0; local_idx < cells_counts[ p ]; local_idx++ ) {
          const Index global_idx = cells_local_to_global[ cells_offsets[ p ] + local_idx ];
          const auto& cell = mesh.template getEntity< typename Mesh::Cell >( global_idx );
@@ -519,7 +520,8 @@ decompose_and_save( const Mesh& mesh,
       seeds_global_indices.shrink_to_fit();
 
       // create "vtkGhostType" CellData and PointData arrays - see https://blog.kitware.com/ghost-and-blanking-visibility-changes/
-      Containers::Array< std::uint8_t, Devices::Sequential, Index > cellGhosts( seeds.size() ), pointGhosts( points.getSize() );
+      Containers::Array< std::uint8_t, Devices::Sequential, Index > cellGhosts( seeds.size() );
+      Containers::Array< std::uint8_t, Devices::Sequential, Index > pointGhosts( points.getSize() );
       for( Index i = 0; i < cells_counts[ p ]; i++ )
          cellGhosts[ i ] = 0;
       for( Index i = cells_counts[ p ]; i < (Index) seeds.size(); i++ )
@@ -619,7 +621,8 @@ void run( const Mesh& mesh, const Config::ParameterContainer& parameters )
    // get the mesh connectivity information in a format suitable for METIS. Actually, the same
    // format is used by the XML-based VTK formats - the only difference is that METIS requires
    // `offsets` to start with 0.
-   std::vector< idx_t > connectivity, offsets;
+   std::vector< idx_t > connectivity;
+   std::vector< idx_t > offsets;
    offsets.push_back(0);
    const Index cellsCount = mesh.template getEntitiesCount< typename Mesh::Cell >();
    for( Index i = 0; i < cellsCount; i++ ) {
-- 
GitLab