diff --git a/dune/common/bitsetvector.hh b/dune/common/bitsetvector.hh index 3215b7b931d5d9df3036c2eab015090c7410a593..4fef17db08be5d1a6ae59e26496af3325f0ee7de 100644 --- a/dune/common/bitsetvector.hh +++ b/dune/common/bitsetvector.hh @@ -38,10 +38,10 @@ namespace Dune { typedef Dune::BitSetVector<block_size, Alloc> BitSetVector; friend class Dune::BitSetVector<block_size, Alloc>; - BitSetVectorConstReference(const BitSetVector& blockBitField, int block_number) : - blockBitField(blockBitField), - block_number(block_number) - {}; + BitSetVectorConstReference(const BitSetVector& blockBitField_, int block_number_) : + blockBitField(blockBitField_), + block_number(block_number_) + {} //! hide assignment operator BitSetVectorConstReference& operator=(const BitSetVectorConstReference & b); @@ -212,10 +212,10 @@ namespace Dune { typedef Dune::BitSetVectorConstReference<block_size,Alloc> BitSetVectorConstReference; - BitSetVectorReference(BitSetVector& blockBitField, int block_number) : - BitSetVectorConstReference(blockBitField, block_number), - blockBitField(blockBitField) - {}; + BitSetVectorReference(BitSetVector& blockBitField_, int block_number_) : + BitSetVectorConstReference(blockBitField_, block_number_), + blockBitField(blockBitField_) + {} public: typedef std::bitset<block_size> bitset; diff --git a/dune/common/parallel/communicator.hh b/dune/common/parallel/communicator.hh index f8654cf811354678cbe42cfbc1782d0ed23550a1..d5225807c2ccaacf7b2b43f709fe7a812d26a7f7 100644 --- a/dune/common/parallel/communicator.hh +++ b/dune/common/parallel/communicator.hh @@ -1095,8 +1095,8 @@ namespace Dune int messageLength; MPI_Error_string(status[i].MPI_ERROR, message, &messageLength); std::cerr<<" source="<<status[i].MPI_SOURCE<<" message: "; - for(int i=0; i< messageLength; i++) - std::cout<<message[i]; + for(int j = 0; j < messageLength; j++) + std::cout << message[j]; } std::cerr<<std::endl; success=0; @@ -1113,8 +1113,8 @@ namespace Dune int messageLength; MPI_Error_string(status[i].MPI_ERROR, message, &messageLength); std::cerr<<" source="<<status[i].MPI_SOURCE<<" message: "; - for(int i=0; i< messageLength; i++) - std::cerr<<message[i]; + for(int j = 0; j < messageLength; j++) + std::cerr << message[j]; } std::cerr<<std::endl; success=0; diff --git a/dune/common/parallel/indicessyncer.hh b/dune/common/parallel/indicessyncer.hh index 40f6cef17bc36acfbf54d8b721f8ab9a69f6c537..53678699590d83b5e2cdfdca06a09bfffa19c6db 100644 --- a/dune/common/parallel/indicessyncer.hh +++ b/dune/common/parallel/indicessyncer.hh @@ -776,13 +776,13 @@ namespace Dune std::size_t noOldNeighbours = remoteIndices_.neighbours(); int* oldNeighbours = new int[noOldNeighbours]; sendBufferSizes_ = new std::size_t[noOldNeighbours]; - std::size_t i=0; + std::size_t neighbourI = 0; - for(RemoteIterator remote = remoteIndices_.begin(); remote != end; ++remote, ++i) { + for(RemoteIterator remote = remoteIndices_.begin(); remote != end; ++remote, ++neighbourI) { typedef typename RemoteIndices::RemoteIndexList::const_iterator RemoteIndexIterator; - oldNeighbours[i]=remote->first; + oldNeighbours[neighbourI] = remote->first; // Make sure we only have one remote index list. assert(remote->second.first==remote->second.second); @@ -824,7 +824,7 @@ namespace Dune Dune::dverb<<rank_<<": Neighbours: "; - for(i = 0; i<noOldNeighbours; ++i) + for(std::size_t i = 0; i<noOldNeighbours; ++i) Dune::dverb<<oldNeighbours[i]<<" "; Dune::dverb<<std::endl; @@ -833,11 +833,11 @@ namespace Dune MPI_Status* statuses = new MPI_Status[noOldNeighbours]; // Pack Message data and start the sends - for(i = 0; i<noOldNeighbours; ++i) + for(std::size_t i = 0; i<noOldNeighbours; ++i) packAndSend(oldNeighbours[i], sendBuffers_[i], sendBufferSizes_[i], requests[i]); // Probe for incoming messages, receive and unpack them - for(i = 0; i<noOldNeighbours; ++i) + for(std::size_t i = 0; i<noOldNeighbours; ++i) recvAndUnpack(numberer); // }else{ // recvAndUnpack(oldNeighbours[i], numberer); @@ -851,7 +851,7 @@ namespace Dune // Wait for completion of sends if(MPI_SUCCESS!=MPI_Waitall(noOldNeighbours, requests, statuses)) { std::cerr<<": MPI_Error occurred while sending message"<<std::endl; - for(i=0; i< noOldNeighbours; i++) + for(std::size_t i=0; i< noOldNeighbours; i++) if(MPI_SUCCESS!=statuses[i].MPI_ERROR) std::cerr<<"Destination "<<statuses[i].MPI_SOURCE<<" error code: "<<statuses[i].MPI_ERROR<<std::endl; } @@ -961,9 +961,9 @@ namespace Dune assert(pairs <= infoSend_[destination].pairs); MPI_Pack(&process, 1, MPI_INT, buffer, bufferSize, &bpos, remoteIndices_.communicator()); - char attr = iterators->second.remoteIndex().attribute(); + char attr2 = iterators->second.remoteIndex().attribute(); - MPI_Pack(&attr, 1, MPI_CHAR, buffer, bufferSize, &bpos, + MPI_Pack(&attr2, 1, MPI_CHAR, buffer, bufferSize, &bpos, remoteIndices_.communicator()); --indices; } diff --git a/dune/common/parallel/remoteindices.hh b/dune/common/parallel/remoteindices.hh index e47cad69d9bf41c66ee708fe6443c44382c497f9..bf5c43fcbc827764c77ea321b26e03b66231eed3 100644 --- a/dune/common/parallel/remoteindices.hh +++ b/dune/common/parallel/remoteindices.hh @@ -1120,7 +1120,7 @@ namespace Dune { template<typename T, typename A> template<bool ignorePublic> - inline void RemoteIndices<T,A>::buildRemote(bool includeSelf) + inline void RemoteIndices<T,A>::buildRemote(bool includeSelf_) { // Processor configuration int rank, procs; @@ -1134,7 +1134,7 @@ namespace Dune { // Do we need to send two index sets? char sendTwo = (source_ != target_); - if(procs==1 && !(sendTwo || includeSelf)) + if(procs==1 && !(sendTwo || includeSelf_)) // Nothing to communicate return; @@ -1209,9 +1209,9 @@ namespace Dune { // Update remote indices for ourself - if(sendTwo|| includeSelf) + if(sendTwo|| includeSelf_) unpackCreateRemote(buffer[0], sourcePairs, destPairs, rank, sourcePublish, - destPublish, bufferSize, sendTwo, includeSelf); + destPublish, bufferSize, sendTwo, includeSelf_); neighbourIds.erase(rank); @@ -1866,11 +1866,8 @@ namespace Dune { if(!rindex->second.second->empty()) { os<<rank<<": Prozess "<<rindex->first<<": "<<"receive: "; - const typename RList::const_iterator rend= rindex->second.second->end(); - - for(typename RList::const_iterator index = rindex->second.second->begin(); - index != rend; ++index) - os<<*index<<" "; + for(const auto& index : *(rindex->second.second)) + os << index << " "; } os<<std::endl<<std::flush; }